]>
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 #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 OnActivate(wxActivateEvent
& rEvent
);
66 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
70 virtual wxToolBar
* CreateToolBar( long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
72 ,const wxString
& rsName
= wxToolBarNameStr
75 virtual void PositionToolBar(void);
76 #endif // wxUSE_TOOLBAR
80 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
81 ,long lStyle
= wxST_SIZEGRIP
83 ,const wxString
& rsName
= wxStatusLineNameStr
85 virtual void PositionStatusBar(void);
87 // Hint to tell framework which status bar to use: the default is to use
88 // native one for the platforms which support it (Win32), the generic one
91 // TODO: should this go into a wxFrameworkSettings class perhaps?
92 static void UseNativeStatusBar(bool bUseNative
)
93 { m_bUseNativeStatusBar
= bUseNative
; };
94 static bool UsesNativeStatusBar()
95 { return m_bUseNativeStatusBar
; };
96 #endif // wxUSE_STATUSBAR
98 WXHMENU
GetWinMenu() const { return m_hMenu
; }
100 // Returns the origin of client area (may be different from (0,0) if the
101 // frame has a toolbar)
102 virtual wxPoint
GetClientAreaOrigin() const;
105 bool HandlePaint(void);
106 bool HandleSize( int nX
110 bool HandleCommand( WXWORD wId
114 bool HandleMenuSelect( WXWORD wItem
119 void SendSizeEvent(void);
120 // tooltip management
122 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
123 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
127 // Called by wxWindow whenever it gets focus
129 void SetLastFocus(wxWindow
* pWin
) { m_pWinLastFocused
= pWin
; }
130 wxWindow
*GetLastFocus(void) const { return m_pWinLastFocused
; }
132 void SetClient(WXHWND c_Hwnd
);
133 void SetClient(wxWindow
* c_Window
);
134 wxWindow
*GetClient();
136 friend MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
137 friend MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
140 // common part of all ctors
143 virtual WXHICON
GetDefaultIcon(void) const;
144 // override base class virtuals
145 virtual void DoGetClientSize( int* pWidth
148 virtual void DoSetClientSize( int nWidth
151 inline virtual bool IsMDIChild(void) const { return FALSE
; }
153 #if wxUSE_MENUS_NATIVE
155 void DetachMenuBar(void);
156 // perform MSW-specific action when menubar is changed
157 virtual void AttachMenuBar(wxMenuBar
* pMenubar
);
158 // a plug in for MDI frame classes which need to do something special when
159 // the menubar is set
160 virtual void InternalSetMenuBar(void);
162 // propagate our state change to all child frames
163 void IconizeChildFrames(bool bIconize
);
165 // we add menu bar accel processing
166 bool OS2TranslateMessage(WXMSG
* pMsg
);
168 // window proc for the frames
169 MRESULT
OS2WindowProc( WXUINT uMessage
175 WXHICON m_hDefaultIcon
;
178 static bool m_bUseNativeStatusBar
;
179 #endif // wxUSE_STATUSBAR
181 // Data to save/restore when calling ShowFullScreen
182 long m_lFsStyle
; // Passed to ShowFullScreen
184 long m_lFsOldWindowStyle
;
185 int m_nFsStatusBarFields
; // 0 for no status bar
186 int m_nFsStatusBarHeight
;
187 int m_nFsToolBarHeight
;
188 bool m_bFsIsMaximized
;
190 bool m_bWasMinimized
;
192 wxWindow
* m_pWinLastFocused
;
196 WXHWND m_hWndToolTip
;
200 // Handles to child windows of the Frame, and the frame itself,
201 // that we don't have child objects for (m_hWnd in wxWindow is the
202 // handle of the Frame's client window!
209 // Swp structures for various client data
210 // DW: Better off in attached RefData?
219 DECLARE_EVENT_TABLE()
220 DECLARE_DYNAMIC_CLASS(wxFrame
)