]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/frames.i
Removed deprecation warnings in OGL and Gizmos
[wxWidgets.git] / wxPython / src / frames.i
CommitLineData
9c039d08
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: frames.i
3// Purpose: SWIG definitions of various window classes
4//
5// Author: Robin Dunn
6//
7// Created: 8/27/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13
14%module frames
15
16%{
17#include "helpers.h"
9c039d08 18#include <wx/minifram.h>
b5a5d647 19#include <wx/splash.h>
9c039d08
RD
20%}
21
22//----------------------------------------------------------------------
23
24%include typemaps.i
25%include my_typemaps.i
26
27// Import some definitions of other classes, etc.
28%import _defs.i
29%import misc.i
30%import gdi.i
31%import windows.i
32%import stattool.i
33
b8b8dda7 34%pragma(python) code = "import wx"
9c039d08
RD
35
36//----------------------------------------------------------------------
37
137b5242
RD
38%{
39 // Put some wx default wxChar* values into wxStrings.
40 DECLARE_DEF_STRING(FrameNameStr);
41 DECLARE_DEF_STRING(DialogNameStr);
42 DECLARE_DEF_STRING(StatusLineNameStr);
43 DECLARE_DEF_STRING(ToolBarNameStr);
44%}
45
46//----------------------------------------------------------------------
47
f6bcfd97
BP
48enum {
49 wxFULLSCREEN_NOMENUBAR,
50 wxFULLSCREEN_NOTOOLBAR,
51 wxFULLSCREEN_NOSTATUSBAR,
52 wxFULLSCREEN_NOBORDER,
53 wxFULLSCREEN_NOCAPTION,
ecc08ead
RD
54 wxFULLSCREEN_ALL,
55
56 wxTOPLEVEL_EX_DIALOG,
f6bcfd97
BP
57};
58
59
ecc08ead
RD
60//----------------------------------------------------------------------
61
62
63class wxTopLevelWindow : public wxWindow
64{
65public:
66 // construction
67 wxTopLevelWindow(wxWindow *parent,
68 wxWindowID id,
69 const wxString& title,
70 const wxPoint& pos = wxDefaultPosition,
71 const wxSize& size = wxDefaultSize,
72 long style = wxDEFAULT_FRAME_STYLE,
137b5242 73 const wxString& name = wxPyFrameNameStr);
ecc08ead
RD
74 %name(wxPreTopLevelWindow)wxTopLevelWindow();
75
76 bool Create(wxWindow *parent,
77 wxWindowID id,
78 const wxString& title,
79 const wxPoint& pos = wxDefaultPosition,
80 const wxSize& size = wxDefaultSize,
81 long style = wxDEFAULT_FRAME_STYLE,
137b5242 82 const wxString& name = wxPyFrameNameStr);
ecc08ead 83
0122b7e3 84 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 85 %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)"
ecc08ead
RD
86
87 // maximize = TRUE => maximize, otherwise - restore
88 virtual void Maximize(bool maximize = TRUE);
89
90 // undo Maximize() or Iconize()
91 virtual void Restore();
92
93 // iconize = TRUE => iconize, otherwise - restore
94 virtual void Iconize(bool iconize = TRUE);
95
96 // return TRUE if the frame is maximized
97 virtual bool IsMaximized() const;
98
99 // return TRUE if the frame is iconized
100 virtual bool IsIconized() const;
101
102 // get the frame icon
c5943253 103 wxIcon GetIcon() const;
ecc08ead
RD
104
105 // set the frame icon
106 virtual void SetIcon(const wxIcon& icon);
107
0e9b78ce
RD
108 // set the frame icons
109 virtual void SetIcons(const wxIconBundle& icons );
ecc08ead
RD
110
111 // maximize the window to cover entire screen
112 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
113
114 // return TRUE if the frame is in fullscreen mode
115 virtual bool IsFullScreen() const;
116
117 virtual void SetTitle(const wxString& title);
118 virtual wxString GetTitle() const;
119};
120
121//----------------------------------------------------------------------
122
123
124class wxFrame : public wxTopLevelWindow {
9c039d08
RD
125public:
126 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
127 const wxPoint& pos = wxDefaultPosition,
128 const wxSize& size = wxDefaultSize,
9c039d08 129 long style = wxDEFAULT_FRAME_STYLE,
137b5242 130 const wxString& name = wxPyFrameNameStr);
09f3d4e6 131 %name(wxPreFrame)wxFrame();
9c039d08 132
09f3d4e6
RD
133 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
134 const wxPoint& pos = wxDefaultPosition,
135 const wxSize& size = wxDefaultSize,
136 long style = wxDEFAULT_FRAME_STYLE,
137b5242 137 const wxString& name = wxPyFrameNameStr);
9c039d08 138
0122b7e3 139 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 140 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
0122b7e3 141
ecc08ead
RD
142 wxPoint GetClientAreaOrigin();
143
144 void SetMenuBar(wxMenuBar *menubar);
145 wxMenuBar *GetMenuBar();
146
147
ecc08ead
RD
148 // process menu command: returns TRUE if processed
149 bool ProcessCommand(int id);
1e4a197e 150 %pragma(python) addtoclass = "Command = ProcessCommand"
ecc08ead
RD
151
152 // create the main status bar
9c039d08
RD
153 wxStatusBar* CreateStatusBar(int number = 1,
154 long style = wxST_SIZEGRIP,
155 wxWindowID id = -1,
137b5242 156 const wxString& name = wxPyStatusLineNameStr);
ecc08ead
RD
157
158 // get the main status bar
159 wxStatusBar *GetStatusBar();
160
161 // sets the main status bar
162 void SetStatusBar(wxStatusBar *statBar);
163
164 // forward these to status bar
165 virtual void SetStatusText(const wxString &text, int number = 0);
166 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
94e36a51
RD
167 void PushStatusText(const wxString &text, int number = 0);
168 void PopStatusText(int number = 0);
169
170 // show help text (typically in the statusbar); show is FALSE
171 // if you are hiding the help, TRUE otherwise
172 virtual void DoGiveHelp(const wxString& text, bool show);
173
174 // set the status bar pane the help will be shown in
175 void SetStatusBarPane(int n);
176 int GetStatusBarPane() const;
ecc08ead
RD
177
178
179 // create main toolbar
180 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
181 wxWindowID id = -1,
137b5242 182 const wxString& name = wxPyToolBarNameStr);
ecc08ead
RD
183
184 // get/set the main toolbar
185 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
186 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
187
f725aedb
RD
188 // sends a size event to the window using its current size -- this has an
189 // effect of refreshing the window layout
190 virtual void SendSizeEvent();
9c039d08
RD
191};
192
ecc08ead
RD
193//---------------------------------------------------------------------------
194
195class wxDialog : public wxTopLevelWindow {
196public:
197 wxDialog(wxWindow* parent,
198 const wxWindowID id,
199 const wxString& title,
200 const wxPoint& pos = wxDefaultPosition,
201 const wxSize& size = wxDefaultSize,
202 long style = wxDEFAULT_DIALOG_STYLE,
137b5242 203 const wxString& name = wxPyDialogNameStr);
ecc08ead
RD
204 %name(wxPreDialog)wxDialog();
205
206 bool Create(wxWindow* parent,
207 const wxWindowID id,
208 const wxString& title,
209 const wxPoint& pos = wxDefaultPosition,
210 const wxSize& size = wxDefaultSize,
211 long style = wxDEFAULT_DIALOG_STYLE,
137b5242 212 const wxString& name = wxPyDialogNameStr);
ecc08ead 213
0122b7e3 214 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 215 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
0122b7e3 216
ecc08ead
RD
217 void Centre(int direction = wxBOTH);
218 void EndModal(int retCode);
219 void SetModal(bool flag);
220 bool IsModal();
221 int ShowModal();
222
223 int GetReturnCode();
224 void SetReturnCode(int retCode);
225
226 wxSizer* CreateTextSizer( const wxString &message );
227 wxSizer* CreateButtonSizer( long flags );
228
229};
230
231
9c039d08
RD
232//---------------------------------------------------------------------------
233
9c039d08
RD
234class wxMiniFrame : public wxFrame {
235public:
236 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
237 const wxPoint& pos = wxDefaultPosition,
238 const wxSize& size = wxDefaultSize,
9c039d08 239 long style = wxDEFAULT_FRAME_STYLE,
137b5242 240 const wxString& name = wxPyFrameNameStr);
09f3d4e6 241 %name(wxPreMiniFrame)wxMiniFrame();
9c039d08 242
09f3d4e6
RD
243 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
244 const wxPoint& pos = wxDefaultPosition,
245 const wxSize& size = wxDefaultSize,
246 long style = wxDEFAULT_FRAME_STYLE,
137b5242 247 const wxString& name = wxPyFrameNameStr);
0122b7e3
RD
248
249 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 250 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
9c039d08 251};
b8b8dda7
RD
252
253
254//---------------------------------------------------------------------------
b8b8dda7 255
b5a5d647
RD
256enum {
257 wxSPLASH_CENTRE_ON_PARENT,
258 wxSPLASH_CENTRE_ON_SCREEN,
259 wxSPLASH_NO_CENTRE,
260 wxSPLASH_TIMEOUT,
261 wxSPLASH_NO_TIMEOUT,
262};
263
264
265class wxSplashScreenWindow: public wxWindow
266{
267public:
268 wxSplashScreenWindow(const wxBitmap& bitmap,
269 wxWindow* parent, wxWindowID id,
270 const wxPoint& pos = wxDefaultPosition,
271 const wxSize& size = wxDefaultSize,
272 long style = wxNO_BORDER);
273
aacd7bb6
RD
274 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
275
b5a5d647
RD
276 void SetBitmap(const wxBitmap& bitmap);
277 wxBitmap& GetBitmap();
278};
279
280
281class wxSplashScreen : public wxFrame {
282public:
283 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
284 wxWindow* parent, wxWindowID id,
285 const wxPoint& pos = wxDefaultPosition,
286 const wxSize& size = wxDefaultSize,
479101ca 287 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
b5a5d647 288
aacd7bb6
RD
289 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
290
b5a5d647
RD
291 long GetSplashStyle() const;
292 wxSplashScreenWindow* GetSplashWindow() const;
293 int GetTimeout() const;
294};
295
296
297//---------------------------------------------------------------------------
298
4f3449b4 299
b8b8dda7
RD
300
301
302
9c039d08 303