1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/toplevel.h
3 // Purpose: wxTopLevelWindowOS2 is the OS2 implementation of wxTLW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_TOPLEVEL_H_
13 #define _WX_MSW_TOPLEVEL_H_
17 kResizeableDialog
= 130,
22 // ----------------------------------------------------------------------------
23 // wxTopLevelWindowOS2
24 // ----------------------------------------------------------------------------
26 class WXDLLIMPEXP_CORE wxTopLevelWindowOS2
: public wxTopLevelWindowBase
29 // constructors and such
30 wxTopLevelWindowOS2() { Init(); }
32 wxTopLevelWindowOS2( wxWindow
* pParent
34 ,const wxString
& rsTitle
35 ,const wxPoint
& rPos
= wxDefaultPosition
36 ,const wxSize
& rSize
= wxDefaultSize
37 ,long lStyle
= wxDEFAULT_FRAME_STYLE
38 ,const wxString
& rsName
= wxFrameNameStr
43 (void)Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
46 bool Create( wxWindow
* pParent
48 ,const wxString
& rsTitle
49 ,const wxPoint
& rPos
= wxDefaultPosition
50 ,const wxSize
& rSize
= wxDefaultSize
51 ,long lStyle
= wxDEFAULT_FRAME_STYLE
52 ,const wxString
& rsName
= wxFrameNameStr
55 virtual ~wxTopLevelWindowOS2();
58 // Implement base class pure virtuals
60 virtual void SetTitle( const wxString
& title
);
61 virtual wxString
GetTitle() const;
63 virtual void Iconize(bool bIconize
= true);
64 virtual bool IsFullScreen(void) const { return m_bFsIsShowing
; }
65 virtual bool IsIconized(void) const;
66 virtual bool IsMaximized(void) const;
67 virtual void Maximize(bool bMaximize
= true);
68 virtual void Restore(void);
69 virtual void SendSizeEvent(int flags
= 0);
70 virtual void SetIcons(const wxIconBundle
& rIcons
);
72 virtual bool Show(bool bShow
= true);
73 virtual bool ShowFullScreen( bool bShow
,
74 long lStyle
= wxFULLSCREEN_ALL
);
77 // EnableCloseButton(false) may be used to remove the "Close"
78 // button from the title bar
80 bool EnableCloseButton(bool bEnable
= true);
81 HWND
GetFrame(void) const { return m_hFrame
; }
84 // Implementation from now on
85 // --------------------------
87 PSWP
GetSwpClient(void) { return &m_vSwpClient
; }
89 void OnActivate(wxActivateEvent
& rEvent
);
91 void SetLastFocus(wxWindow
*pWin
) { m_pWinLastFocused
= pWin
; }
92 wxWindow
* GetLastFocus(void) const { return m_pWinLastFocused
; }
97 // Common part of all ctors
102 // Create a new frame, return false if it couldn't be created
104 bool CreateFrame( const wxString
& rsTitle
110 // Create a new dialog using the given dialog template from resources,
111 // return false if it couldn't be created
113 bool CreateDialog( ULONG ulDlgTemplate
114 ,const wxString
& rsTitle
120 // Common part of Iconize(), Maximize() and Restore()
122 void DoShowWindow(int nShowCmd
);
125 // Implement the geometry-related methods for a top level window
127 virtual void DoSetClientSize( int nWidth
130 virtual void DoGetClientSize( int* pnWidth
135 // Translate wxWidgets flags into OS flags
137 virtual WXDWORD
OS2GetStyle( long lFlag
142 // Choose the right parent to use with CreateWindow()
144 virtual WXHWND
OS2GetParent(void) const;
147 // Is the frame currently iconized?
152 // Should the frame be maximized when it will be shown? set by Maximize()
153 // when it is called while the frame is hidden
155 bool m_bMaximizeOnShow
;
158 // Data to save/restore when calling ShowFullScreen
160 long m_lFsStyle
; // Passed to ShowFullScreen
162 long m_lFsOldWindowStyle
;
163 bool m_bFsIsMaximized
;
166 wxWindow
* m_pWinLastFocused
;
171 static bool m_sbInitialized
;
172 static wxWindow
* m_spHiddenParent
;
174 DECLARE_EVENT_TABLE()
175 }; // end of CLASS wxTopLevelWindowOS2
177 #endif // _WX_MSW_TOPLEVEL_H_