]>
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 /////////////////////////////////////////////////////////////////////////////
15 class WXDLLEXPORT wxFrame
: public wxFrameBase
20 wxFrame( wxWindow
* pParent
22 ,const wxString
& rsTitle
23 ,const wxPoint
& rPos
= wxDefaultPosition
24 ,const wxSize
& rSize
= wxDefaultSize
25 ,long lStyle
= wxDEFAULT_FRAME_STYLE
26 ,const wxString
& rsName
= wxFrameNameStr
31 Create(pParent
, vId
, rsTitle
, rPos
, rSize
, lStyle
, rsName
);
34 bool Create( wxWindow
* pParent
36 ,const wxString
& rsTitle
37 ,const wxPoint
& rPos
= wxDefaultPosition
38 ,const wxSize
& rSize
= wxDefaultSize
39 ,long lStyle
= wxDEFAULT_FRAME_STYLE
40 ,const wxString
& rsName
= wxFrameNameStr
45 // implement base class pure virtuals
46 virtual void Maximize(bool bMaximize
= TRUE
);
47 virtual bool IsMaximized(void) const;
48 virtual void Iconize(bool bIconize
= TRUE
);
49 virtual bool IsIconized(void) const;
50 virtual void Restore(void);
51 virtual void SetMenuBar(wxMenuBar
* pMenubar
);
52 virtual void SetIcon(const wxIcon
& rIcon
);
53 virtual bool ShowFullScreen( bool bShow
54 ,long lStyle
= wxFULLSCREEN_ALL
56 virtual bool IsFullScreen(void) const { return m_fsIsShowing
; };
59 // implementation only from now on
60 // -------------------------------
62 // override some more virtuals
63 virtual bool Show(bool bShow
= TRUE
);
66 void OnActivate(wxActivateEvent
& rEvent
);
67 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
71 virtual wxToolBar
* CreateToolBar( long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
73 ,const wxString
& rsName
= wxToolBarNameStr
76 virtual void PositionToolBar(void);
77 #endif // wxUSE_TOOLBAR
81 virtual wxStatusBar
* OnCreateStatusBar( int nNumber
= 1
82 ,long lStyle
= wxST_SIZEGRIP
84 ,const wxString
& rsName
= wxStatusLineNameStr
86 virtual void PositionStatusBar(void);
88 // Hint to tell framework which status bar to use: the default is to use
89 // native one for the platforms which support it (Win32), the generic one
92 // TODO: should this go into a wxFrameworkSettings class perhaps?
93 static void UseNativeStatusBar(bool bUseNative
)
94 { m_useNativeStatusBar
= useNative
; };
95 static bool UsesNativeStatusBar()
96 { return m_useNativeStatusBar
; };
97 #endif // wxUSE_STATUSBAR
99 WXHMENU
GetWinMenu() const { return m_hMenu
; }
101 // Returns the origin of client area (may be different from (0,0) if the
102 // frame has a toolbar)
103 virtual wxPoint
GetClientAreaOrigin() const;
106 bool HandlePaint(void);
107 bool HandleSize( int nX
111 bool HandleCommand( WXWORD wId
115 bool HandleMenuSelect( WXWORD wItem
120 bool OS2Create( int nId
122 ,const wxChar
* zWclass
124 ,const wxChar
* zTitle
132 // tooltip management
134 WXHWND
GetToolTipCtrl(void) const { return m_hwndToolTip
; }
135 void SetToolTipCtrl(WXHWND hHwndTT
) { m_hwndToolTip
= hwndTT
; }
139 // common part of all ctors
142 // common part of Iconize(), Maximize() and Restore()
143 void DoShowWindow(int nShowCmd
);
145 // override base class virtuals
146 virtual void DoGetClientSize( int* pWidth
149 virtual void DoGetSize( int* pWidth
152 virtual void DoGetPosition( int* pX
155 virtual void DoSetClientSize( int nWidth
160 void DetachMenuBar(void);
162 // a plug in for MDI frame classes which need to do something special when
163 // the menubar is set
164 virtual void InternalSetMenuBar(void);
166 // propagate our state change to all child frames
167 void IconizeChildFrames(bool bIconize
);
169 // we add menu bar accel processing
170 bool OS2TranslateMessage(WXMSG
* pMsg
);
172 // window proc for the frames
173 MRESULT
OS2WindowProc( WXUINT uMessage
179 WXHICON m_hDefaultIcon
;
182 static bool m_bUseNativeStatusBar
;
183 #endif // wxUSE_STATUSBAR
185 // Data to save/restore when calling ShowFullScreen
186 long m_lFsStyle
; // Passed to ShowFullScreen
188 long m_lFsOldWindowStyle
;
189 int m_nFsStatusBarFields
; // 0 for no status bar
190 int m_nFsStatusBarHeight
;
191 int m_nFsToolBarHeight
;
192 bool m_bFsIsMaximized
;
197 WXHWND m_hHwndToolTip
;
200 DECLARE_EVENT_TABLE()
201 DECLARE_DYNAMIC_CLASS(wxFrame
)