Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef FILELISTMANAGER_H
  8. #define FILELISTMANAGER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "datamodel/idatamodel.h"
  13. #include "vgui_controls/listpanel.h"
  14. #include "vgui_controls/Frame.h"
  15. #include "vgui/KeyCode.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. namespace vgui
  20. {
  21. class CheckButtonList;
  22. }
  23. //-----------------------------------------------------------------------------
  24. // CFileListManager
  25. //-----------------------------------------------------------------------------
  26. class CFileListManager : public vgui::ListPanel
  27. {
  28. DECLARE_CLASS_SIMPLE( CFileListManager , vgui::ListPanel );
  29. public:
  30. CFileListManager( vgui::Panel *parent );
  31. virtual void Refresh();
  32. virtual void OnCommand( const char *cmd );
  33. virtual void OnThink();
  34. virtual void OnMousePressed( vgui::MouseCode code );
  35. protected:
  36. MESSAGE_FUNC_PARAMS( OnOpenContextMenu, "OpenContextMenu", pParams );
  37. MESSAGE_FUNC_PARAMS( OnOpenFile, "open", pParams );
  38. MESSAGE_FUNC_PARAMS( OnLoadFiles, "load", pParams );
  39. MESSAGE_FUNC_PARAMS( OnUnloadFiles, "unload", pParams );
  40. MESSAGE_FUNC_PARAMS( OnSaveFiles, "save", pParams );
  41. MESSAGE_FUNC_PARAMS( OnSaveFileAs, "saveas", pParams );
  42. MESSAGE_FUNC_PARAMS( OnAddToPerforce, "p4add", pParams );
  43. MESSAGE_FUNC_PARAMS( OnOpenForEdit, "p4edit", pParams );
  44. MESSAGE_FUNC_PARAMS( OnFileSelected, "FileSelected", pParams );
  45. MESSAGE_FUNC_PARAMS( OnDataChanged, "DataChanged", pParams );
  46. int AddItem( DmFileId_t fileid, const char *pFilename, const char *pPath, bool bLoaded, int nElements, bool bChanged, bool bInPerforce, bool bOpenForEdit );
  47. void SetLoaded( DmFileId_t fileid, bool bLoaded );
  48. vgui::CheckButtonList *m_pFileList;
  49. bool m_bRefreshRequired;
  50. vgui::DHANDLE< vgui::Menu > m_hContextMenu;
  51. };
  52. //-----------------------------------------------------------------------------
  53. // CFileListManagerFrame
  54. //-----------------------------------------------------------------------------
  55. class CFileManagerFrame : public vgui::Frame
  56. {
  57. DECLARE_CLASS_SIMPLE( CFileManagerFrame, vgui::Frame );
  58. public:
  59. CFileManagerFrame( vgui::Panel *parent );
  60. virtual void Refresh();
  61. virtual void OnCommand( const char *cmd );
  62. virtual void PerformLayout();
  63. protected:
  64. CFileListManager *m_pFileListManager;
  65. };
  66. #endif // FILELISTMANAGER_H