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_
16 #pragma interface "toplevel.h"
19 enum ETemplateID
{ kResizeableDialog
= 127
24 // ----------------------------------------------------------------------------
25 // wxTopLevelWindowOS2
26 // ----------------------------------------------------------------------------
28 class WXDLLEXPORT wxTopLevelWindowOS2
: public wxTopLevelWindowBase
31 // constructors and such
32 wxTopLevelWindowOS2() { Init(); }
34 wxTopLevelWindowOS2( wxWindow
* pParent
36 ,const wxString
& rsTitle
37 ,const wxPoint
& rPos
= wxDefaultPosition
38 ,const wxSize
& rSize
= wxDefaultSize
39 ,long lStyle
= wxDEFAULT_FRAME_STYLE
40 ,const wxString
& rsName
= wxFrameNameStr
45 (void)Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
48 bool Create( wxWindow
* pParent
50 ,const wxString
& rsTitle
51 ,const wxPoint
& rPos
= wxDefaultPosition
52 ,const wxSize
& rSize
= wxDefaultSize
53 ,long lStyle
= wxDEFAULT_FRAME_STYLE
54 ,const wxString
& rsName
= wxFrameNameStr
57 virtual ~wxTopLevelWindowOS2();
60 // Implement base class pure virtuals
62 virtual void Iconize(bool bIconize
= TRUE
);
63 inline 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(void);
69 virtual void SetIcon(const wxIcon
& rIcon
);
70 virtual bool Show(bool bShow
= TRUE
);
71 virtual bool ShowFullScreen( bool bShow
72 ,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 virtual void AlterChildPos(void); // OS/2 child control positioning
87 virtual void UpdateInternalSize( wxWindow
* pChild
91 PSWP
GetSwpClient(void) { return &m_vSwpClient
; }
94 // Common part of all ctors
99 // Create a new frame, return FALSE if it couldn't be created
101 bool CreateFrame( const wxString
& rsTitle
107 // Create a new dialog using the given dialog template from resources,
108 // return FALSE if it couldn't be created
110 bool CreateDialog( ULONG ulDlgTemplate
111 ,const wxString
& rsTitle
117 // Common part of Iconize(), Maximize() and Restore()
119 void DoShowWindow(int nShowCmd
);
122 // Implement the geometry-related methods for a top level window
124 virtual void DoSetClientSize( int nWidth
127 virtual void DoGetClientSize( int* pnWidth
132 // Get the OS/2 window flags corresponding to wxWindows ones
134 // The functions returns the flags (WS_XXX) directly and puts the ext
135 // (WS_EX_XXX) flags into the provided pointer if not NULL
137 long OS2GetCreateWindowFlags(long* lExflags
) const;
140 // Is the frame currently iconized?
145 // Should the frame be maximized when it will be shown? set by Maximize()
146 // when it is called while the frame is hidden
148 bool m_bMaximizeOnShow
;
151 // Data to save/restore when calling ShowFullScreen
153 long m_lFsStyle
; // Passed to ShowFullScreen
155 long m_lFsOldWindowStyle
;
156 bool m_bFsIsMaximized
;
162 static bool m_sbInitialized
;
163 }; // end of CLASS wxTopLevelWindowOS2
166 // List of all frames and modeless dialogs
168 extern WXDLLEXPORT_DATA(wxWindowList
) wxModelessWindows
;
170 #endif // _WX_MSW_TOPLEVEL_H_