]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/frame.h
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 WXDLLEXPORT_DATA(extern const wxChar
*) wxFrameNameStr
;
21 WXDLLEXPORT_DATA(extern const wxChar
*) wxToolBarNameStr
;
23 class WXDLLEXPORT wxMenuBar
;
24 class WXDLLEXPORT wxStatusBar
;
25 class WXDLLEXPORT wxMacToolTip
;
27 class WXDLLEXPORT wxFrame
: public wxFrameBase
32 wxFrame(wxWindow
*parent
,
34 const wxString
& title
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxDEFAULT_FRAME_STYLE
,
38 const wxString
& name
= wxFrameNameStr
)
42 Create(parent
, id
, title
, pos
, size
, style
, name
);
45 bool Create(wxWindow
*parent
,
47 const wxString
& title
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
50 long style
= wxDEFAULT_FRAME_STYLE
,
51 const wxString
& name
= wxFrameNameStr
);
55 // implementation only from now on
56 // -------------------------------
58 // get the origin of the client area (which may be different from (0, 0)
59 // if the frame has a toolbar) in client coordinates
60 virtual wxPoint
GetClientAreaOrigin() const;
62 // override some more virtuals
63 virtual bool Enable(bool enable
= TRUE
) ;
66 void OnActivate(wxActivateEvent
& event
);
67 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
71 virtual wxToolBar
* CreateToolBar(long style
= -1,
73 const wxString
& name
= wxToolBarNameStr
);
75 virtual void PositionToolBar();
76 virtual void SetToolBar(wxToolBar
*toolbar
);
77 #endif // wxUSE_TOOLBAR
81 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
82 long style
= wxST_SIZEGRIP
,
84 const wxString
& name
= wxStatusLineNameStr
);
86 virtual void PositionStatusBar();
87 #endif // wxUSE_STATUSBAR
91 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
92 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= tt
; }
93 wxMacToolTip
* m_hwndToolTip
;
96 // called by wxWindow whenever it gets focus
97 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
98 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
101 // common part of all ctors
104 // override base class virtuals
105 virtual void DoGetClientSize(int *width
, int *height
) const;
106 virtual void DoSetClientSize(int width
, int height
);
108 virtual void DetachMenuBar();
109 virtual void AttachMenuBar(wxMenuBar
*menubar
);
112 // the last focused child: we restore focus to it on activation
113 wxWindow
*m_winLastFocused
;
115 virtual bool MacIsChildOfClientArea( const wxWindow
* child
) const ;
118 DECLARE_EVENT_TABLE()
119 DECLARE_DYNAMIC_CLASS(wxFrame
)