]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/toplevel.h
fixed compilation breakage in 1.24 commit
[wxWidgets.git] / include / wx / os2 / toplevel.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/toplevel.h
3 // Purpose: wxTopLevelWindowMSW is the MSW implementation of wxTLW
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 20.09.01
7 // RCS-ID: $Id$
8 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MSW_TOPLEVEL_H_
13 #define _WX_MSW_TOPLEVEL_H_
14
15 enum ETemplateID { kResizeableDialog = 130
16 ,kCaptionDialog
17 ,kNoCaptionDialog
18 };
19
20 // ----------------------------------------------------------------------------
21 // wxTopLevelWindowOS2
22 // ----------------------------------------------------------------------------
23
24 class WXDLLEXPORT wxTopLevelWindowOS2 : public wxTopLevelWindowBase
25 {
26 public:
27 // constructors and such
28 wxTopLevelWindowOS2() { Init(); }
29
30 wxTopLevelWindowOS2( wxWindow* pParent
31 ,wxWindowID vId
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
37 )
38 {
39 Init();
40
41 (void)Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
42 }
43
44 bool Create( wxWindow* pParent
45 ,wxWindowID vId
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
51 );
52
53 virtual ~wxTopLevelWindowOS2();
54
55 //
56 // Implement base class pure virtuals
57 //
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);
67
68 virtual bool Show(bool bShow = TRUE);
69 virtual bool ShowFullScreen( bool bShow
70 ,long lStyle = wxFULLSCREEN_ALL
71 );
72
73 //
74 // EnableCloseButton(FALSE) may be used to remove the "Close"
75 // button from the title bar
76 //
77 bool EnableCloseButton(bool bEnable = TRUE);
78 HWND GetFrame(void) const { return m_hFrame; }
79
80 //
81 // Implementation from now on
82 // --------------------------
83 //
84 PSWP GetSwpClient(void) { return &m_vSwpClient; }
85
86 void OnActivate(wxActivateEvent& rEvent);
87
88 void SetLastFocus(wxWindow *pWin) { m_pWinLastFocused = pWin; }
89 wxWindow* GetLastFocus(void) const { return m_pWinLastFocused; }
90 protected:
91 //
92 // Common part of all ctors
93 //
94 void Init(void);
95
96 //
97 // Create a new frame, return FALSE if it couldn't be created
98 //
99 bool CreateFrame( const wxString& rsTitle
100 ,const wxPoint& rPos
101 ,const wxSize& rSize
102 );
103
104 //
105 // Create a new dialog using the given dialog template from resources,
106 // return FALSE if it couldn't be created
107 //
108 bool CreateDialog( ULONG ulDlgTemplate
109 ,const wxString& rsTitle
110 ,const wxPoint& rPos
111 ,const wxSize& rSize
112 );
113
114 //
115 // Common part of Iconize(), Maximize() and Restore()
116 //
117 void DoShowWindow(int nShowCmd);
118
119 //
120 // Implement the geometry-related methods for a top level window
121 //
122 virtual void DoSetClientSize( int nWidth
123 ,int nHeight
124 );
125 virtual void DoGetClientSize( int* pnWidth
126 ,int* pnHeight
127 ) const;
128
129 //
130 // Translate wxWidgets flags into OS flags
131 //
132 virtual WXDWORD OS2GetStyle( long lFlag
133 ,WXDWORD* pdwExstyle
134 ) const;
135
136 //
137 // Choose the right parent to use with CreateWindow()
138 //
139 virtual WXHWND OS2GetParent(void) const;
140
141 //
142 // Is the frame currently iconized?
143 //
144 bool m_bIconized;
145
146 //
147 // Should the frame be maximized when it will be shown? set by Maximize()
148 // when it is called while the frame is hidden
149 //
150 bool m_bMaximizeOnShow;
151
152 //
153 // Data to save/restore when calling ShowFullScreen
154 //
155 long m_lFsStyle; // Passed to ShowFullScreen
156 wxRect m_vFsOldSize;
157 long m_lFsOldWindowStyle;
158 bool m_bFsIsMaximized;
159 bool m_bFsIsShowing;
160
161 wxWindow* m_pWinLastFocused;
162
163 WXHWND m_hFrame;
164 SWP m_vSwp;
165 SWP m_vSwpClient;
166 static bool m_sbInitialized;
167 static wxWindow* m_spHiddenParent;
168
169 DECLARE_EVENT_TABLE()
170 }; // end of CLASS wxTopLevelWindowOS2
171
172 #endif // _WX_MSW_TOPLEVEL_H_
173