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.

76 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef INFOTARGETPROPERTIESPANEL_H
  7. #define INFOTARGETPROPERTIESPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/editablepanel.h"
  12. #include "tier1/utlstring.h"
  13. #include "datamodel/dmehandle.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class CVcdBlockDoc;
  18. class CDmeVMFEntity;
  19. class CScrollableEditablePanel;
  20. namespace vgui
  21. {
  22. class ComboBox;
  23. class Button;
  24. class TextEntry;
  25. class ListPanel;
  26. class CheckButton;
  27. class RadioButton;
  28. }
  29. //-----------------------------------------------------------------------------
  30. // Panel that shows all entities in the level
  31. //-----------------------------------------------------------------------------
  32. class CInfoTargetPropertiesPanel : public vgui::EditablePanel
  33. {
  34. DECLARE_CLASS_SIMPLE( CInfoTargetPropertiesPanel, vgui::EditablePanel );
  35. public:
  36. CInfoTargetPropertiesPanel( CVcdBlockDoc *pDoc, vgui::Panel* pParent ); // standard constructor
  37. // Sets the object to look at
  38. void SetObject( CDmeVMFEntity *pEntity );
  39. private:
  40. // Populates the info_target fields
  41. void PopulateInfoTargetFields();
  42. // Text to attribute...
  43. void TextEntryToAttribute( vgui::TextEntry *pEntry, const char *pAttributeName );
  44. void TextEntriesToVector( vgui::TextEntry *pEntry[3], const char *pAttributeName );
  45. // Updates entity state when text fields change
  46. void UpdateInfoTarget();
  47. // Messages handled
  48. MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );
  49. CVcdBlockDoc *m_pDoc;
  50. vgui::EditablePanel *m_pInfoTargetScroll;
  51. vgui::EditablePanel *m_pInfoTarget;
  52. vgui::TextEntry *m_pTargetName;
  53. vgui::TextEntry *m_pTargetPosition[3];
  54. vgui::TextEntry *m_pTargetOrientation[3];
  55. CDmeHandle< CDmeVMFEntity > m_hEntity;
  56. };
  57. #endif // INFOTARGETPROPERTIESPANEL_H