1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrameMac 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 wxFrameMac
: public wxFrameBase
{
33 DECLARE_DYNAMIC_CLASS(wxFrameMac
)
37 wxFrameMac() { Init(); }
38 wxFrameMac(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 Create(parent
, id
, title
, pos
, size
, style
, name
);
51 bool Create(wxWindow
*parent
,
53 const wxString
& title
,
54 const wxPoint
& pos
= wxDefaultPosition
,
55 const wxSize
& size
= wxDefaultSize
,
56 long style
= wxDEFAULT_FRAME_STYLE
,
57 const wxString
& name
= wxFrameNameStr
);
59 virtual ~wxFrameMac();
61 // implement base class pure virtuals
62 virtual void Maximize(bool maximize
= TRUE
);
63 virtual bool IsMaximized() const;
64 virtual void Iconize(bool iconize
= TRUE
);
65 virtual bool IsIconized() const;
66 virtual void Restore();
67 virtual void SetIcon(const wxIcon
& icon
);
69 // implementation only from now on
70 // -------------------------------
72 // override some more virtuals
73 virtual bool Enable(bool enable
) ;
75 // get the origin of the client area (which may be different from (0, 0)
76 // if the frame has a toolbar) in client coordinates
77 virtual wxPoint
GetClientAreaOrigin() const;
80 void OnActivate(wxActivateEvent
& event
);
81 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
85 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
87 const wxString
& name
= wxToolBarNameStr
);
89 virtual void PositionToolBar();
90 #endif // wxUSE_TOOLBAR
94 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
95 long style
= wxST_SIZEGRIP
,
97 const wxString
& name
= wxStatusLineNameStr
);
99 virtual void PositionStatusBar();
101 // Hint to tell framework which status bar to use
102 // TODO: should this go into a wxFrameworkSettings class perhaps?
103 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
104 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
105 #endif // wxUSE_STATUSBAR
107 // tooltip management
109 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
110 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= tt
; }
111 wxMacToolTip
* m_hwndToolTip
;
115 // common part of all ctors
118 // override base class virtuals
119 virtual void DoGetClientSize(int *width
, int *height
) const;
120 virtual void DoSetClientSize(int width
, int height
);
125 static bool m_useNativeStatusBar
;
126 #endif // wxUSE_STATUSBAR
127 // the last focused child: we restore focus to it on activation
128 wxWindow
*m_winLastFocused
;
131 DECLARE_EVENT_TABLE()