]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: frame.h | |
e766c8a9 | 3 | // Purpose: wxFrameMac class |
0dbd6262 SC |
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" | |
519cb848 | 22 | #include "wx/icon.h" |
0dbd6262 SC |
23 | |
24 | WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr; | |
25 | WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr; | |
26 | ||
27 | class WXDLLEXPORT wxMenuBar; | |
28 | class WXDLLEXPORT wxStatusBar; | |
519cb848 | 29 | class WXDLLEXPORT wxMacToolTip ; |
0dbd6262 | 30 | |
e766c8a9 | 31 | class WXDLLEXPORT wxFrameMac: public wxFrameBase { |
0dbd6262 | 32 | |
e766c8a9 | 33 | DECLARE_DYNAMIC_CLASS(wxFrameMac) |
0dbd6262 SC |
34 | |
35 | public: | |
05adb9d2 | 36 | // construction |
e766c8a9 SC |
37 | wxFrameMac() { Init(); } |
38 | wxFrameMac(wxWindow *parent, | |
05adb9d2 SC |
39 | wxWindowID id, |
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) | |
45 | { | |
46 | Init(); | |
47 | ||
48 | Create(parent, id, title, pos, size, style, name); | |
49 | } | |
50 | ||
51 | bool Create(wxWindow *parent, | |
52 | wxWindowID id, | |
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); | |
58 | ||
e766c8a9 | 59 | virtual ~wxFrameMac(); |
05adb9d2 SC |
60 | |
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(); | |
05adb9d2 SC |
67 | virtual void SetIcon(const wxIcon& icon); |
68 | ||
69 | // implementation only from now on | |
70 | // ------------------------------- | |
71 | ||
72 | // override some more virtuals | |
73 | virtual bool Enable(bool enable) ; | |
74 | ||
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; | |
78 | ||
79 | // event handlers | |
80 | void OnActivate(wxActivateEvent& event); | |
81 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
82 | ||
83 | // Toolbar | |
519cb848 | 84 | #if wxUSE_TOOLBAR |
05adb9d2 SC |
85 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT, |
86 | wxWindowID id = -1, | |
87 | const wxString& name = wxToolBarNameStr); | |
519cb848 | 88 | |
05adb9d2 SC |
89 | virtual void PositionToolBar(); |
90 | #endif // wxUSE_TOOLBAR | |
519cb848 | 91 | |
05adb9d2 SC |
92 | // Status bar |
93 | #if wxUSE_STATUSBAR | |
94 | virtual wxStatusBar* OnCreateStatusBar(int number = 1, | |
95 | long style = wxST_SIZEGRIP, | |
96 | wxWindowID id = 0, | |
97 | const wxString& name = wxStatusLineNameStr); | |
0dbd6262 | 98 | |
05adb9d2 | 99 | virtual void PositionStatusBar(); |
0dbd6262 SC |
100 | |
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; }; | |
05adb9d2 | 105 | #endif // wxUSE_STATUSBAR |
0dbd6262 | 106 | |
05adb9d2 | 107 | // tooltip management |
519cb848 SC |
108 | #if wxUSE_TOOLTIPS |
109 | wxMacToolTip* GetToolTipCtrl() const { return m_hwndToolTip; } | |
e7549107 SC |
110 | void SetToolTipCtrl(wxMacToolTip *tt) { m_hwndToolTip = tt; } |
111 | wxMacToolTip* m_hwndToolTip ; | |
519cb848 | 112 | #endif // tooltips |
0dbd6262 SC |
113 | |
114 | protected: | |
05adb9d2 SC |
115 | // common part of all ctors |
116 | void Init(); | |
117 | ||
118 | // override base class virtuals | |
119 | virtual void DoGetClientSize(int *width, int *height) const; | |
120 | virtual void DoSetClientSize(int width, int height); | |
121 | ||
122 | protected: | |
0dbd6262 | 123 | bool m_iconized; |
05adb9d2 SC |
124 | #if wxUSE_STATUSBAR |
125 | static bool m_useNativeStatusBar; | |
126 | #endif // wxUSE_STATUSBAR | |
7810c95b SC |
127 | // the last focused child: we restore focus to it on activation |
128 | wxWindow *m_winLastFocused; | |
0dbd6262 | 129 | |
05adb9d2 SC |
130 | private: |
131 | DECLARE_EVENT_TABLE() | |
0dbd6262 SC |
132 | }; |
133 | ||
134 | #endif | |
135 | // _WX_FRAME_H_ |