]>
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
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 // Get the default resource ID's for frames
18 #include "wx/os2/wxrsc.h"
20 class WXDLLIMPEXP_CORE 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 #if wxUSE_MENUS_NATIVE
52 virtual void SetMenuBar(wxMenuBar
* pMenubar
);
54 virtual bool ShowFullScreen( bool bShow
55 ,long lStyle
= wxFULLSCREEN_ALL
59 // implementation only from now on
60 // -------------------------------
62 virtual void Raise(void);
65 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
69 virtual wxToolBar
* CreateToolBar( long lStyle
= -1
71 ,const wxString
& rsName
= wxToolBarNameStr
74 virtual wxToolBar
* OnCreateToolBar( long lStyle
76 ,const wxString
& rsName
78 virtual void PositionToolBar(void);
79 #endif // wxUSE_TOOLBAR
83 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
84 ,long lStyle
= wxSTB_DEFAULT_STYLE
86 ,const wxString
& rsName
= wxStatusLineNameStr
88 virtual void PositionStatusBar(void);
90 // Hint to tell framework which status bar to use: the default is to use
91 // native one for the platforms which support it (Win32), the generic one
94 // TODO: should this go into a wxFrameworkSettings class perhaps?
95 static void UseNativeStatusBar(bool bUseNative
)
96 { m_bUseNativeStatusBar
= bUseNative
; };
97 static bool UsesNativeStatusBar()
98 { return m_bUseNativeStatusBar
; };
99 #endif // wxUSE_STATUSBAR
101 WXHMENU
GetWinMenu() const { return m_hMenu
; }
103 // Returns the origin of client area (may be different from (0,0) if the
104 // frame has a toolbar)
105 virtual wxPoint
GetClientAreaOrigin() const;
108 bool HandlePaint(void);
109 bool HandleSize( int nX
113 bool HandleCommand( WXWORD wId
117 bool HandleMenuSelect( WXWORD wItem
122 // tooltip management
124 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
125 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
128 void SetClient(WXHWND c_Hwnd
);
129 void SetClient(wxWindow
* c_Window
);
130 wxWindow
*GetClient();
132 friend MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
133 friend MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
136 // common part of all ctors
139 virtual WXHICON
GetDefaultIcon(void) const;
140 // override base class virtuals
141 virtual void DoGetClientSize( int* pWidth
144 virtual void DoSetClientSize( int nWidth
147 inline virtual bool IsMDIChild(void) const { return FALSE
; }
149 #if wxUSE_MENUS_NATIVE
151 void DetachMenuBar(void);
152 // perform MSW-specific action when menubar is changed
153 virtual void AttachMenuBar(wxMenuBar
* pMenubar
);
154 // a plug in for MDI frame classes which need to do something special when
155 // the menubar is set
156 virtual void InternalSetMenuBar(void);
158 // propagate our state change to all child frames
159 void IconizeChildFrames(bool bIconize
);
161 // we add menu bar accel processing
162 bool OS2TranslateMessage(WXMSG
* pMsg
);
164 // window proc for the frames
165 MRESULT
OS2WindowProc( WXUINT uMessage
171 WXHICON m_hDefaultIcon
;
174 static bool m_bUseNativeStatusBar
;
175 #endif // wxUSE_STATUSBAR
177 // Data to save/restore when calling ShowFullScreen
178 long m_lFsStyle
; // Passed to ShowFullScreen
180 long m_lFsOldWindowStyle
;
181 int m_nFsStatusBarFields
; // 0 for no status bar
182 int m_nFsStatusBarHeight
;
183 int m_nFsToolBarHeight
;
184 bool m_bFsIsMaximized
;
186 bool m_bWasMinimized
;
191 WXHWND m_hWndToolTip
;
195 // Handles to child windows of the Frame, and the frame itself,
196 // that we don't have child objects for (m_hWnd in wxWindow is the
197 // handle of the Frame's client window!
204 // Swp structures for various client data
205 // DW: Better off in attached RefData?
214 DECLARE_EVENT_TABLE()
215 DECLARE_DYNAMIC_CLASS(wxFrame
)
218 MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
219 MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);