PropertyTree.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_CONTROLS_PROPERTYTREE_H
  8. #define GWEN_CONTROLS_PROPERTYTREE_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Controls/Label.h"
  11. #include "Gwen/Gwen.h"
  12. #include "Gwen/Skin.h"
  13. #include "Gwen/Controls/TreeControl.h"
  14. #include "Gwen/Controls/Properties.h"
  15. namespace Gwen
  16. {
  17. namespace Controls
  18. {
  19. class PropertyTreeNode : public TreeNode
  20. {
  21. public:
  22. GWEN_CONTROL_INLINE( PropertyTreeNode, TreeNode )
  23. {
  24. }
  25. virtual void Render( Skin::Base* skin )
  26. {
  27. skin->DrawPropertyTreeNode( this, m_InnerPanel->X(), m_InnerPanel->Y() );
  28. }
  29. };
  30. class PropertyTree : public TreeControl
  31. {
  32. public:
  33. GWEN_CONTROL_INLINE( PropertyTree, TreeControl )
  34. {
  35. }
  36. Properties* Add( const UnicodeString& text )
  37. {
  38. TreeNode* node = new PropertyTreeNode( this );
  39. node->SetText( text );
  40. node->Dock( Pos::Top );
  41. Properties* props = new Properties( node );
  42. props->Dock( Pos::Top );
  43. return props;
  44. }
  45. };
  46. }
  47. }
  48. #endif