]>
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 virtual void SetMenuBar(wxMenuBar
* pMenubar
);
57 virtual void SetIcon(const wxIcon
& rIcon
);
58 virtual bool ShowFullScreen( bool bShow
59 ,long lStyle
= wxFULLSCREEN_ALL
61 virtual bool IsFullScreen(void) const { return m_bFsIsShowing
; };
64 // implementation only from now on
65 // -------------------------------
67 // override some more virtuals
68 virtual bool Show(bool bShow
= TRUE
);
69 virtual void RemoveChild(wxWindowBase
* pChild
);
72 void OnActivate(wxActivateEvent
& rEvent
);
73 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
77 virtual wxToolBar
* CreateToolBar( long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
79 ,const wxString
& rsName
= wxToolBarNameStr
82 virtual void PositionToolBar(void);
83 #endif // wxUSE_TOOLBAR
87 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
88 ,long lStyle
= wxST_SIZEGRIP
90 ,const wxString
& rsName
= wxStatusLineNameStr
92 virtual void PositionStatusBar(void);
94 // Hint to tell framework which status bar to use: the default is to use
95 // native one for the platforms which support it (Win32), the generic one
98 // TODO: should this go into a wxFrameworkSettings class perhaps?
99 static void UseNativeStatusBar(bool bUseNative
)
100 { m_bUseNativeStatusBar
= bUseNative
; };
101 static bool UsesNativeStatusBar()
102 { return m_bUseNativeStatusBar
; };
103 #endif // wxUSE_STATUSBAR
105 WXHMENU
GetWinMenu() const { return m_hMenu
; }
107 // Returns the origin of client area (may be different from (0,0) if the
108 // frame has a toolbar)
109 virtual wxPoint
GetClientAreaOrigin() const;
112 bool HandlePaint(void);
113 bool HandleSize( int nX
117 bool HandleCommand( WXWORD wId
121 bool HandleMenuSelect( WXWORD wItem
126 bool OS2Create( int nId
128 ,const wxChar
* zWclass
130 ,const wxChar
* zTitle
138 // tooltip management
140 WXHWND
GetToolTipCtrl(void) const { return m_hWndToolTip
; }
141 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hWndToolTip
= hHwndTT
; }
144 void SetClient(WXHWND c_Hwnd
);
145 void SetClient(wxWindow
* c_Window
);
146 wxWindow
*GetClient();
147 HWND
GetFrame(void) const { return m_hFrame
; }
149 friend MRESULT EXPENTRY
wxFrameWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
150 friend MRESULT EXPENTRY
wxFrameMainWndProc(HWND hWnd
,ULONG ulMsg
, MPARAM wParam
, MPARAM lParam
);
153 // common part of all ctors
156 // common part of Iconize(), Maximize() and Restore()
157 void DoShowWindow(int nShowCmd
);
159 // override base class virtuals
160 virtual void DoGetClientSize( int* pWidth
163 virtual void DoGetSize( int* pWidth
166 virtual void DoGetPosition( int* pX
169 virtual void DoSetClientSize( int nWidth
174 void DetachMenuBar(void);
176 // a plug in for MDI frame classes which need to do something special when
177 // the menubar is set
178 virtual void InternalSetMenuBar(void);
180 // propagate our state change to all child frames
181 void IconizeChildFrames(bool bIconize
);
183 // we add menu bar accel processing
184 bool OS2TranslateMessage(WXMSG
* pMsg
);
186 // window proc for the frames
187 MRESULT
OS2WindowProc( WXUINT uMessage
193 WXHICON m_hDefaultIcon
;
196 static bool m_bUseNativeStatusBar
;
197 #endif // wxUSE_STATUSBAR
199 // Data to save/restore when calling ShowFullScreen
200 long m_lFsStyle
; // Passed to ShowFullScreen
202 long m_lFsOldWindowStyle
;
203 int m_nFsStatusBarFields
; // 0 for no status bar
204 int m_nFsStatusBarHeight
;
205 int m_nFsToolBarHeight
;
206 bool m_bFsIsMaximized
;
209 wxWindow
* m_pWinLastFocused
;
213 WXHWND m_hWndToolTip
;
217 // Handles to child windows of the Frame, and the frame itself,
218 // that we don't have child objects for (m_hWnd in wxWindow is the
219 // handle of the Frame's client window!
227 // Swp structures for various client data
228 // DW: Better off in attached RefData?
239 DECLARE_EVENT_TABLE()
240 DECLARE_DYNAMIC_CLASS(wxFrame
)