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