removed extra DECLARE_DYNAMIC_CLASS
[wxWidgets.git] / include / wx / mac / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: frame.h
3 // Purpose: wxFrame class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FRAME_H_
13 #define _WX_FRAME_H_
14
15 #ifdef __GNUG__
16 #pragma interface "frame.h"
17 #endif
18
19 #include "wx/window.h"
20 #include "wx/toolbar.h"
21 #include "wx/accel.h"
22 #include "wx/icon.h"
23
24 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
25 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
26
27 class WXDLLEXPORT wxMenuBar;
28 class WXDLLEXPORT wxStatusBar;
29 class WXDLLEXPORT wxMacToolTip ;
30
31 class WXDLLEXPORT wxFrame: public wxFrameBase {
32 public:
33 // construction
34 wxFrame() { Init(); }
35 wxFrame(wxWindow *parent,
36 wxWindowID id,
37 const wxString& title,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxDEFAULT_FRAME_STYLE,
41 const wxString& name = wxFrameNameStr)
42 {
43 Init();
44
45 Create(parent, id, title, pos, size, style, name);
46 }
47
48 bool Create(wxWindow *parent,
49 wxWindowID id,
50 const wxString& title,
51 const wxPoint& pos = wxDefaultPosition,
52 const wxSize& size = wxDefaultSize,
53 long style = wxDEFAULT_FRAME_STYLE,
54 const wxString& name = wxFrameNameStr);
55
56 virtual ~wxFrame();
57
58 // implementation only from now on
59 // -------------------------------
60
61 // override some more virtuals
62 virtual bool Enable(bool enable) ;
63
64 // get the origin of the client area (which may be different from (0, 0)
65 // if the frame has a toolbar) in client coordinates
66 virtual wxPoint GetClientAreaOrigin() const;
67
68 // event handlers
69 void OnActivate(wxActivateEvent& event);
70 void OnSysColourChanged(wxSysColourChangedEvent& event);
71
72 // Toolbar
73 #if wxUSE_TOOLBAR
74 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
75 wxWindowID id = -1,
76 const wxString& name = wxToolBarNameStr);
77
78 virtual void PositionToolBar();
79 #endif // wxUSE_TOOLBAR
80
81 // Status bar
82 #if wxUSE_STATUSBAR
83 virtual wxStatusBar* OnCreateStatusBar(int number = 1,
84 long style = wxST_SIZEGRIP,
85 wxWindowID id = 0,
86 const wxString& name = wxStatusLineNameStr);
87
88 virtual void PositionStatusBar();
89
90 // Hint to tell framework which status bar to use
91 // TODO: should this go into a wxFrameworkSettings class perhaps?
92 static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
93 static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
94 #endif // wxUSE_STATUSBAR
95
96 // tooltip management
97 #if wxUSE_TOOLTIPS
98 wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; }
99 void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; }
100 wxMacToolTip* m_hwndToolTip ;
101 #endif // tooltips
102
103 protected:
104 // common part of all ctors
105 void Init();
106
107 // override base class virtuals
108 virtual void DoGetClientSize(int *width, int *height) const;
109 virtual void DoSetClientSize(int width, int height);
110
111 protected:
112 #if wxUSE_STATUSBAR
113 static bool m_useNativeStatusBar;
114 #endif // wxUSE_STATUSBAR
115 // the last focused child: we restore focus to it on activation
116 wxWindow *m_winLastFocused;
117
118 private:
119 DECLARE_EVENT_TABLE()
120 DECLARE_DYNAMIC_CLASS(wxFrame)
121 };
122
123 #endif
124 // _WX_FRAME_H_