1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/toplevel.h
3 // Purpose: wxTopLevelWindowOS2 is the OS2 implementation of wxTLW
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_TOPLEVEL_H_
12 #define _WX_MSW_TOPLEVEL_H_
16 kResizeableDialog
= 130,
21 // ----------------------------------------------------------------------------
22 // wxTopLevelWindowOS2
23 // ----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxTopLevelWindowOS2
: public wxTopLevelWindowBase
28 // constructors and such
29 wxTopLevelWindowOS2() { Init(); }
31 wxTopLevelWindowOS2( wxWindow
* pParent
33 ,const wxString
& rsTitle
34 ,const wxPoint
& rPos
= wxDefaultPosition
35 ,const wxSize
& rSize
= wxDefaultSize
36 ,long lStyle
= wxDEFAULT_FRAME_STYLE
37 ,const wxString
& rsName
= wxFrameNameStr
42 (void)Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
45 bool Create( wxWindow
* pParent
47 ,const wxString
& rsTitle
48 ,const wxPoint
& rPos
= wxDefaultPosition
49 ,const wxSize
& rSize
= wxDefaultSize
50 ,long lStyle
= wxDEFAULT_FRAME_STYLE
51 ,const wxString
& rsName
= wxFrameNameStr
54 virtual ~wxTopLevelWindowOS2();
57 // Implement base class pure virtuals
59 virtual void SetTitle( const wxString
& title
);
60 virtual wxString
GetTitle() const;
62 virtual void Iconize(bool bIconize
= true);
63 virtual bool IsFullScreen(void) const { return m_bFsIsShowing
; }
64 virtual bool IsIconized(void) const;
65 virtual bool IsMaximized(void) const;
66 virtual void Maximize(bool bMaximize
= true);
67 virtual void Restore(void);
68 virtual void SendSizeEvent(int flags
= 0);
69 virtual void SetIcons(const wxIconBundle
& rIcons
);
71 virtual bool Show(bool bShow
= true);
72 virtual bool ShowFullScreen( bool bShow
,
73 long lStyle
= wxFULLSCREEN_ALL
);
76 // EnableCloseButton(false) may be used to remove the "Close"
77 // button from the title bar
79 bool EnableCloseButton(bool bEnable
= true);
80 HWND
GetFrame(void) const { return m_hFrame
; }
83 // Implementation from now on
84 // --------------------------
86 PSWP
GetSwpClient(void) { return &m_vSwpClient
; }
88 void OnActivate(wxActivateEvent
& rEvent
);
90 void SetLastFocus(wxWindow
*pWin
) { m_pWinLastFocused
= pWin
; }
91 wxWindow
* GetLastFocus(void) const { return m_pWinLastFocused
; }
96 // Common part of all ctors
101 // Create a new frame, return false if it couldn't be created
103 bool CreateFrame( const wxString
& rsTitle
109 // Create a new dialog using the given dialog template from resources,
110 // return false if it couldn't be created
112 bool CreateDialog( ULONG ulDlgTemplate
113 ,const wxString
& rsTitle
119 // Common part of Iconize(), Maximize() and Restore()
121 void DoShowWindow(int nShowCmd
);
124 // Implement the geometry-related methods for a top level window
126 virtual void DoSetClientSize( int nWidth
129 virtual void DoGetClientSize( int* pnWidth
134 // Translate wxWidgets flags into OS flags
136 virtual WXDWORD
OS2GetStyle( long lFlag
141 // Choose the right parent to use with CreateWindow()
143 virtual WXHWND
OS2GetParent(void) const;
146 // Is the frame currently iconized?
151 // Should the frame be maximized when it will be shown? set by Maximize()
152 // when it is called while the frame is hidden
154 bool m_bMaximizeOnShow
;
157 // Data to save/restore when calling ShowFullScreen
159 long m_lFsStyle
; // Passed to ShowFullScreen
161 long m_lFsOldWindowStyle
;
162 bool m_bFsIsMaximized
;
165 wxWindow
* m_pWinLastFocused
;
170 static bool m_sbInitialized
;
171 static wxWindow
* m_spHiddenParent
;
173 DECLARE_EVENT_TABLE()
174 }; // end of CLASS wxTopLevelWindowOS2
176 #endif // _WX_MSW_TOPLEVEL_H_