]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
7c0ea335 | 2 | // Name: wx/msw/frame.h |
1e6feb95 | 3 | // Purpose: wxFrameMSW class |
2bda0e17 KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
16f6dfd8 | 9 | // Licence: wxWindows license |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_FRAME_H_ |
13 | #define _WX_FRAME_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
42e69d6b | 16 | #pragma interface "frame.h" |
2bda0e17 KB |
17 | #endif |
18 | ||
1e6feb95 | 19 | class WXDLLEXPORT wxFrameMSW : public wxFrameBase |
3a19e16d | 20 | { |
2bda0e17 | 21 | public: |
7c0ea335 | 22 | // construction |
1e6feb95 VZ |
23 | wxFrameMSW() { Init(); } |
24 | wxFrameMSW(wxWindow *parent, | |
25 | wxWindowID id, | |
26 | const wxString& title, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | long style = wxDEFAULT_FRAME_STYLE, | |
30 | const wxString& name = wxFrameNameStr) | |
3a19e16d | 31 | { |
7c0ea335 VZ |
32 | Init(); |
33 | ||
3a19e16d VZ |
34 | Create(parent, id, title, pos, size, style, name); |
35 | } | |
16f6dfd8 | 36 | |
3a19e16d VZ |
37 | bool Create(wxWindow *parent, |
38 | wxWindowID id, | |
39 | const wxString& title, | |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | long style = wxDEFAULT_FRAME_STYLE, | |
43 | const wxString& name = wxFrameNameStr); | |
16f6dfd8 | 44 | |
1e6feb95 | 45 | virtual ~wxFrameMSW(); |
16f6dfd8 | 46 | |
7c0ea335 | 47 | // implement base class pure virtuals |
a2327a9f JS |
48 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); |
49 | virtual bool IsFullScreen() const { return m_fsIsShowing; }; | |
82c9f85c | 50 | virtual void Raise(); |
42e69d6b | 51 | |
7c0ea335 VZ |
52 | // implementation only from now on |
53 | // ------------------------------- | |
16f6dfd8 | 54 | |
7c0ea335 VZ |
55 | // event handlers |
56 | void OnActivate(wxActivateEvent& event); | |
57 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
16f6dfd8 | 58 | |
3a19e16d | 59 | // Toolbar |
d427503c | 60 | #if wxUSE_TOOLBAR |
3a19e16d VZ |
61 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT, |
62 | wxWindowID id = -1, | |
63 | const wxString& name = wxToolBarNameStr); | |
64 | ||
3a19e16d | 65 | virtual void PositionToolBar(); |
d427503c | 66 | #endif // wxUSE_TOOLBAR |
16f6dfd8 | 67 | |
3a19e16d | 68 | // Status bar |
7c0ea335 VZ |
69 | #if wxUSE_STATUSBAR |
70 | virtual wxStatusBar* OnCreateStatusBar(int number = 1, | |
71 | long style = wxST_SIZEGRIP, | |
72 | wxWindowID id = 0, | |
73 | const wxString& name = wxStatusLineNameStr); | |
3a19e16d VZ |
74 | |
75 | virtual void PositionStatusBar(); | |
16f6dfd8 | 76 | |
7c0ea335 VZ |
77 | // Hint to tell framework which status bar to use: the default is to use |
78 | // native one for the platforms which support it (Win32), the generic one | |
79 | // otherwise | |
16f6dfd8 | 80 | |
3a19e16d | 81 | // TODO: should this go into a wxFrameworkSettings class perhaps? |
7c0ea335 VZ |
82 | static void UseNativeStatusBar(bool useNative) |
83 | { m_useNativeStatusBar = useNative; }; | |
84 | static bool UsesNativeStatusBar() | |
85 | { return m_useNativeStatusBar; }; | |
d427503c | 86 | #endif // wxUSE_STATUSBAR |
16f6dfd8 | 87 | |
42e69d6b | 88 | WXHMENU GetWinMenu() const { return m_hMenu; } |
16f6dfd8 | 89 | |
7c0ea335 | 90 | // event handlers |
42e69d6b VZ |
91 | bool HandlePaint(); |
92 | bool HandleSize(int x, int y, WXUINT flag); | |
93 | bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); | |
94 | bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu); | |
95 | ||
9df8c2df OK |
96 | bool MSWCreate(int id, wxWindow *parent, const wxChar *wclass, |
97 | wxWindow *wx_win, const wxChar *title, | |
debe6624 | 98 | int x, int y, int width, int height, long style); |
2bda0e17 | 99 | |
7c0ea335 | 100 | // tooltip management |
3a19e16d | 101 | #if wxUSE_TOOLTIPS |
a23fd0e1 VZ |
102 | WXHWND GetToolTipCtrl() const { return m_hwndToolTip; } |
103 | void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; } | |
3a19e16d VZ |
104 | #endif // tooltips |
105 | ||
3cfcd50b GT |
106 | // a MSW only function which sends a size event to the window using its |
107 | // current size - this has an effect of refreshing the window layout | |
108 | void SendSizeEvent(); | |
109 | ||
4a41c655 VS |
110 | // called by wxWindow whenever it gets focus |
111 | void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } | |
112 | wxWindow *GetLastFocus() const { return m_winLastFocused; } | |
113 | ||
2bda0e17 | 114 | protected: |
7c0ea335 VZ |
115 | // common part of all ctors |
116 | void Init(); | |
117 | ||
a23fd0e1 VZ |
118 | // override base class virtuals |
119 | virtual void DoGetClientSize(int *width, int *height) const; | |
a23fd0e1 | 120 | virtual void DoSetClientSize(int width, int height); |
cc2b7472 | 121 | |
1e6feb95 | 122 | #if wxUSE_MENUS_NATIVE |
6522713c VZ |
123 | // perform MSW-specific action when menubar is changed |
124 | virtual void AttachMenuBar(wxMenuBar *menubar); | |
125 | ||
42e69d6b VZ |
126 | // a plug in for MDI frame classes which need to do something special when |
127 | // the menubar is set | |
128 | virtual void InternalSetMenuBar(); | |
1e6feb95 | 129 | #endif // wxUSE_MENUS_NATIVE |
42e69d6b | 130 | |
3a19e16d VZ |
131 | // propagate our state change to all child frames |
132 | void IconizeChildFrames(bool bIconize); | |
16f6dfd8 | 133 | |
42e69d6b VZ |
134 | // we add menu bar accel processing |
135 | bool MSWTranslateMessage(WXMSG* pMsg); | |
136 | ||
a23fd0e1 VZ |
137 | // window proc for the frames |
138 | long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
bf505d28 | 139 | |
91dd52fe | 140 | virtual bool IsMDIChild() const { return FALSE; } |
a23fd0e1 | 141 | |
82c9f85c VZ |
142 | // get default (wxWindows) icon for the frame |
143 | virtual WXHICON GetDefaultIcon() const; | |
d427503c VZ |
144 | |
145 | #if wxUSE_STATUSBAR | |
3a19e16d | 146 | static bool m_useNativeStatusBar; |
d427503c VZ |
147 | #endif // wxUSE_STATUSBAR |
148 | ||
f6bcfd97 BP |
149 | // the last focused child: we restore focus to it on activation |
150 | wxWindow *m_winLastFocused; | |
151 | ||
a2327a9f JS |
152 | // Data to save/restore when calling ShowFullScreen |
153 | long m_fsStyle; // Passed to ShowFullScreen | |
154 | wxRect m_fsOldSize; | |
155 | long m_fsOldWindowStyle; | |
156 | int m_fsStatusBarFields; // 0 for no status bar | |
157 | int m_fsStatusBarHeight; | |
158 | int m_fsToolBarHeight; | |
159 | // WXHMENU m_fsMenu; | |
160 | bool m_fsIsMaximized; | |
161 | bool m_fsIsShowing; | |
162 | ||
a23fd0e1 | 163 | private: |
3a19e16d VZ |
164 | #if wxUSE_TOOLTIPS |
165 | WXHWND m_hwndToolTip; | |
166 | #endif // tooltips | |
167 | ||
3a19e16d | 168 | DECLARE_EVENT_TABLE() |
2bda0e17 KB |
169 | }; |
170 | ||
171 | #endif | |
bbcdf8bc | 172 | // _WX_FRAME_H_ |