]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/frame.h
3 // Purpose: wxFrame class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
15 // Get the default resource ID's for frames
17 #include "wx/os2/wxrsc.h"
19 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
24 wxFrame( wxWindow
* pParent
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
35 Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
38 bool Create( wxWindow
* pParent
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
49 // implement base class pure virtuals
50 #if wxUSE_MENUS_NATIVE
51 virtual void SetMenuBar(wxMenuBar
* pMenubar
);
53 virtual bool ShowFullScreen( bool bShow
54 ,long lStyle
= wxFULLSCREEN_ALL
58 // implementation only from now on
59 // -------------------------------
61 virtual void Raise(void);
64 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
68 virtual wxToolBar
* CreateToolBar( long lStyle
= -1
70 ,const wxString
& rsName
= wxToolBarNameStr
73 virtual wxToolBar
* OnCreateToolBar( long lStyle
75 ,const wxString
& rsName
77 virtual void PositionToolBar(void);
78 #endif // wxUSE_TOOLBAR
82 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
83 ,long lStyle
= wxSTB_DEFAULT_STYLE
85 ,const wxString
& rsName
= wxStatusLineNameStr
87 virtual void PositionStatusBar(void);
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
93 // TODO: should this go into a wxFrameworkSettings class perhaps?
94 static void UseNativeStatusBar(bool bUseNative
)
95 { m_bUseNativeStatusBar
= bUseNative
; }
96 static bool UsesNativeStatusBar()
97 { return m_bUseNativeStatusBar
; }
98 #endif // wxUSE_STATUSBAR
100 WXHMENU
GetWinMenu() const { return m_hMenu
; }
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;
107 bool HandlePaint(void);
108 bool HandleSize( int nX
112 bool HandleCommand( WXWORD wId
116 bool HandleMenuSelect( WXWORD wItem
121 // tooltip management
123 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
124 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
127 void SetClient(WXHWND c_Hwnd
);
128 void SetClient(wxWindow
* c_Window
);
129 wxWindow
*GetClient();
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
);
135 // common part of all ctors
138 virtual WXHICON
GetDefaultIcon(void) const;
139 // override base class virtuals
140 virtual void DoGetClientSize( int* pWidth
143 virtual void DoSetClientSize( int nWidth
146 inline virtual bool IsMDIChild(void) const { return FALSE
; }
148 #if wxUSE_MENUS_NATIVE
150 void DetachMenuBar(void);
151 // perform MSW-specific action when menubar is changed
152 virtual void AttachMenuBar(wxMenuBar
* pMenubar
);
153 // a plug in for MDI frame classes which need to do something special when
154 // the menubar is set
155 virtual void InternalSetMenuBar(void);
157 // propagate our state change to all child frames
158 void IconizeChildFrames(bool bIconize
);
160 // we add menu bar accel processing
161 bool OS2TranslateMessage(WXMSG
* pMsg
);
163 // window proc for the frames
164 MRESULT
OS2WindowProc( WXUINT uMessage
170 WXHICON m_hDefaultIcon
;
173 static bool m_bUseNativeStatusBar
;
174 #endif // wxUSE_STATUSBAR
176 // Data to save/restore when calling ShowFullScreen
177 long m_lFsStyle
; // Passed to ShowFullScreen
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
;
185 bool m_bWasMinimized
;
190 WXHWND m_hWndToolTip
;
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!
203 // Swp structures for various client data
204 // DW: Better off in attached RefData?
213 DECLARE_EVENT_TABLE()
214 DECLARE_DYNAMIC_CLASS(wxFrame
)
217 MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
218 MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);