]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/frame.h
reverted Julian's unintentional breakage of wxChoice
[wxWidgets.git] / include / wx / msw / frame.h
CommitLineData
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$
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
0d53fc34 19class WXDLLEXPORT wxFrame : public wxFrameBase
3a19e16d 20{
2bda0e17 21public:
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
VZ
54 // event handlers
55 void OnActivate(wxActivateEvent& event);
56 void OnSysColourChanged(wxSysColourChangedEvent& event);
16f6dfd8 57
3a19e16d 58 // Toolbar
d427503c 59#if wxUSE_TOOLBAR
3a19e16d
VZ
60 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
61 wxWindowID id = -1,
62 const wxString& name = wxToolBarNameStr);
63
3a19e16d 64 virtual void PositionToolBar();
d427503c 65#endif // wxUSE_TOOLBAR
16f6dfd8 66
3a19e16d 67 // Status bar
7c0ea335
VZ
68#if wxUSE_STATUSBAR
69 virtual wxStatusBar* OnCreateStatusBar(int number = 1,
70 long style = wxST_SIZEGRIP,
71 wxWindowID id = 0,
72 const wxString& name = wxStatusLineNameStr);
3a19e16d
VZ
73
74 virtual void PositionStatusBar();
16f6dfd8 75
7c0ea335
VZ
76 // Hint to tell framework which status bar to use: the default is to use
77 // native one for the platforms which support it (Win32), the generic one
78 // otherwise
16f6dfd8 79
3a19e16d 80 // TODO: should this go into a wxFrameworkSettings class perhaps?
7c0ea335
VZ
81 static void UseNativeStatusBar(bool useNative)
82 { m_useNativeStatusBar = useNative; };
83 static bool UsesNativeStatusBar()
84 { return m_useNativeStatusBar; };
d427503c 85#endif // wxUSE_STATUSBAR
16f6dfd8 86
42e69d6b 87 WXHMENU GetWinMenu() const { return m_hMenu; }
16f6dfd8 88
7c0ea335 89 // event handlers
42e69d6b
VZ
90 bool HandlePaint();
91 bool HandleSize(int x, int y, WXUINT flag);
92 bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
93 bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
ccef86c7 94 bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
42e69d6b 95
7c0ea335 96 // tooltip management
3a19e16d 97#if wxUSE_TOOLTIPS
a23fd0e1
VZ
98 WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
99 void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
3a19e16d
VZ
100#endif // tooltips
101
3cfcd50b
GT
102 // a MSW only function which sends a size event to the window using its
103 // current size - this has an effect of refreshing the window layout
104 void SendSizeEvent();
105
4a41c655
VS
106 // called by wxWindow whenever it gets focus
107 void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
108 wxWindow *GetLastFocus() const { return m_winLastFocused; }
109
2bda0e17 110protected:
7c0ea335
VZ
111 // common part of all ctors
112 void Init();
113
a23fd0e1
VZ
114 // override base class virtuals
115 virtual void DoGetClientSize(int *width, int *height) const;
a23fd0e1 116 virtual void DoSetClientSize(int width, int height);
cc2b7472 117
1e6feb95 118#if wxUSE_MENUS_NATIVE
6522713c
VZ
119 // perform MSW-specific action when menubar is changed
120 virtual void AttachMenuBar(wxMenuBar *menubar);
121
42e69d6b
VZ
122 // a plug in for MDI frame classes which need to do something special when
123 // the menubar is set
124 virtual void InternalSetMenuBar();
1e6feb95 125#endif // wxUSE_MENUS_NATIVE
42e69d6b 126
3a19e16d
VZ
127 // propagate our state change to all child frames
128 void IconizeChildFrames(bool bIconize);
16f6dfd8 129
42e69d6b
VZ
130 // we add menu bar accel processing
131 bool MSWTranslateMessage(WXMSG* pMsg);
132
a23fd0e1
VZ
133 // window proc for the frames
134 long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
bf505d28 135
91dd52fe 136 virtual bool IsMDIChild() const { return FALSE; }
a23fd0e1 137
82c9f85c
VZ
138 // get default (wxWindows) icon for the frame
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
f6bcfd97
BP
145 // the last focused child: we restore focus to it on activation
146 wxWindow *m_winLastFocused;
147
a2327a9f 148 // Data to save/restore when calling ShowFullScreen
a2327a9f
JS
149 int m_fsStatusBarFields; // 0 for no status bar
150 int m_fsStatusBarHeight;
151 int m_fsToolBarHeight;
152// WXHMENU m_fsMenu;
a2327a9f 153
a23fd0e1 154private:
3a19e16d
VZ
155#if wxUSE_TOOLTIPS
156 WXHWND m_hwndToolTip;
157#endif // tooltips
158
9327c3aa
VZ
159 // used by IconizeChildFrames(), see comments there
160 bool m_wasMinimized;
161
3a19e16d 162 DECLARE_EVENT_TABLE()
0d53fc34 163 DECLARE_DYNAMIC_CLASS(wxFrame)
2bda0e17
KB
164};
165
166#endif
bbcdf8bc 167 // _WX_FRAME_H_