DockBase.h 2.1 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_DOCKBASE_H
  8. #define GWEN_CONTROLS_DOCKBASE_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Controls/Button.h"
  11. namespace Gwen
  12. {
  13. namespace Controls
  14. {
  15. class DockedTabControl;
  16. class TabControl;
  17. class GWEN_EXPORT DockBase : public Base
  18. {
  19. public:
  20. GWEN_CONTROL( DockBase, Base );
  21. virtual void Render( Skin::Base* skin );
  22. virtual void RenderOver( Skin::Base* skin );
  23. virtual bool IsEmpty();
  24. virtual TabControl* GetTabControl();
  25. virtual DockBase* GetRight(){ return GetChildDock( Pos::Right ); }
  26. virtual DockBase* GetLeft(){ return GetChildDock( Pos::Left ); }
  27. virtual DockBase* GetTop(){ return GetChildDock( Pos::Top ); }
  28. virtual DockBase* GetBottom(){ return GetChildDock( Pos::Bottom ); }
  29. // No action on space (default button action is to press)
  30. virtual bool OnKeySpace( bool /*bDown*/ ){ return false; }
  31. private:
  32. // Drag n Drop
  33. virtual bool DragAndDrop_HandleDrop( Gwen::DragAndDrop::Package* pPackage, int x, int y );
  34. virtual bool DragAndDrop_CanAcceptPackage( Gwen::DragAndDrop::Package* pPackage );
  35. virtual void DragAndDrop_HoverEnter( Gwen::DragAndDrop::Package* pPackage, int x, int y );
  36. virtual void DragAndDrop_HoverLeave( Gwen::DragAndDrop::Package* pPackage );
  37. virtual void DragAndDrop_Hover( Gwen::DragAndDrop::Package* pPackage, int x, int y );
  38. virtual void SetupChildDock( int iPos );
  39. virtual void DoRedundancyCheck();
  40. virtual void DoConsolidateCheck();
  41. virtual void OnRedundantChildDock( DockBase* pDockBase );
  42. virtual int GetDroppedTabDirection( int x, int y );
  43. virtual void OnTabRemoved( Gwen::Controls::Base* pControl );
  44. DockBase* GetChildDock( int iPos );
  45. DockBase** GetChildDockPtr( int iPos );
  46. DockBase* m_Left;
  47. DockBase* m_Right;
  48. DockBase* m_Top;
  49. DockBase* m_Bottom;
  50. // Only CHILD dockpanels have a tabcontrol.
  51. DockedTabControl* m_DockedTabControl;
  52. bool m_bDrawHover;
  53. bool m_bDropFar;
  54. Gwen::Rect m_HoverRect;
  55. };
  56. }
  57. }
  58. #endif