1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "frame.h"
19 #include "wx/window.h"
20 #include "wx/toolbar.h"
24 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
25 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
27 class WXDLLEXPORT wxMenuBar
;
28 class WXDLLEXPORT wxStatusBar
;
29 class WXDLLEXPORT wxMacToolTip
;
31 class WXDLLEXPORT wxFrame
: public wxFrameBase
{
35 wxFrame(wxWindow
*parent
,
37 const wxString
& title
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& size
= wxDefaultSize
,
40 long style
= wxDEFAULT_FRAME_STYLE
,
41 const wxString
& name
= wxFrameNameStr
)
45 Create(parent
, id
, title
, pos
, size
, style
, name
);
48 bool Create(wxWindow
*parent
,
50 const wxString
& title
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& size
= wxDefaultSize
,
53 long style
= wxDEFAULT_FRAME_STYLE
,
54 const wxString
& name
= wxFrameNameStr
);
58 // implementation only from now on
59 // -------------------------------
61 // override some more virtuals
62 virtual bool Enable(bool enable
) ;
64 // get the origin of the client area (which may be different from (0, 0)
65 // if the frame has a toolbar) in client coordinates
66 virtual wxPoint
GetClientAreaOrigin() const;
69 void OnActivate(wxActivateEvent
& event
);
70 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
74 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
76 const wxString
& name
= wxToolBarNameStr
);
78 virtual void PositionToolBar();
79 #endif // wxUSE_TOOLBAR
83 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
84 long style
= wxST_SIZEGRIP
,
86 const wxString
& name
= wxStatusLineNameStr
);
88 virtual void PositionStatusBar();
90 // Hint to tell framework which status bar to use
91 // TODO: should this go into a wxFrameworkSettings class perhaps?
92 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
93 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
94 #endif // wxUSE_STATUSBAR
98 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
99 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= tt
; }
100 wxMacToolTip
* m_hwndToolTip
;
104 // common part of all ctors
107 // override base class virtuals
108 virtual void DoGetClientSize(int *width
, int *height
) const;
109 virtual void DoSetClientSize(int width
, int height
);
113 static bool m_useNativeStatusBar
;
114 #endif // wxUSE_STATUSBAR
115 // the last focused child: we restore focus to it on activation
116 wxWindow
*m_winLastFocused
;
119 DECLARE_EVENT_TABLE()
120 DECLARE_DYNAMIC_CLASS(wxFrame
)