RadioButtonController.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_CONTROLS_RADIOBOTTONCONTROLLER_H
  8. #define GWEN_CONTROLS_RADIOBOTTONCONTROLLER_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Controls/Label.h"
  11. #include "Gwen/Controls/RadioButton.h"
  12. namespace Gwen
  13. {
  14. namespace Controls
  15. {
  16. class GWEN_EXPORT RadioButtonController : public Base
  17. {
  18. public:
  19. GWEN_CONTROL( RadioButtonController, Base );
  20. virtual void Render( Skin::Base* /*skin*/ ){};
  21. virtual void OnRadioClicked( Base* pFromPanel );
  22. virtual void OnChange();
  23. virtual LabeledRadioButton* AddOption( const Gwen::String& strText, const Gwen::String& strOptionName = "" );
  24. virtual LabeledRadioButton* AddOption( const Gwen::UnicodeString& strText, const Gwen::String& strOptionName = "" );
  25. virtual LabeledRadioButton* GetSelected(){ return m_Selected; }
  26. virtual String GetSelectedName(){ return m_Selected->GetName(); }
  27. virtual UnicodeString GetSelectedLabel(){ return m_Selected->GetLabel()->GetText(); }
  28. Event::Caller onSelectionChange;
  29. private:
  30. LabeledRadioButton* m_Selected;
  31. };
  32. }
  33. }
  34. #endif