toplevel.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/toplevel.h
  3. // Purpose: wxTopLevelWindowX11 is the X11 implementation of wxTLW
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 20.09.01
  7. // Copyright: (c) 2002 Julian Smart
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_X11_TOPLEVEL_H_
  11. #define _WX_X11_TOPLEVEL_H_
  12. // ----------------------------------------------------------------------------
  13. // wxTopLevelWindowX11
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_CORE wxTopLevelWindowX11 : public wxTopLevelWindowBase
  16. {
  17. public:
  18. // constructors and such
  19. wxTopLevelWindowX11() { Init(); }
  20. wxTopLevelWindowX11(wxWindow *parent,
  21. wxWindowID id,
  22. const wxString& title,
  23. const wxPoint& pos = wxDefaultPosition,
  24. const wxSize& size = wxDefaultSize,
  25. long style = wxDEFAULT_FRAME_STYLE,
  26. const wxString& name = wxFrameNameStr)
  27. {
  28. Init();
  29. (void)Create(parent, id, title, pos, size, style, name);
  30. }
  31. bool Create(wxWindow *parent,
  32. wxWindowID id,
  33. const wxString& title,
  34. const wxPoint& pos = wxDefaultPosition,
  35. const wxSize& size = wxDefaultSize,
  36. long style = wxDEFAULT_FRAME_STYLE,
  37. const wxString& name = wxFrameNameStr);
  38. virtual ~wxTopLevelWindowX11();
  39. // implement base class pure virtuals
  40. virtual void Maximize(bool maximize = true);
  41. virtual bool IsMaximized() const;
  42. virtual void Iconize(bool iconize = true);
  43. virtual bool IsIconized() const;
  44. virtual void SetIcons(const wxIconBundle& icons);
  45. virtual void Restore();
  46. virtual bool Show( bool show = true );
  47. virtual bool ShowFullScreen( bool show, long style = wxFULLSCREEN_ALL );
  48. virtual bool IsFullScreen() const { return m_fsIsShowing; }
  49. virtual void SetTitle( const wxString& title);
  50. virtual wxString GetTitle() const;
  51. // implementation
  52. void SetNeedResizeInIdle( bool set = true )
  53. { m_needResizeInIdle = set; }
  54. void SetConfigureGeometry( int x, int y, int width, int height )
  55. { m_x = x; m_y = y; m_width = width; m_height = height; }
  56. virtual bool SetShape(const wxRegion& region);
  57. // For implementation purposes - sometimes decorations make the
  58. // client area smaller
  59. virtual wxPoint GetClientAreaOrigin() const;
  60. virtual void OnInternalIdle();
  61. protected:
  62. // common part of all ctors
  63. void Init();
  64. // set the icon for the window
  65. void DoSetIcon( const wxIcon& icon );
  66. // For implementation of delayed resize events
  67. bool m_needResizeInIdle;
  68. virtual void DoGetClientSize( int *width, int *height ) const;
  69. virtual void DoGetSize( int *width, int *height ) const;
  70. virtual void DoSetClientSize(int width, int height);
  71. virtual void DoSetSize(int x, int y,
  72. int width, int height,
  73. int sizeFlags = wxSIZE_AUTO);
  74. virtual void DoGetPosition( int *x, int *y ) const;
  75. // Is the frame currently iconized?
  76. bool m_iconized;
  77. // Should the frame be maximized when it will be shown? set by Maximize()
  78. // when it is called while the frame is hidden
  79. bool m_maximizeOnShow;
  80. // Data to save/restore when calling ShowFullScreen
  81. long m_fsStyle; // Passed to ShowFullScreen
  82. wxRect m_fsOldSize;
  83. bool m_fsIsMaximized;
  84. bool m_fsIsShowing;
  85. wxString m_title;
  86. // Geometry
  87. int m_x,m_y,m_width,m_height;
  88. };
  89. // list of all frames and modeless dialogs
  90. //extern WXDLLIMPEXP_DATA_CORE(wxWindowList) wxModelessWindows;
  91. #endif // _WX_X11_TOPLEVEL_H_