1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/window.h"
16 #include "wx/toolbar.h"
20 WXDLLIMPEXP_DATA_CORE(extern const char) wxToolBarNameStr
[];
22 class WXDLLIMPEXP_FWD_CORE wxMenuBar
;
23 class WXDLLIMPEXP_FWD_CORE wxStatusBar
;
24 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
26 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
31 wxFrame(wxWindow
*parent
,
33 const wxString
& title
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxDEFAULT_FRAME_STYLE
,
37 const wxString
& name
= wxFrameNameStr
)
41 Create(parent
, id
, title
, pos
, size
, style
, name
);
44 bool Create(wxWindow
*parent
,
46 const wxString
& title
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 long style
= wxDEFAULT_FRAME_STYLE
,
50 const wxString
& name
= wxFrameNameStr
);
54 // implementation only from now on
55 // -------------------------------
57 // get the origin of the client area (which may be different from (0, 0)
58 // if the frame has a toolbar) in client coordinates
59 virtual wxPoint
GetClientAreaOrigin() const;
61 // override some more virtuals
62 virtual bool Enable(bool enable
= true) ;
65 void OnActivate(wxActivateEvent
& event
);
66 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
70 virtual wxToolBar
* CreateToolBar(long style
= -1,
72 const wxString
& name
= wxToolBarNameStr
);
74 virtual void SetToolBar(wxToolBar
*toolbar
);
75 #endif // wxUSE_TOOLBAR
79 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
80 long style
= wxSTB_DEFAULT_STYLE
,
82 const wxString
& name
= wxStatusLineNameStr
);
83 #endif // wxUSE_STATUSBAR
85 // called by wxWindow whenever it gets focus
86 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
87 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
91 // osx specific event handling common for all osx-ports
92 virtual void HandleResized( double timestampsec
);
95 // common part of all ctors
99 virtual void PositionToolBar();
102 virtual void PositionStatusBar();
105 // override base class virtuals
106 virtual void DoGetClientSize(int *width
, int *height
) const;
107 virtual void DoSetClientSize(int width
, int height
);
110 virtual void DetachMenuBar();
111 virtual void AttachMenuBar(wxMenuBar
*menubar
);
114 // the last focused child: we restore focus to it on activation
115 wxWindow
*m_winLastFocused
;
117 virtual bool MacIsChildOfClientArea( const wxWindow
* child
) const ;
119 DECLARE_EVENT_TABLE()
120 DECLARE_DYNAMIC_CLASS(wxFrame
)