]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
7c0ea335 | 2 | // Name: wx/msw/frame.h |
0d53fc34 | 3 | // Purpose: wxFrame class |
2bda0e17 KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_FRAME_H_ |
13 | #define _WX_FRAME_H_ | |
2bda0e17 | 14 | |
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
42e69d6b | 16 | #pragma interface "frame.h" |
2bda0e17 KB |
17 | #endif |
18 | ||
0d53fc34 | 19 | class WXDLLEXPORT wxFrame : public wxFrameBase |
3a19e16d | 20 | { |
2bda0e17 | 21 | public: |
7c0ea335 | 22 | // construction |
0d53fc34 VS |
23 | wxFrame() { Init(); } |
24 | wxFrame(wxWindow *parent, | |
1e6feb95 VZ |
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 | |
0d53fc34 | 45 | virtual ~wxFrame(); |
16f6dfd8 | 46 | |
7c0ea335 | 47 | // implement base class pure virtuals |
a2327a9f | 48 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); |
82c9f85c | 49 | virtual void Raise(); |
42e69d6b | 50 | |
7c0ea335 VZ |
51 | // implementation only from now on |
52 | // ------------------------------- | |
16f6dfd8 | 53 | |
7c0ea335 | 54 | // event handlers |
7c0ea335 | 55 | void OnSysColourChanged(wxSysColourChangedEvent& event); |
16f6dfd8 | 56 | |
3a19e16d | 57 | // Toolbar |
d427503c | 58 | #if wxUSE_TOOLBAR |
f9dae779 | 59 | virtual wxToolBar* CreateToolBar(long style = -1, |
cbe874bd | 60 | wxWindowID id = wxID_ANY, |
3a19e16d VZ |
61 | const wxString& name = wxToolBarNameStr); |
62 | ||
3a19e16d | 63 | virtual void PositionToolBar(); |
d427503c | 64 | #endif // wxUSE_TOOLBAR |
16f6dfd8 | 65 | |
3a19e16d | 66 | // Status bar |
7c0ea335 VZ |
67 | #if wxUSE_STATUSBAR |
68 | virtual wxStatusBar* OnCreateStatusBar(int number = 1, | |
69 | long style = wxST_SIZEGRIP, | |
70 | wxWindowID id = 0, | |
71 | const wxString& name = wxStatusLineNameStr); | |
3a19e16d VZ |
72 | |
73 | virtual void PositionStatusBar(); | |
16f6dfd8 | 74 | |
7c0ea335 VZ |
75 | // Hint to tell framework which status bar to use: the default is to use |
76 | // native one for the platforms which support it (Win32), the generic one | |
77 | // otherwise | |
16f6dfd8 | 78 | |
3a19e16d | 79 | // TODO: should this go into a wxFrameworkSettings class perhaps? |
7c0ea335 VZ |
80 | static void UseNativeStatusBar(bool useNative) |
81 | { m_useNativeStatusBar = useNative; }; | |
82 | static bool UsesNativeStatusBar() | |
83 | { return m_useNativeStatusBar; }; | |
d427503c | 84 | #endif // wxUSE_STATUSBAR |
16f6dfd8 | 85 | |
42e69d6b | 86 | WXHMENU GetWinMenu() const { return m_hMenu; } |
16f6dfd8 | 87 | |
7c0ea335 | 88 | // event handlers |
42e69d6b VZ |
89 | bool HandlePaint(); |
90 | bool HandleSize(int x, int y, WXUINT flag); | |
91 | bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); | |
92 | bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu); | |
ccef86c7 | 93 | bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup); |
42e69d6b | 94 | |
7c0ea335 | 95 | // tooltip management |
3a19e16d | 96 | #if wxUSE_TOOLTIPS |
a23fd0e1 VZ |
97 | WXHWND GetToolTipCtrl() const { return m_hwndToolTip; } |
98 | void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; } | |
3a19e16d VZ |
99 | #endif // tooltips |
100 | ||
3cfcd50b GT |
101 | // a MSW only function which sends a size event to the window using its |
102 | // current size - this has an effect of refreshing the window layout | |
a4f25aef | 103 | virtual void SendSizeEvent(); |
3cfcd50b | 104 | |
6c7afb74 | 105 | virtual wxPoint GetClientAreaOrigin() const; |
cbe874bd | 106 | |
2bda0e17 | 107 | protected: |
7c0ea335 VZ |
108 | // common part of all ctors |
109 | void Init(); | |
110 | ||
a23fd0e1 VZ |
111 | // override base class virtuals |
112 | virtual void DoGetClientSize(int *width, int *height) const; | |
a23fd0e1 | 113 | virtual void DoSetClientSize(int width, int height); |
cc2b7472 | 114 | |
1e6feb95 | 115 | #if wxUSE_MENUS_NATIVE |
6522713c VZ |
116 | // perform MSW-specific action when menubar is changed |
117 | virtual void AttachMenuBar(wxMenuBar *menubar); | |
118 | ||
42e69d6b VZ |
119 | // a plug in for MDI frame classes which need to do something special when |
120 | // the menubar is set | |
121 | virtual void InternalSetMenuBar(); | |
1e6feb95 | 122 | #endif // wxUSE_MENUS_NATIVE |
42e69d6b | 123 | |
3a19e16d VZ |
124 | // propagate our state change to all child frames |
125 | void IconizeChildFrames(bool bIconize); | |
16f6dfd8 | 126 | |
42e69d6b VZ |
127 | // we add menu bar accel processing |
128 | bool MSWTranslateMessage(WXMSG* pMsg); | |
129 | ||
a23fd0e1 | 130 | // window proc for the frames |
c140b7e7 | 131 | WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); |
bf505d28 | 132 | |
92f1a59c JS |
133 | // handle WM_INITMENUPOPUP message |
134 | bool HandleInitMenuPopup(WXHMENU hMenu); | |
e39af974 | 135 | |
cbe874bd | 136 | virtual bool IsMDIChild() const { return false; } |
a23fd0e1 | 137 | |
77ffb593 | 138 | // get default (wxWidgets) icon for the frame |
82c9f85c | 139 | virtual WXHICON GetDefaultIcon() const; |
d427503c VZ |
140 | |
141 | #if wxUSE_STATUSBAR | |
3a19e16d | 142 | static bool m_useNativeStatusBar; |
d427503c VZ |
143 | #endif // wxUSE_STATUSBAR |
144 | ||
a2327a9f | 145 | // Data to save/restore when calling ShowFullScreen |
a2327a9f JS |
146 | int m_fsStatusBarFields; // 0 for no status bar |
147 | int m_fsStatusBarHeight; | |
148 | int m_fsToolBarHeight; | |
a2327a9f | 149 | |
a23fd0e1 | 150 | private: |
3a19e16d VZ |
151 | #if wxUSE_TOOLTIPS |
152 | WXHWND m_hwndToolTip; | |
153 | #endif // tooltips | |
154 | ||
9327c3aa VZ |
155 | // used by IconizeChildFrames(), see comments there |
156 | bool m_wasMinimized; | |
157 | ||
3a19e16d | 158 | DECLARE_EVENT_TABLE() |
fc7a2a60 | 159 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame) |
2bda0e17 KB |
160 | }; |
161 | ||
162 | #endif | |
bbcdf8bc | 163 | // _WX_FRAME_H_ |