]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/frame.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / include / wx / os2 / frame.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/os2/frame.h
0e320a79 3// Purpose: wxFrame class
21802234 4// Author: David Webster
0e320a79 5// Modified by:
29435d81 6// Created: 10/27/99
21802234 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_FRAME_H_
12#define _WX_FRAME_H_
13
61243a51
DW
14//
15// Get the default resource ID's for frames
16//
1d3d992e 17#include "wx/os2/wxrsc.h"
61243a51 18
53a2db12 19class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
004fd0c8 20{
54da4255 21public:
f38374d0 22 // construction
0d53fc34
VS
23 wxFrame() { Init(); }
24 wxFrame( wxWindow* pParent
210a651b
DW
25 ,wxWindowID vId
26 ,const wxString& rsTitle
27 ,const wxPoint& rPos = wxDefaultPosition
28 ,const wxSize& rSize = wxDefaultSize
29 ,long lStyle = wxDEFAULT_FRAME_STYLE
30 ,const wxString& rsName = wxFrameNameStr
31 )
21802234 32 {
f38374d0
DW
33 Init();
34
178f951f 35 Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
21802234 36 }
0e320a79 37
178f951f
DW
38 bool Create( wxWindow* pParent
39 ,wxWindowID vId
40 ,const wxString& rsTitle
41 ,const wxPoint& rPos = wxDefaultPosition
42 ,const wxSize& rSize = wxDefaultSize
43 ,long lStyle = wxDEFAULT_FRAME_STYLE
44 ,const wxString& rsName = wxFrameNameStr
45 );
21802234 46
0d53fc34 47 virtual ~wxFrame();
21802234 48
f38374d0 49 // implement base class pure virtuals
19193a2c 50#if wxUSE_MENUS_NATIVE
178f951f 51 virtual void SetMenuBar(wxMenuBar* pMenubar);
19193a2c 52#endif
178f951f
DW
53 virtual bool ShowFullScreen( bool bShow
54 ,long lStyle = wxFULLSCREEN_ALL
55 );
178f951f 56
21802234 57
f38374d0
DW
58 // implementation only from now on
59 // -------------------------------
21802234 60
3011bf2b 61 virtual void Raise(void);
21802234 62
f38374d0 63 // event handlers
178f951f 64 void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
21802234
DW
65
66 // Toolbar
67#if wxUSE_TOOLBAR
f9dae779 68 virtual wxToolBar* CreateToolBar( long lStyle = -1
178f951f
DW
69 ,wxWindowID vId = -1
70 ,const wxString& rsName = wxToolBarNameStr
71 );
21802234 72
d697657f
DW
73 virtual wxToolBar* OnCreateToolBar( long lStyle
74 ,wxWindowID vId
75 ,const wxString& rsName
76 );
178f951f 77 virtual void PositionToolBar(void);
21802234
DW
78#endif // wxUSE_TOOLBAR
79
21802234 80 // Status bar
f38374d0 81#if wxUSE_STATUSBAR
178f951f 82 virtual wxStatusBar* OnCreateStatusBar( int nNumber = 1
c4c178c1 83 ,long lStyle = wxSTB_DEFAULT_STYLE
178f951f
DW
84 ,wxWindowID vId = 0
85 ,const wxString& rsName = wxStatusLineNameStr
86 );
87 virtual void PositionStatusBar(void);
21802234 88
f38374d0
DW
89 // Hint to tell framework which status bar to use: the default is to use
90 // native one for the platforms which support it (Win32), the generic one
91 // otherwise
21802234 92
21802234 93 // TODO: should this go into a wxFrameworkSettings class perhaps?
178f951f 94 static void UseNativeStatusBar(bool bUseNative)
6dd0883d 95 { m_bUseNativeStatusBar = bUseNative; }
f38374d0 96 static bool UsesNativeStatusBar()
6dd0883d 97 { return m_bUseNativeStatusBar; }
21802234
DW
98#endif // wxUSE_STATUSBAR
99
21802234
DW
100 WXHMENU GetWinMenu() const { return m_hMenu; }
101
102 // Returns the origin of client area (may be different from (0,0) if the
103 // frame has a toolbar)
104 virtual wxPoint GetClientAreaOrigin() const;
105
f38374d0 106 // event handlers
178f951f
DW
107 bool HandlePaint(void);
108 bool HandleSize( int nX
109 ,int nY
110 ,WXUINT uFlag
111 );
112 bool HandleCommand( WXWORD wId
113 ,WXWORD wCmd
114 ,WXHWND wControl
115 );
116 bool HandleMenuSelect( WXWORD wItem
117 ,WXWORD wFlags
118 ,WXHMENU hMenu
119 );
120
f38374d0 121 // tooltip management
21802234 122#if wxUSE_TOOLTIPS
a885d89a
DW
123 WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
124 void SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; }
21802234 125#endif // tooltips
0e320a79 126
f5526d36
DW
127 void SetClient(WXHWND c_Hwnd);
128 void SetClient(wxWindow* c_Window);
129 wxWindow *GetClient();
130
60161cfa
DW
131 friend MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
132 friend MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
133
0e320a79 134protected:
f38374d0 135 // common part of all ctors
178f951f 136 void Init(void);
f38374d0 137
3011bf2b 138 virtual WXHICON GetDefaultIcon(void) const;
21802234 139 // override base class virtuals
178f951f
DW
140 virtual void DoGetClientSize( int* pWidth
141 ,int* pHeight
142 ) const;
178f951f
DW
143 virtual void DoSetClientSize( int nWidth
144 ,int nWeight
145 );
3011bf2b 146 inline virtual bool IsMDIChild(void) const { return FALSE; }
e6ebb514 147
19193a2c 148#if wxUSE_MENUS_NATIVE
f38374d0 149 // helper
178f951f 150 void DetachMenuBar(void);
6835592c
DW
151 // perform MSW-specific action when menubar is changed
152 virtual void AttachMenuBar(wxMenuBar* pMenubar);
21802234
DW
153 // a plug in for MDI frame classes which need to do something special when
154 // the menubar is set
178f951f 155 virtual void InternalSetMenuBar(void);
6835592c 156#endif
21802234
DW
157 // propagate our state change to all child frames
158 void IconizeChildFrames(bool bIconize);
159
160 // we add menu bar accel processing
161 bool OS2TranslateMessage(WXMSG* pMsg);
162
163 // window proc for the frames
178f951f
DW
164 MRESULT OS2WindowProc( WXUINT uMessage
165 ,WXWPARAM wParam
166 ,WXLPARAM lParam
167 );
21802234 168
178f951f
DW
169 bool m_bIconized;
170 WXHICON m_hDefaultIcon;
21802234
DW
171
172#if wxUSE_STATUSBAR
178f951f 173 static bool m_bUseNativeStatusBar;
21802234
DW
174#endif // wxUSE_STATUSBAR
175
178f951f
DW
176 // Data to save/restore when calling ShowFullScreen
177 long m_lFsStyle; // Passed to ShowFullScreen
178 wxRect m_vFsOldSize;
179 long m_lFsOldWindowStyle;
180 int m_nFsStatusBarFields; // 0 for no status bar
181 int m_nFsStatusBarHeight;
182 int m_nFsToolBarHeight;
183 bool m_bFsIsMaximized;
184 bool m_bFsIsShowing;
fb49f3b3 185 bool m_bWasMinimized;
760ac9ab 186 bool m_bIsShown;
178f951f 187
21802234
DW
188private:
189#if wxUSE_TOOLTIPS
80d83cbc 190 WXHWND m_hWndToolTip;
21802234
DW
191#endif // tooltips
192
40bd6154 193 //
60161cfa
DW
194 // Handles to child windows of the Frame, and the frame itself,
195 // that we don't have child objects for (m_hWnd in wxWindow is the
196 // handle of the Frame's client window!
40bd6154
DW
197 //
198 WXHWND m_hTitleBar;
199 WXHWND m_hHScroll;
200 WXHWND m_hVScroll;
201
202 //
f6bcfd97 203 // Swp structures for various client data
40bd6154
DW
204 // DW: Better off in attached RefData?
205 //
40bd6154
DW
206 SWP m_vSwpTitleBar;
207 SWP m_vSwpMenuBar;
208 SWP m_vSwpHScroll;
209 SWP m_vSwpVScroll;
210 SWP m_vSwpStatusBar;
211 SWP m_vSwpToolBar;
212
21802234 213 DECLARE_EVENT_TABLE()
0d53fc34 214 DECLARE_DYNAMIC_CLASS(wxFrame)
0e320a79
DW
215};
216
ac10ea91
SN
217MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
218MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
0e320a79
DW
219#endif
220 // _WX_FRAME_H_
21802234 221