CrossSplitter.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #ifndef GWEN_CONTROLS_CROSSSPLITTER_H
  3. #define GWEN_CONTROLS_CROSSSPLITTER_H
  4. #include "Gwen/Gwen.h"
  5. #include "Gwen/Controls/Base.h"
  6. #include "Gwen/Controls/SplitterBar.h"
  7. namespace Gwen
  8. {
  9. namespace Controls
  10. {
  11. class GWEN_EXPORT CrossSplitter : public Controls::Base
  12. {
  13. public:
  14. GWEN_CONTROL( CrossSplitter, Controls::Base );
  15. void Layout( Skin::Base* skin );
  16. virtual float CalculateValueVertical();
  17. virtual float CalculateValueHorizontal();
  18. virtual void CalculateValueCenter();
  19. virtual void UpdateHSplitter();
  20. virtual void UpdateVSplitter();
  21. virtual void UpdateCSplitter();
  22. virtual void OnVerticalMoved( Controls::Base * control );
  23. virtual void OnHorizontalMoved( Controls::Base * control );
  24. virtual void OnCenterMoved( Controls::Base * control );
  25. virtual void SetPanel( int i, Controls::Base* pPanel );
  26. virtual Controls::Base* GetPanel( int i );
  27. virtual bool IsZoomed(){ return m_iZoomedSection != -1; }
  28. virtual void Zoom( int section );
  29. virtual void UnZoom();
  30. virtual void ZoomChanged();
  31. virtual void CenterPanels() { m_fHVal = 0.5f; m_fVVal = 0.5f; Invalidate(); }
  32. virtual void SetSplittersVisible( bool b ){ m_VSplitter->SetShouldDrawBackground( b ); m_HSplitter->SetShouldDrawBackground( b ); m_CSplitter->SetShouldDrawBackground( b ); }
  33. virtual void SetSplitterSize( int size ) { m_fBarSize = size; }
  34. private:
  35. SplitterBar* m_VSplitter;
  36. SplitterBar* m_HSplitter;
  37. SplitterBar* m_CSplitter;
  38. Controls::Base* m_Sections[4];
  39. float m_fHVal;
  40. float m_fVVal;
  41. int m_fBarSize;
  42. int m_iZoomedSection;
  43. Gwen::Event::Caller onZoomed;
  44. Gwen::Event::Caller onUnZoomed;
  45. Gwen::Event::Caller onZoomChange;
  46. };
  47. }
  48. }
  49. #endif