1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/frame.h
3 // Purpose: wxFrame class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/toolbar.h"
19 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
21 class WXDLLIMPEXP_CORE wxFrame
: public wxFrameBase
26 wxFrame(wxWindow
*parent
,
28 const wxString
& title
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxDEFAULT_FRAME_STYLE
,
32 const wxString
& name
= wxFrameNameStr
)
36 Create(parent
, id
, title
, pos
, size
, style
, name
);
39 bool Create(wxWindow
*parent
,
41 const wxString
& title
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
44 long style
= wxDEFAULT_FRAME_STYLE
,
45 const wxString
& name
= wxFrameNameStr
);
49 // implementation only from now on
50 // -------------------------------
52 // get the origin of the client area (which may be different from (0, 0)
53 // if the frame has a toolbar) in client coordinates
54 virtual wxPoint
GetClientAreaOrigin() const;
56 // override some more virtuals
57 virtual bool Enable(bool enable
= true) ;
60 void OnActivate(wxActivateEvent
& event
);
61 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
65 virtual wxToolBar
* CreateToolBar(long style
= -1,
67 const wxString
& name
= wxToolBarNameStr
);
69 virtual void SetToolBar(wxToolBar
*toolbar
);
70 #endif // wxUSE_TOOLBAR
74 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
75 long style
= wxSTB_DEFAULT_STYLE
,
77 const wxString
& name
= wxStatusLineNameStr
);
78 #endif // wxUSE_STATUSBAR
80 // called by wxWindow whenever it gets focus
81 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
82 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
86 // internal response to size events
87 virtual void MacOnInternalSize() { PositionBars(); }
90 // common part of all ctors
94 virtual void PositionToolBar();
97 virtual void PositionStatusBar();
100 // override base class virtuals
101 virtual void DoGetClientSize(int *width
, int *height
) const;
102 virtual void DoSetClientSize(int width
, int height
);
105 virtual void DetachMenuBar();
106 virtual void AttachMenuBar(wxMenuBar
*menubar
);
109 // the last focused child: we restore focus to it on activation
110 wxWindow
*m_winLastFocused
;
112 virtual bool MacIsChildOfClientArea( const wxWindow
* child
) const ;
114 DECLARE_EVENT_TABLE()
115 DECLARE_DYNAMIC_CLASS(wxFrame
)