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.

69 lines
2.0 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef ATTRIBUTEBOOLCHOICEPANEL_h
  9. #define ATTRIBUTEBOOLCHOICEPANEL_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 CDmeEditorBoolChoicesInfo : public CDmeEditorChoicesInfo
  29. {
  30. DEFINE_ELEMENT( CDmeEditorBoolChoicesInfo, CDmeEditorChoicesInfo );
  31. public:
  32. // Add a choice
  33. void SetFalseChoice( const char *pChoiceString );
  34. void SetTrueChoice( const char *pChoiceString );
  35. // Gets the choices
  36. const char *GetFalseChoiceString( ) const;
  37. const char *GetTrueChoiceString( ) const;
  38. };
  39. //-----------------------------------------------------------------------------
  40. // CAttributeBoolChoicePanel
  41. //-----------------------------------------------------------------------------
  42. class CAttributeBoolChoicePanel : public CBaseAttributeChoicePanel
  43. {
  44. DECLARE_CLASS_SIMPLE( CAttributeBoolChoicePanel, CBaseAttributeChoicePanel );
  45. public:
  46. CAttributeBoolChoicePanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info );
  47. private:
  48. // Derived classes can re-implement this to fill the combo box however they like
  49. virtual void PopulateComboBox( vgui::ComboBox *pComboBox );
  50. virtual void SetAttributeFromComboBox( vgui::ComboBox *pComboBox, KeyValues *pKeyValues );
  51. virtual void SetComboBoxFromAttribute( vgui::ComboBox *pComboBox );
  52. };
  53. #endif // ATTRIBUTEBOOLCHOICEPANEL_h