Properties.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_CONTROLS_PROPERTIES_H
  8. #define GWEN_CONTROLS_PROPERTIES_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Controls/Label.h"
  11. #include "Gwen/Controls/Property/BaseProperty.h"
  12. #include "Gwen/Controls/Property/Text.h"
  13. #include "Gwen/Controls/SplitterBar.h"
  14. #include "Gwen/Gwen.h"
  15. #include "Gwen/Skin.h"
  16. namespace Gwen
  17. {
  18. namespace Controls
  19. {
  20. class PropertyRow;
  21. class GWEN_EXPORT Properties : public Base
  22. {
  23. public:
  24. GWEN_CONTROL( Properties, Base );
  25. virtual void PostLayout( Gwen::Skin::Base* skin );
  26. PropertyRow* Add( const UnicodeString& text, const UnicodeString& value = L"" );
  27. PropertyRow* Add( const String& text, const String& value = "" );
  28. PropertyRow* Add( const UnicodeString& text, Property::Base* pProp );
  29. PropertyRow* Add( const String& text, Property::Base* pProp );
  30. virtual int GetSplitWidth();
  31. virtual void Clear();
  32. protected:
  33. virtual void OnSplitterMoved( Controls::Base * control );
  34. Controls::SplitterBar* m_SplitterBar;
  35. };
  36. class GWEN_EXPORT PropertyRow : public Base
  37. {
  38. public:
  39. GWEN_CONTROL( PropertyRow, Base );
  40. virtual Label* GetLabel(){ return m_Label; }
  41. virtual void SetProperty( Property::Base* prop );
  42. virtual Property::Base* GetProperty(){ return m_Property; }
  43. virtual void Layout( Gwen::Skin::Base* skin );
  44. virtual void Render( Gwen::Skin::Base* skin );
  45. Event::Caller onChange;
  46. protected:
  47. void OnPropertyValueChanged( Gwen::Controls::Base* control );
  48. Label* m_Label;
  49. Property::Base* m_Property;
  50. };
  51. }
  52. }
  53. #endif