TabButton.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_CONTROLS_TABBUTTON_H
  8. #define GWEN_CONTROLS_TABBUTTON_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Controls/Button.h"
  11. namespace Gwen
  12. {
  13. namespace Controls
  14. {
  15. class TabControl;
  16. class GWEN_EXPORT TabButton : public Button
  17. {
  18. public:
  19. GWEN_CONTROL( TabButton, Button );
  20. virtual void Render( Skin::Base* skin );
  21. void SetPage( Base* page ){ m_Page = page; }
  22. Base* GetPage(){ return m_Page; }
  23. void SetTabControl( TabControl* ctrl );
  24. TabControl* GetTabControl(){ return m_Control; }
  25. bool IsActive() { return m_Page && m_Page->Visible(); }
  26. virtual bool DragAndDrop_ShouldStartDrag();
  27. virtual void DragAndDrop_StartDragging( Gwen::DragAndDrop::Package* /*pPackage*/, int /*x*/, int /*y*/ ){ SetHidden( true ); }
  28. virtual void DragAndDrop_EndDragging( bool /*bSuccess*/, int /*x*/, int /*y*/ ){ SetHidden( false ); }
  29. virtual bool OnKeyLeft( bool bDown );
  30. virtual bool OnKeyRight( bool bDown );
  31. virtual bool OnKeyUp( bool bDown );
  32. virtual bool OnKeyDown( bool bDown );
  33. private:
  34. Base* m_Page;
  35. TabControl* m_Control;
  36. };
  37. }
  38. }
  39. #endif