WindowControl.h 1.4 KB

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