1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/toplevel.h
3 // Purpose: wxTopLevelWindowMSW is the MSW 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_
15 enum ETemplateID
{ kResizeableDialog
= 130
20 // ----------------------------------------------------------------------------
21 // wxTopLevelWindowOS2
22 // ----------------------------------------------------------------------------
24 class WXDLLEXPORT wxTopLevelWindowOS2
: public wxTopLevelWindowBase
27 // constructors and such
28 wxTopLevelWindowOS2() { Init(); }
30 wxTopLevelWindowOS2( wxWindow
* pParent
32 ,const wxString
& rsTitle
33 ,const wxPoint
& rPos
= wxDefaultPosition
34 ,const wxSize
& rSize
= wxDefaultSize
35 ,long lStyle
= wxDEFAULT_FRAME_STYLE
36 ,const wxString
& rsName
= wxFrameNameStr
41 (void)Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
44 bool Create( wxWindow
* pParent
46 ,const wxString
& rsTitle
47 ,const wxPoint
& rPos
= wxDefaultPosition
48 ,const wxSize
& rSize
= wxDefaultSize
49 ,long lStyle
= wxDEFAULT_FRAME_STYLE
50 ,const wxString
& rsName
= wxFrameNameStr
53 virtual ~wxTopLevelWindowOS2();
56 // Implement base class pure virtuals
58 virtual void Iconize(bool bIconize
= TRUE
);
59 inline virtual bool IsFullScreen(void) const { return m_bFsIsShowing
; }
60 virtual bool IsIconized(void) const;
61 virtual bool IsMaximized(void) const;
62 virtual void Maximize(bool bMaximize
= TRUE
);
63 virtual void Restore(void);
64 virtual void SendSizeEvent(void);
65 virtual void SetIcon(const wxIcon
& rIcon
);
66 virtual void SetIcons(const wxIconBundle
& rIcons
);
68 virtual bool Show(bool bShow
= TRUE
);
69 virtual bool ShowFullScreen( bool bShow
70 ,long lStyle
= wxFULLSCREEN_ALL
74 // EnableCloseButton(FALSE) may be used to remove the "Close"
75 // button from the title bar
77 bool EnableCloseButton(bool bEnable
= TRUE
);
78 HWND
GetFrame(void) const { return m_hFrame
; }
81 // Implementation from now on
82 // --------------------------
84 PSWP
GetSwpClient(void) { return &m_vSwpClient
; }
86 void OnActivate(wxActivateEvent
& rEvent
);
88 void SetLastFocus(wxWindow
*pWin
) { m_pWinLastFocused
= pWin
; }
89 wxWindow
* GetLastFocus(void) const { return m_pWinLastFocused
; }
92 // Common part of all ctors
97 // Create a new frame, return FALSE if it couldn't be created
99 bool CreateFrame( const wxString
& rsTitle
105 // Create a new dialog using the given dialog template from resources,
106 // return FALSE if it couldn't be created
108 bool CreateDialog( ULONG ulDlgTemplate
109 ,const wxString
& rsTitle
115 // Common part of Iconize(), Maximize() and Restore()
117 void DoShowWindow(int nShowCmd
);
120 // Implement the geometry-related methods for a top level window
122 virtual void DoSetClientSize( int nWidth
125 virtual void DoGetClientSize( int* pnWidth
130 // Translate wxWidgets flags into OS flags
132 virtual WXDWORD
OS2GetStyle( long lFlag
137 // Choose the right parent to use with CreateWindow()
139 virtual WXHWND
OS2GetParent(void) const;
142 // Is the frame currently iconized?
147 // Should the frame be maximized when it will be shown? set by Maximize()
148 // when it is called while the frame is hidden
150 bool m_bMaximizeOnShow
;
153 // Data to save/restore when calling ShowFullScreen
155 long m_lFsStyle
; // Passed to ShowFullScreen
157 long m_lFsOldWindowStyle
;
158 bool m_bFsIsMaximized
;
161 wxWindow
* m_pWinLastFocused
;
166 static bool m_sbInitialized
;
167 static wxWindow
* m_spHiddenParent
;
169 DECLARE_EVENT_TABLE()
170 }; // end of CLASS wxTopLevelWindowOS2
172 #endif // _WX_MSW_TOPLEVEL_H_