Counter Strike : Global Offensive Source Code
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.

93 lines
2.6 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef DMESOURCEDCCFILEPANEL_H
  7. #define DMESOURCEDCCFILEPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/EditablePanel.h"
  12. #include "datamodel/dmehandle.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. namespace vgui
  17. {
  18. class TextEntry;
  19. }
  20. class CDmeSourceDCCFile;
  21. //-----------------------------------------------------------------------------
  22. // Purpose: Asset builder
  23. //-----------------------------------------------------------------------------
  24. class CDmeSourceDCCFilePanel : public vgui::EditablePanel
  25. {
  26. DECLARE_CLASS_SIMPLE( CDmeSourceDCCFilePanel, EditablePanel );
  27. public:
  28. CDmeSourceDCCFilePanel( vgui::Panel *pParent, const char *pPanelName );
  29. virtual ~CDmeSourceDCCFilePanel();
  30. // Inherited from Panel
  31. virtual void OnCommand( const char *pCommand );
  32. virtual void OnKeyCodeTyped( vgui::KeyCode code );
  33. void SetDmeElement( CDmeSourceDCCFile *pSourceDCCFile );
  34. /*
  35. messages sent:
  36. "DmeElementChanged" The element has been changed
  37. */
  38. private:
  39. MESSAGE_FUNC_PARAMS( OnTextNewLine, "TextNewLine", kv );
  40. MESSAGE_FUNC_PARAMS( OnInputCompleted, "InputCompleted", kv );
  41. MESSAGE_FUNC_PARAMS( OnItemSelected, "ItemSelected", kv );
  42. MESSAGE_FUNC_PARAMS( OnItemDeselected, "ItemDeselected", kv );
  43. // Shows the DCC object browser (once we have one)
  44. void ShowDCCObjectBrowser( const char *pTitle, const char *pPrompt, KeyValues *pDialogKeys );
  45. // Called when we're browsing for a DCC object and one was selected
  46. void OnDCCObjectAdded( const char *pDCCObjectName, KeyValues *pContextKeys );
  47. // Refresh the source list
  48. void RefreshDCCObjectList( );
  49. // Called when the source file name changes
  50. bool CheckForDuplicateNames( const char *pDCCObjectName, int nDCCObjectSkipIndex = -1 );
  51. void OnBrowseDCCObject();
  52. void OnAddDCCObject();
  53. void OnRemoveDCCObject();
  54. void OnDCCObjectNameChanged();
  55. // Selects a particular DCC object
  56. void SelectDCCObject( int nDCCObjectIndex );
  57. // Called when a list panel's selection changes
  58. void OnItemSelectionChanged( );
  59. // Marks the file as dirty
  60. void SetDirty( );
  61. vgui::ListPanel *m_pRootDCCObjects;
  62. vgui::Button *m_pDCCObjectBrowser;
  63. vgui::Button *m_pAddDCCObject;
  64. vgui::Button *m_pRemoveDCCObject;
  65. vgui::Button *m_pApplyChanges;
  66. vgui::TextEntry *m_pDCCObjectName;
  67. CDmeHandle< CDmeSourceDCCFile > m_hSourceDCCFile;
  68. };
  69. #endif // DMESOURCEDCCFILEPANEL_H