]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/frame.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 // Get the default resource ID's for frames
18 #include "wx/os2/wxOs2.h"
20 class WXDLLEXPORT wxFrame
: public wxFrameBase
25 wxFrame( wxWindow
* pParent
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
36 Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
39 bool Create( wxWindow
* pParent
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
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 #if wxUSE_MENUS_NATIVE
57 virtual void SetMenuBar(wxMenuBar
* pMenubar
);
59 virtual void SetIcon(const wxIcon
& rIcon
);
60 virtual bool ShowFullScreen( bool bShow
61 ,long lStyle
= wxFULLSCREEN_ALL
63 virtual bool IsFullScreen(void) const { return m_bFsIsShowing
; };
66 // implementation only from now on
67 // -------------------------------
69 // override some more virtuals
70 virtual bool Show(bool bShow
= TRUE
);
73 void OnActivate(wxActivateEvent
& rEvent
);
74 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
78 virtual wxToolBar
* CreateToolBar( long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
80 ,const wxString
& rsName
= wxToolBarNameStr
83 virtual void PositionToolBar(void);
84 #endif // wxUSE_TOOLBAR
88 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
89 ,long lStyle
= wxST_SIZEGRIP
91 ,const wxString
& rsName
= wxStatusLineNameStr
93 virtual void PositionStatusBar(void);
95 // Hint to tell framework which status bar to use: the default is to use
96 // native one for the platforms which support it (Win32), the generic one
99 // TODO: should this go into a wxFrameworkSettings class perhaps?
100 static void UseNativeStatusBar(bool bUseNative
)
101 { m_bUseNativeStatusBar
= bUseNative
; };
102 static bool UsesNativeStatusBar()
103 { return m_bUseNativeStatusBar
; };
104 #endif // wxUSE_STATUSBAR
106 WXHMENU
GetWinMenu() const { return m_hMenu
; }
108 // Returns the origin of client area (may be different from (0,0) if the
109 // frame has a toolbar)
110 virtual wxPoint
GetClientAreaOrigin() const;
113 bool HandlePaint(void);
114 bool HandleSize( int nX
118 bool HandleCommand( WXWORD wId
122 bool HandleMenuSelect( WXWORD wItem
127 bool OS2Create( int nId
129 ,const wxChar
* zWclass
131 ,const wxChar
* zTitle
139 // tooltip management
141 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
142 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
146 // Called by wxWindow whenever it gets focus
148 void SetLastFocus(wxWindow
* pWin
) { m_pWinLastFocused
= pWin
; }
149 wxWindow
*GetLastFocus(void) const { return m_pWinLastFocused
; }
151 void SetClient(WXHWND c_Hwnd
);
152 void SetClient(wxWindow
* c_Window
);
153 wxWindow
*GetClient();
154 HWND
GetFrame(void) const { return m_hFrame
; }
156 friend MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
157 friend MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
160 // common part of all ctors
163 // common part of Iconize(), Maximize() and Restore()
164 void DoShowWindow(int nShowCmd
);
166 // override base class virtuals
167 virtual void DoGetClientSize( int* pWidth
170 virtual void DoGetSize( int* pWidth
173 virtual void DoGetPosition( int* pX
176 virtual void DoSetClientSize( int nWidth
180 #if wxUSE_MENUS_NATIVE
182 void DetachMenuBar(void);
183 // perform MSW-specific action when menubar is changed
184 virtual void AttachMenuBar(wxMenuBar
* pMenubar
);
185 // a plug in for MDI frame classes which need to do something special when
186 // the menubar is set
187 virtual void InternalSetMenuBar(void);
189 // propagate our state change to all child frames
190 void IconizeChildFrames(bool bIconize
);
192 // we add menu bar accel processing
193 bool OS2TranslateMessage(WXMSG
* pMsg
);
195 // window proc for the frames
196 MRESULT
OS2WindowProc( WXUINT uMessage
202 WXHICON m_hDefaultIcon
;
205 static bool m_bUseNativeStatusBar
;
206 #endif // wxUSE_STATUSBAR
208 // Data to save/restore when calling ShowFullScreen
209 long m_lFsStyle
; // Passed to ShowFullScreen
211 long m_lFsOldWindowStyle
;
212 int m_nFsStatusBarFields
; // 0 for no status bar
213 int m_nFsStatusBarHeight
;
214 int m_nFsToolBarHeight
;
215 bool m_bFsIsMaximized
;
218 wxWindow
* m_pWinLastFocused
;
222 WXHWND m_hWndToolTip
;
226 // Handles to child windows of the Frame, and the frame itself,
227 // that we don't have child objects for (m_hWnd in wxWindow is the
228 // handle of the Frame's client window!
236 // Swp structures for various client data
237 // DW: Better off in attached RefData?
248 DECLARE_EVENT_TABLE()
249 DECLARE_DYNAMIC_CLASS(wxFrame
)