]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/frame.h
Changed wxGridCellAttr::HasAlignment to treat values of -1 as no
[wxWidgets.git] / include / wx / os2 / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: frame.h
3 // Purpose: wxFrame class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/27/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FRAME_H_
13 #define _WX_FRAME_H_
14
15 //
16 // Get the default resource ID's for frames
17 //
18 #include "wx/os2/wxOs2.h"
19
20 class WXDLLEXPORT wxFrame : public wxFrameBase
21 {
22 public:
23 // construction
24 wxFrame() { Init(); }
25 wxFrame( wxWindow* pParent
26 ,wxWindowID vId
27 ,const wxString& rsTitle
28 ,const wxPoint& rPos = wxDefaultPosition
29 ,const wxSize& rSize = wxDefaultSize
30 ,long lStyle = wxDEFAULT_FRAME_STYLE
31 ,const wxString& rsName = wxFrameNameStr
32 )
33 {
34 Init();
35
36 Create(pParent, vId, rsTitle, rPos, rSize, lStyle, rsName);
37 }
38
39 bool Create( wxWindow* pParent
40 ,wxWindowID vId
41 ,const wxString& rsTitle
42 ,const wxPoint& rPos = wxDefaultPosition
43 ,const wxSize& rSize = wxDefaultSize
44 ,long lStyle = wxDEFAULT_FRAME_STYLE
45 ,const wxString& rsName = wxFrameNameStr
46 );
47
48 virtual ~wxFrame();
49
50 // implement base class pure virtuals
51 virtual void Maximize(bool bMaximize = TRUE);
52 virtual bool IsMaximized(void) const;
53 virtual void Iconize(bool bIconize = TRUE);
54 virtual bool IsIconized(void) const;
55 virtual void Restore(void);
56 virtual void SetMenuBar(wxMenuBar* pMenubar);
57 virtual void SetIcon(const wxIcon& rIcon);
58 virtual bool ShowFullScreen( bool bShow
59 ,long lStyle = wxFULLSCREEN_ALL
60 );
61 virtual bool IsFullScreen(void) const { return m_bFsIsShowing; };
62
63
64 // implementation only from now on
65 // -------------------------------
66
67 // override some more virtuals
68 virtual bool Show(bool bShow = TRUE);
69
70 // event handlers
71 void OnActivate(wxActivateEvent& rEvent);
72 void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
73
74 // Toolbar
75 #if wxUSE_TOOLBAR
76 virtual wxToolBar* CreateToolBar( long lStyle = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT
77 ,wxWindowID vId = -1
78 ,const wxString& rsName = wxToolBarNameStr
79 );
80
81 virtual void PositionToolBar(void);
82 #endif // wxUSE_TOOLBAR
83
84 // Status bar
85 #if wxUSE_STATUSBAR
86 virtual wxStatusBar* OnCreateStatusBar( int nNumber = 1
87 ,long lStyle = wxST_SIZEGRIP
88 ,wxWindowID vId = 0
89 ,const wxString& rsName = wxStatusLineNameStr
90 );
91 virtual void PositionStatusBar(void);
92
93 // Hint to tell framework which status bar to use: the default is to use
94 // native one for the platforms which support it (Win32), the generic one
95 // otherwise
96
97 // TODO: should this go into a wxFrameworkSettings class perhaps?
98 static void UseNativeStatusBar(bool bUseNative)
99 { m_bUseNativeStatusBar = bUseNative; };
100 static bool UsesNativeStatusBar()
101 { return m_bUseNativeStatusBar; };
102 #endif // wxUSE_STATUSBAR
103
104 WXHMENU GetWinMenu() const { return m_hMenu; }
105 WXHWND GetFrame() const { return m_hFrame; }
106
107 // Returns the origin of client area (may be different from (0,0) if the
108 // frame has a toolbar)
109 virtual wxPoint GetClientAreaOrigin() const;
110
111 // event handlers
112 bool HandlePaint(void);
113 bool HandleSize( int nX
114 ,int nY
115 ,WXUINT uFlag
116 );
117 bool HandleCommand( WXWORD wId
118 ,WXWORD wCmd
119 ,WXHWND wControl
120 );
121 bool HandleMenuSelect( WXWORD wItem
122 ,WXWORD wFlags
123 ,WXHMENU hMenu
124 );
125
126 bool OS2Create( int nId
127 ,wxWindow* pParent
128 ,const wxChar* zWclass
129 ,wxWindow* pWxWin
130 ,const wxChar* zTitle
131 ,int nX
132 ,int nY
133 ,int nWidth
134 ,int nHeight
135 ,long nStyle
136 );
137
138 // tooltip management
139 #if wxUSE_TOOLTIPS
140 WXHWND GetToolTipCtrl(void) const { return m_hWndToolTip; }
141 void SetToolTipCtrl(WXHWND hHwndTT) { m_hWndToolTip = hHwndTT; }
142 #endif // tooltips
143
144 protected:
145 // common part of all ctors
146 void Init(void);
147
148 // common part of Iconize(), Maximize() and Restore()
149 void DoShowWindow(int nShowCmd);
150
151 // override base class virtuals
152 virtual void DoGetClientSize( int* pWidth
153 ,int* pHeight
154 ) const;
155 virtual void DoGetSize( int* pWidth
156 ,int* pHeight
157 ) const;
158 virtual void DoGetPosition( int* pX
159 ,int* pY
160 ) const;
161 virtual void DoSetClientSize( int nWidth
162 ,int nWeight
163 );
164
165 // helper
166 void DetachMenuBar(void);
167
168 // a plug in for MDI frame classes which need to do something special when
169 // the menubar is set
170 virtual void InternalSetMenuBar(void);
171
172 // propagate our state change to all child frames
173 void IconizeChildFrames(bool bIconize);
174
175 // we add menu bar accel processing
176 bool OS2TranslateMessage(WXMSG* pMsg);
177
178 // window proc for the frames
179 MRESULT OS2WindowProc( WXUINT uMessage
180 ,WXWPARAM wParam
181 ,WXLPARAM lParam
182 );
183
184 bool m_bIconized;
185 WXHICON m_hDefaultIcon;
186
187 #if wxUSE_STATUSBAR
188 static bool m_bUseNativeStatusBar;
189 #endif // wxUSE_STATUSBAR
190
191 // Data to save/restore when calling ShowFullScreen
192 long m_lFsStyle; // Passed to ShowFullScreen
193 wxRect m_vFsOldSize;
194 long m_lFsOldWindowStyle;
195 int m_nFsStatusBarFields; // 0 for no status bar
196 int m_nFsStatusBarHeight;
197 int m_nFsToolBarHeight;
198 bool m_bFsIsMaximized;
199 bool m_bFsIsShowing;
200
201 private:
202 #if wxUSE_TOOLTIPS
203 WXHWND m_hWndToolTip;
204 #endif // tooltips
205
206 //
207 // The main handle of a frame window, that used for message processing
208 // is the client handle under PM. But we still need the frame handle
209 // as well
210 //
211 WXHWND m_hFrame;
212
213 //
214 // Handles to child windows of the Frame that we don't have child objects for
215 //
216 WXHWND m_hTitleBar;
217 WXHWND m_hHScroll;
218 WXHWND m_hVScroll;
219
220 //
221 // Swp structures for various client data
222 // DW: Better off in attached RefData?
223 //
224 SWP m_vSwp;
225 SWP m_vSwpClient;
226 SWP m_vSwpTitleBar;
227 SWP m_vSwpMenuBar;
228 SWP m_vSwpHScroll;
229 SWP m_vSwpVScroll;
230 SWP m_vSwpStatusBar;
231 SWP m_vSwpToolBar;
232
233 DECLARE_EVENT_TABLE()
234 DECLARE_DYNAMIC_CLASS(wxFrame)
235 };
236
237 #endif
238 // _WX_FRAME_H_
239