]>
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 void AlterChildPos(void);
70 // override some more virtuals
71 virtual bool Show(bool bShow
= TRUE
);
74 void OnActivate(wxActivateEvent
& rEvent
);
75 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
79 virtual wxToolBar
* CreateToolBar( long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
81 ,const wxString
& rsName
= wxToolBarNameStr
84 virtual void PositionToolBar(void);
85 #endif // wxUSE_TOOLBAR
89 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
90 ,long lStyle
= wxST_SIZEGRIP
92 ,const wxString
& rsName
= wxStatusLineNameStr
94 virtual void PositionStatusBar(void);
96 // Hint to tell framework which status bar to use: the default is to use
97 // native one for the platforms which support it (Win32), the generic one
100 // TODO: should this go into a wxFrameworkSettings class perhaps?
101 static void UseNativeStatusBar(bool bUseNative
)
102 { m_bUseNativeStatusBar
= bUseNative
; };
103 static bool UsesNativeStatusBar()
104 { return m_bUseNativeStatusBar
; };
105 #endif // wxUSE_STATUSBAR
107 WXHMENU
GetWinMenu() const { return m_hMenu
; }
109 // Returns the origin of client area (may be different from (0,0) if the
110 // frame has a toolbar)
111 virtual wxPoint
GetClientAreaOrigin() const;
114 bool HandlePaint(void);
115 bool HandleSize( int nX
119 bool HandleCommand( WXWORD wId
123 bool HandleMenuSelect( WXWORD wItem
128 bool OS2Create( int nId
130 ,const wxChar
* zWclass
132 ,const wxChar
* zTitle
140 // tooltip management
142 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
143 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
147 // Called by wxWindow whenever it gets focus
149 void SetLastFocus(wxWindow
* pWin
) { m_pWinLastFocused
= pWin
; }
150 wxWindow
*GetLastFocus(void) const { return m_pWinLastFocused
; }
152 void SetClient(WXHWND c_Hwnd
);
153 void SetClient(wxWindow
* c_Window
);
154 wxWindow
*GetClient();
155 HWND
GetFrame(void) const { return m_hFrame
; }
157 friend MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
158 friend MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
161 // common part of all ctors
164 // common part of Iconize(), Maximize() and Restore()
165 void DoShowWindow(int nShowCmd
);
167 // override base class virtuals
168 virtual void DoGetClientSize( int* pWidth
171 virtual void DoGetSize( int* pWidth
174 virtual void DoGetPosition( int* pX
177 virtual void DoSetClientSize( int nWidth
181 #if wxUSE_MENUS_NATIVE
183 void DetachMenuBar(void);
184 // perform MSW-specific action when menubar is changed
185 virtual void AttachMenuBar(wxMenuBar
* pMenubar
);
186 // a plug in for MDI frame classes which need to do something special when
187 // the menubar is set
188 virtual void InternalSetMenuBar(void);
190 // propagate our state change to all child frames
191 void IconizeChildFrames(bool bIconize
);
193 // we add menu bar accel processing
194 bool OS2TranslateMessage(WXMSG
* pMsg
);
196 // window proc for the frames
197 MRESULT
OS2WindowProc( WXUINT uMessage
203 WXHICON m_hDefaultIcon
;
206 static bool m_bUseNativeStatusBar
;
207 #endif // wxUSE_STATUSBAR
209 // Data to save/restore when calling ShowFullScreen
210 long m_lFsStyle
; // Passed to ShowFullScreen
212 long m_lFsOldWindowStyle
;
213 int m_nFsStatusBarFields
; // 0 for no status bar
214 int m_nFsStatusBarHeight
;
215 int m_nFsToolBarHeight
;
216 bool m_bFsIsMaximized
;
218 bool m_bWasMinimized
;
220 wxWindow
* m_pWinLastFocused
;
224 WXHWND m_hWndToolTip
;
228 // Handles to child windows of the Frame, and the frame itself,
229 // that we don't have child objects for (m_hWnd in wxWindow is the
230 // handle of the Frame's client window!
238 // Swp structures for various client data
239 // DW: Better off in attached RefData?
250 DECLARE_EVENT_TABLE()
251 DECLARE_DYNAMIC_CLASS(wxFrame
)