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.

67 lines
1.9 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef ATTRIBUTEINTCHOICEPANEL_h
  9. #define ATTRIBUTEINTCHOICEPANEL_h
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "dme_controls/BaseAttributeChoicePanel.h"
  14. #include "movieobjects/dmeeditortypedictionary.h"
  15. #include "vgui_controls/MessageMap.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. struct AttributeWidgetInfo_t;
  20. namespace vgui
  21. {
  22. class Panel;
  23. class ComboBox;
  24. }
  25. //-----------------------------------------------------------------------------
  26. // Configuration for integer choices
  27. //-----------------------------------------------------------------------------
  28. class CDmeEditorIntChoicesInfo : public CDmeEditorChoicesInfo
  29. {
  30. DEFINE_ELEMENT( CDmeEditorIntChoicesInfo, CDmeEditorChoicesInfo );
  31. public:
  32. // Add a choice
  33. void AddChoice( int nValue, const char *pChoiceString );
  34. // Gets the choices
  35. int GetChoiceValue( int nIndex ) const;
  36. };
  37. //-----------------------------------------------------------------------------
  38. // CAttributeIntChoicePanel
  39. //-----------------------------------------------------------------------------
  40. class CAttributeIntChoicePanel : public CBaseAttributeChoicePanel
  41. {
  42. DECLARE_CLASS_SIMPLE( CAttributeIntChoicePanel, CBaseAttributeChoicePanel );
  43. public:
  44. CAttributeIntChoicePanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info );
  45. private:
  46. // Derived classes can re-implement this to fill the combo box however they like
  47. virtual void PopulateComboBox( vgui::ComboBox *pComboBox );
  48. virtual void SetAttributeFromComboBox( vgui::ComboBox *pComboBox, KeyValues *pKeyValues );
  49. virtual void SetComboBoxFromAttribute( vgui::ComboBox *pComboBox );
  50. };
  51. #endif // ATTRIBUTEINTCHOICEPANEL_h