1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/frame.h
3 // Purpose: wxFrame class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/toolbar.h"
18 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
20 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
25 wxFrame(wxWindow
*parent
,
27 const wxString
& title
,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
,
30 long style
= wxDEFAULT_FRAME_STYLE
,
31 const wxString
& name
= wxFrameNameStr
)
35 Create(parent
, id
, title
, pos
, size
, style
, name
);
38 bool Create(wxWindow
*parent
,
40 const wxString
& title
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 long style
= wxDEFAULT_FRAME_STYLE
,
44 const wxString
& name
= wxFrameNameStr
);
48 // implementation only from now on
49 // -------------------------------
51 // get the origin of the client area (which may be different from (0, 0)
52 // if the frame has a toolbar) in client coordinates
53 virtual wxPoint
GetClientAreaOrigin() const;
55 // override some more virtuals
56 virtual bool Enable(bool enable
= true) ;
59 void OnActivate(wxActivateEvent
& event
);
60 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
64 virtual wxToolBar
* CreateToolBar(long style
= -1,
66 const wxString
& name
= wxToolBarNameStr
);
68 virtual void SetToolBar(wxToolBar
*toolbar
);
69 #endif // wxUSE_TOOLBAR
73 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
74 long style
= wxSTB_DEFAULT_STYLE
,
76 const wxString
& name
= wxStatusLineNameStr
);
77 #endif // wxUSE_STATUSBAR
79 // called by wxWindow whenever it gets focus
80 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
81 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
85 // internal response to size events
86 virtual void MacOnInternalSize() { PositionBars(); }
89 // common part of all ctors
93 virtual void PositionToolBar();
96 virtual void PositionStatusBar();
99 // override base class virtuals
100 virtual void DoGetClientSize(int *width
, int *height
) const;
101 virtual void DoSetClientSize(int width
, int height
);
104 virtual void DetachMenuBar();
105 virtual void AttachMenuBar(wxMenuBar
*menubar
);
108 // the last focused child: we restore focus to it on activation
109 wxWindow
*m_winLastFocused
;
111 virtual bool MacIsChildOfClientArea( const wxWindow
* child
) const ;
113 DECLARE_EVENT_TABLE()
114 DECLARE_DYNAMIC_CLASS(wxFrame
)