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.

65 lines
1.7 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef BASEATTRIBUTECHOICEPANEL_h
  9. #define BASEATTRIBUTECHOICEPANEL_h
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "dme_controls/BaseAttributePanel.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class CDmElement;
  18. struct AttributeWidgetInfo_t;
  19. namespace vgui
  20. {
  21. class IScheme;
  22. class Panel;
  23. class Label;
  24. class ComboBox;
  25. }
  26. //-----------------------------------------------------------------------------
  27. // CBaseAttributeChoicePanel
  28. //-----------------------------------------------------------------------------
  29. class CBaseAttributeChoicePanel : public CBaseAttributePanel
  30. {
  31. DECLARE_CLASS_SIMPLE( CBaseAttributeChoicePanel, CBaseAttributePanel );
  32. public:
  33. CBaseAttributeChoicePanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info );
  34. virtual void PostConstructor();
  35. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  36. protected:
  37. virtual void Refresh();
  38. private:
  39. // Derived classes can re-implement this to fill the combo box however they like
  40. virtual void PopulateComboBox( vgui::ComboBox *pComboBox ) = 0;
  41. virtual void SetAttributeFromComboBox( vgui::ComboBox *pComboBox, KeyValues *pKeyValues ) = 0;
  42. virtual void SetComboBoxFromAttribute( vgui::ComboBox *pComboBox ) = 0;
  43. MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel );
  44. virtual void Apply();
  45. virtual vgui::Panel *GetDataPanel();
  46. vgui::ComboBox *m_pData;
  47. };
  48. #endif // BASEATTRIBUTECHOICEPANEL_h