toplevel.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/toplevel.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling, Julian Smart
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKTOPLEVELH__
  9. #define __GTKTOPLEVELH__
  10. //-----------------------------------------------------------------------------
  11. // wxTopLevelWindowGTK
  12. //-----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
  14. {
  15. public:
  16. // construction
  17. wxTopLevelWindowGTK() { Init(); }
  18. wxTopLevelWindowGTK(wxWindow *parent,
  19. wxWindowID id,
  20. const wxString& title,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = wxDEFAULT_FRAME_STYLE,
  24. const wxString& name = wxFrameNameStr)
  25. {
  26. Init();
  27. Create(parent, id, title, pos, size, style, name);
  28. }
  29. bool Create(wxWindow *parent,
  30. wxWindowID id,
  31. const wxString& title,
  32. const wxPoint& pos = wxDefaultPosition,
  33. const wxSize& size = wxDefaultSize,
  34. long style = wxDEFAULT_FRAME_STYLE,
  35. const wxString& name = wxFrameNameStr);
  36. virtual ~wxTopLevelWindowGTK();
  37. // implement base class pure virtuals
  38. virtual void Maximize(bool maximize = true);
  39. virtual bool IsMaximized() const;
  40. virtual void Iconize(bool iconize = true);
  41. virtual bool IsIconized() const;
  42. virtual void SetIcons(const wxIconBundle& icons);
  43. virtual void Restore();
  44. virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
  45. virtual bool IsFullScreen() const { return m_fsIsShowing; }
  46. virtual bool SetShape(const wxRegion& region);
  47. virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
  48. virtual void SetWindowStyleFlag( long style );
  49. virtual bool Show(bool show = true);
  50. virtual void Raise();
  51. virtual bool IsActive();
  52. virtual void SetTitle( const wxString &title );
  53. virtual wxString GetTitle() const { return m_title; }
  54. // Experimental, to allow help windows to be
  55. // viewable from within modal dialogs
  56. virtual void AddGrab();
  57. virtual void RemoveGrab();
  58. virtual bool IsGrabbed() const { return m_grabbed; }
  59. // implementation from now on
  60. // --------------------------
  61. // move the window to the specified location and resize it: this is called
  62. // from both DoSetSize() and DoSetClientSize()
  63. virtual void DoMoveWindow(int x, int y, int width, int height);
  64. // GTK callbacks
  65. virtual void GtkOnSize( int x, int y, int width, int height );
  66. virtual void OnInternalIdle();
  67. // do *not* call this to iconize the frame, this is a private function!
  68. void SetIconizeState(bool iconic);
  69. int m_miniEdge,
  70. m_miniTitle;
  71. GtkWidget *m_mainWidget;
  72. bool m_insertInClientArea; /* not from within OnCreateXXX */
  73. bool m_fsIsShowing; /* full screen */
  74. long m_fsSaveGdkFunc, m_fsSaveGdkDecor;
  75. long m_fsSaveFlag;
  76. wxRect m_fsSaveFrame;
  77. // m_windowStyle translated to GDK's terms
  78. long m_gdkFunc,
  79. m_gdkDecor;
  80. // private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
  81. // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
  82. int m_urgency_hint;
  83. protected:
  84. // common part of all ctors
  85. void Init();
  86. // override wxWindow methods to take into account tool/menu/statusbars
  87. virtual void DoSetSize(int x, int y,
  88. int width, int height,
  89. int sizeFlags = wxSIZE_AUTO);
  90. virtual void DoSetClientSize(int width, int height);
  91. virtual void DoGetClientSize( int *width, int *height ) const;
  92. wxString m_title;
  93. // is the frame currently iconized?
  94. bool m_isIconized;
  95. // is the frame currently grabbed explicitly
  96. // by the application?
  97. bool m_grabbed;
  98. };
  99. #endif // __GTKTOPLEVELH__