1 /* 2 GWEN 3 Copyright (c) 2010 Facepunch Studios 4 See license in Gwen.h 5 */ 6 7 #pragma once 8 #ifndef GWEN_CONTROLS_WINDOWCONTROL_H 9 #define GWEN_CONTROLS_WINDOWCONTROL_H 10 11 #include "Gwen/Gwen.h" 12 #include "Gwen/Controls/Base.h" 13 #include "Gwen/Controls/Label.h" 14 #include "Gwen/Controls/Button.h" 15 #include "Gwen/Controls/Dragger.h" 16 #include "Gwen/Controls/Label.h" 17 #include "Gwen/Controls/ResizableControl.h" 18 #include "Gwen/Controls/Modal.h" 19 #include "Gwen/Skin.h" 20 21 namespace Gwen 22 { 23 namespace Controls 24 { 25 class GWEN_EXPORT WindowControl : public ResizableControl 26 { 27 public: 28 GWEN_CONTROL(WindowControl, ResizableControl); 29 30 virtual ~WindowControl(); 31 virtual void Render(Skin::Base* skin); 32 virtual void RenderUnder(Skin::Base* skin); 33 34 virtual void SetTitle(Gwen::UnicodeString title); SetTitle(Gwen::String title)35 virtual void SetTitle(Gwen::String title) { SetTitle(Gwen::Utility::StringToUnicode(title)); } 36 virtual void SetClosable(bool closeable); 37 38 virtual void Touch(); 39 bool IsOnTop(); 40 41 virtual void SetHidden(bool hidden); 42 43 void CloseButtonPressed(Gwen::Controls::Base* pFromPanel); 44 void RenderFocus(Gwen::Skin::Base* skin); SetDeleteOnClose(bool b)45 void SetDeleteOnClose(bool b) { m_bDeleteOnClose = b; } 46 void MakeModal(bool invisible = false); 47 48 protected: 49 ControlsInternal::Dragger* m_TitleBar; 50 Label* m_Title; 51 Button* m_CloseButton; 52 53 bool m_bInFocus; 54 bool m_bDeleteOnClose; 55 56 ControlsInternal::Modal* m_Modal; 57 }; 58 } // namespace Controls 59 } // namespace Gwen 60 #endif 61