]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/frames.i
Updates for new wxToolBar API
[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
108
109 // maximize the window to cover entire screen
110 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
111
112 // return TRUE if the frame is in fullscreen mode
113 virtual bool IsFullScreen() const;
114
115 virtual void SetTitle(const wxString& title);
116 virtual wxString GetTitle() const;
117};
118
119//----------------------------------------------------------------------
120
121
122class wxFrame : public wxTopLevelWindow {
9c039d08
RD
123public:
124 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
125 const wxPoint& pos = wxDefaultPosition,
126 const wxSize& size = wxDefaultSize,
9c039d08 127 long style = wxDEFAULT_FRAME_STYLE,
137b5242 128 const wxString& name = wxPyFrameNameStr);
09f3d4e6 129 %name(wxPreFrame)wxFrame();
9c039d08 130
09f3d4e6
RD
131 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
132 const wxPoint& pos = wxDefaultPosition,
133 const wxSize& size = wxDefaultSize,
134 long style = wxDEFAULT_FRAME_STYLE,
137b5242 135 const wxString& name = wxPyFrameNameStr);
9c039d08 136
0122b7e3 137 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 138 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
0122b7e3 139
ecc08ead
RD
140 wxPoint GetClientAreaOrigin();
141
142 void SetMenuBar(wxMenuBar *menubar);
143 wxMenuBar *GetMenuBar();
144
145
146 // call this to simulate a menu command
147 bool Command(int id);
148
149 // process menu command: returns TRUE if processed
150 bool ProcessCommand(int id);
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
167
168
169 // create main toolbar
170 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
171 wxWindowID id = -1,
137b5242 172 const wxString& name = wxPyToolBarNameStr);
ecc08ead
RD
173
174 // get/set the main toolbar
175 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
176 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
177
9c039d08
RD
178};
179
ecc08ead
RD
180//---------------------------------------------------------------------------
181
182class wxDialog : public wxTopLevelWindow {
183public:
184 wxDialog(wxWindow* parent,
185 const wxWindowID id,
186 const wxString& title,
187 const wxPoint& pos = wxDefaultPosition,
188 const wxSize& size = wxDefaultSize,
189 long style = wxDEFAULT_DIALOG_STYLE,
137b5242 190 const wxString& name = wxPyDialogNameStr);
ecc08ead
RD
191 %name(wxPreDialog)wxDialog();
192
193 bool Create(wxWindow* parent,
194 const wxWindowID id,
195 const wxString& title,
196 const wxPoint& pos = wxDefaultPosition,
197 const wxSize& size = wxDefaultSize,
198 long style = wxDEFAULT_DIALOG_STYLE,
137b5242 199 const wxString& name = wxPyDialogNameStr);
ecc08ead 200
0122b7e3 201 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 202 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
0122b7e3 203
ecc08ead
RD
204 void Centre(int direction = wxBOTH);
205 void EndModal(int retCode);
206 void SetModal(bool flag);
207 bool IsModal();
208 int ShowModal();
209
210 int GetReturnCode();
211 void SetReturnCode(int retCode);
212
213 wxSizer* CreateTextSizer( const wxString &message );
214 wxSizer* CreateButtonSizer( long flags );
215
216};
217
218
9c039d08
RD
219//---------------------------------------------------------------------------
220
9c039d08
RD
221class wxMiniFrame : public wxFrame {
222public:
223 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
224 const wxPoint& pos = wxDefaultPosition,
225 const wxSize& size = wxDefaultSize,
9c039d08 226 long style = wxDEFAULT_FRAME_STYLE,
137b5242 227 const wxString& name = wxPyFrameNameStr);
09f3d4e6 228 %name(wxPreMiniFrame)wxMiniFrame();
9c039d08 229
09f3d4e6
RD
230 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
231 const wxPoint& pos = wxDefaultPosition,
232 const wxSize& size = wxDefaultSize,
233 long style = wxDEFAULT_FRAME_STYLE,
137b5242 234 const wxString& name = wxPyFrameNameStr);
0122b7e3
RD
235
236 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 237 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
9c039d08 238};
b8b8dda7
RD
239
240
241//---------------------------------------------------------------------------
b8b8dda7 242
b5a5d647
RD
243enum {
244 wxSPLASH_CENTRE_ON_PARENT,
245 wxSPLASH_CENTRE_ON_SCREEN,
246 wxSPLASH_NO_CENTRE,
247 wxSPLASH_TIMEOUT,
248 wxSPLASH_NO_TIMEOUT,
249};
250
251
252class wxSplashScreenWindow: public wxWindow
253{
254public:
255 wxSplashScreenWindow(const wxBitmap& bitmap,
256 wxWindow* parent, wxWindowID id,
257 const wxPoint& pos = wxDefaultPosition,
258 const wxSize& size = wxDefaultSize,
259 long style = wxNO_BORDER);
260
261 void SetBitmap(const wxBitmap& bitmap);
262 wxBitmap& GetBitmap();
263};
264
265
266class wxSplashScreen : public wxFrame {
267public:
268 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
269 wxWindow* parent, wxWindowID id,
270 const wxPoint& pos = wxDefaultPosition,
271 const wxSize& size = wxDefaultSize,
272 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT);
273
274 long GetSplashStyle() const;
275 wxSplashScreenWindow* GetSplashWindow() const;
276 int GetTimeout() const;
277};
278
279
280//---------------------------------------------------------------------------
281
4f3449b4 282
b8b8dda7
RD
283
284
285
9c039d08 286