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 WXDLLEXPORT 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(void);
70 virtual void SetIcon(const wxIcon
& rIcon
);
71 virtual void SetIcons(const wxIconBundle
& rIcons
);
73 virtual bool Show(bool bShow
= true);
74 virtual bool ShowFullScreen( bool bShow
,
75 long lStyle
= wxFULLSCREEN_ALL
);
78 // EnableCloseButton(false) may be used to remove the "Close"
79 // button from the title bar
81 bool EnableCloseButton(bool bEnable
= true);
82 HWND
GetFrame(void) const { return m_hFrame
; }
85 // Implementation from now on
86 // --------------------------
88 PSWP
GetSwpClient(void) { return &m_vSwpClient
; }
90 void OnActivate(wxActivateEvent
& rEvent
);
92 void SetLastFocus(wxWindow
*pWin
) { m_pWinLastFocused
= pWin
; }
93 wxWindow
* GetLastFocus(void) const { return m_pWinLastFocused
; }
98 // Common part of all ctors
103 // Create a new frame, return false if it couldn't be created
105 bool CreateFrame( const wxString
& rsTitle
111 // Create a new dialog using the given dialog template from resources,
112 // return false if it couldn't be created
114 bool CreateDialog( ULONG ulDlgTemplate
115 ,const wxString
& rsTitle
121 // Common part of Iconize(), Maximize() and Restore()
123 void DoShowWindow(int nShowCmd
);
126 // Implement the geometry-related methods for a top level window
128 virtual void DoSetClientSize( int nWidth
131 virtual void DoGetClientSize( int* pnWidth
136 // Translate wxWidgets flags into OS flags
138 virtual WXDWORD
OS2GetStyle( long lFlag
143 // Choose the right parent to use with CreateWindow()
145 virtual WXHWND
OS2GetParent(void) const;
148 // Is the frame currently iconized?
153 // Should the frame be maximized when it will be shown? set by Maximize()
154 // when it is called while the frame is hidden
156 bool m_bMaximizeOnShow
;
159 // Data to save/restore when calling ShowFullScreen
161 long m_lFsStyle
; // Passed to ShowFullScreen
163 long m_lFsOldWindowStyle
;
164 bool m_bFsIsMaximized
;
167 wxWindow
* m_pWinLastFocused
;
172 static bool m_sbInitialized
;
173 static wxWindow
* m_spHiddenParent
;
175 DECLARE_EVENT_TABLE()
176 }; // end of CLASS wxTopLevelWindowOS2
178 #endif // _WX_MSW_TOPLEVEL_H_