]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/frame.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
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 wxFrame
: public wxFrameBase
36 wxFrame(wxWindow
*parent
,
38 const wxString
& title
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
41 long style
= wxDEFAULT_FRAME_STYLE
,
42 const wxString
& name
= wxFrameNameStr
)
46 Create(parent
, id
, title
, pos
, size
, style
, name
);
49 bool Create(wxWindow
*parent
,
51 const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxDEFAULT_FRAME_STYLE
,
55 const wxString
& name
= wxFrameNameStr
);
59 // implementation only from now on
60 // -------------------------------
62 // override some more virtuals
63 virtual bool Enable(bool enable
= TRUE
) ;
65 // get the origin of the client area (which may be different from (0, 0)
66 // if the frame has a toolbar) in client coordinates
67 virtual wxPoint
GetClientAreaOrigin() const;
70 void OnActivate(wxActivateEvent
& event
);
71 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
75 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
77 const wxString
& name
= wxToolBarNameStr
);
79 virtual void PositionToolBar();
80 #endif // wxUSE_TOOLBAR
84 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
85 long style
= wxST_SIZEGRIP
,
87 const wxString
& name
= wxStatusLineNameStr
);
89 virtual void PositionStatusBar();
91 // Hint to tell framework which status bar to use
92 // TODO: should this go into a wxFrameworkSettings class perhaps?
93 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
94 static bool UsesNativeStatusBar() { return m_useNativeStatusBar
; };
95 #endif // wxUSE_STATUSBAR
99 wxMacToolTip
* GetToolTipCtrl() const { return m_hwndToolTip
; }
100 void SetToolTipCtrl(wxMacToolTip
*tt
) { m_hwndToolTip
= tt
; }
101 wxMacToolTip
* m_hwndToolTip
;
104 // called by wxWindow whenever it gets focus
105 void SetLastFocus(wxWindow
*win
) { m_winLastFocused
= win
; }
106 wxWindow
*GetLastFocus() const { return m_winLastFocused
; }
109 // common part of all ctors
112 // override base class virtuals
113 virtual void DoGetClientSize(int *width
, int *height
) const;
114 virtual void DoSetClientSize(int width
, int height
);
118 static bool m_useNativeStatusBar
;
119 #endif // wxUSE_STATUSBAR
120 // the last focused child: we restore focus to it on activation
121 wxWindow
*m_winLastFocused
;
124 DECLARE_EVENT_TABLE()
125 DECLARE_DYNAMIC_CLASS(wxFrame
)