]>
Commit | Line | Data |
---|---|---|
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 |
48 | enum { |
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 | ||
63 | class wxTopLevelWindow : public wxWindow | |
64 | { | |
65 | public: | |
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; | |
1542ea39 RD |
119 | |
120 | // Set the shape of the window to the given region. | |
121 | // Returns TRUE if the platform supports this feature (and the operation | |
122 | // is successful.) | |
123 | virtual bool SetShape(const wxRegion& region); | |
124 | ||
ecc08ead RD |
125 | }; |
126 | ||
127 | //---------------------------------------------------------------------- | |
128 | ||
129 | ||
130 | class wxFrame : public wxTopLevelWindow { | |
9c039d08 RD |
131 | public: |
132 | wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title, | |
b68dc582 RD |
133 | const wxPoint& pos = wxDefaultPosition, |
134 | const wxSize& size = wxDefaultSize, | |
9c039d08 | 135 | long style = wxDEFAULT_FRAME_STYLE, |
137b5242 | 136 | const wxString& name = wxPyFrameNameStr); |
09f3d4e6 | 137 | %name(wxPreFrame)wxFrame(); |
9c039d08 | 138 | |
09f3d4e6 RD |
139 | bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, |
140 | const wxPoint& pos = wxDefaultPosition, | |
141 | const wxSize& size = wxDefaultSize, | |
142 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 143 | const wxString& name = wxPyFrameNameStr); |
9c039d08 | 144 | |
0122b7e3 | 145 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 146 | %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" |
0122b7e3 | 147 | |
ecc08ead RD |
148 | wxPoint GetClientAreaOrigin(); |
149 | ||
150 | void SetMenuBar(wxMenuBar *menubar); | |
151 | wxMenuBar *GetMenuBar(); | |
152 | ||
153 | ||
ecc08ead RD |
154 | // process menu command: returns TRUE if processed |
155 | bool ProcessCommand(int id); | |
1e4a197e | 156 | %pragma(python) addtoclass = "Command = ProcessCommand" |
ecc08ead RD |
157 | |
158 | // create the main status bar | |
9c039d08 RD |
159 | wxStatusBar* CreateStatusBar(int number = 1, |
160 | long style = wxST_SIZEGRIP, | |
161 | wxWindowID id = -1, | |
137b5242 | 162 | const wxString& name = wxPyStatusLineNameStr); |
ecc08ead RD |
163 | |
164 | // get the main status bar | |
165 | wxStatusBar *GetStatusBar(); | |
166 | ||
167 | // sets the main status bar | |
168 | void SetStatusBar(wxStatusBar *statBar); | |
169 | ||
170 | // forward these to status bar | |
171 | virtual void SetStatusText(const wxString &text, int number = 0); | |
172 | virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap | |
94e36a51 RD |
173 | void PushStatusText(const wxString &text, int number = 0); |
174 | void PopStatusText(int number = 0); | |
175 | ||
176 | // show help text (typically in the statusbar); show is FALSE | |
177 | // if you are hiding the help, TRUE otherwise | |
178 | virtual void DoGiveHelp(const wxString& text, bool show); | |
179 | ||
180 | // set the status bar pane the help will be shown in | |
181 | void SetStatusBarPane(int n); | |
182 | int GetStatusBarPane() const; | |
ecc08ead RD |
183 | |
184 | ||
185 | // create main toolbar | |
186 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
187 | wxWindowID id = -1, | |
137b5242 | 188 | const wxString& name = wxPyToolBarNameStr); |
ecc08ead RD |
189 | |
190 | // get/set the main toolbar | |
191 | virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } | |
192 | virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } | |
193 | ||
f725aedb RD |
194 | // sends a size event to the window using its current size -- this has an |
195 | // effect of refreshing the window layout | |
196 | virtual void SendSizeEvent(); | |
9c039d08 RD |
197 | }; |
198 | ||
ecc08ead RD |
199 | //--------------------------------------------------------------------------- |
200 | ||
201 | class wxDialog : public wxTopLevelWindow { | |
202 | public: | |
203 | wxDialog(wxWindow* parent, | |
204 | const wxWindowID id, | |
205 | const wxString& title, | |
206 | const wxPoint& pos = wxDefaultPosition, | |
207 | const wxSize& size = wxDefaultSize, | |
208 | long style = wxDEFAULT_DIALOG_STYLE, | |
137b5242 | 209 | const wxString& name = wxPyDialogNameStr); |
ecc08ead RD |
210 | %name(wxPreDialog)wxDialog(); |
211 | ||
212 | bool Create(wxWindow* parent, | |
213 | const wxWindowID id, | |
214 | const wxString& title, | |
215 | const wxPoint& pos = wxDefaultPosition, | |
216 | const wxSize& size = wxDefaultSize, | |
217 | long style = wxDEFAULT_DIALOG_STYLE, | |
137b5242 | 218 | const wxString& name = wxPyDialogNameStr); |
ecc08ead | 219 | |
0122b7e3 | 220 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 221 | %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" |
0122b7e3 | 222 | |
ecc08ead RD |
223 | void Centre(int direction = wxBOTH); |
224 | void EndModal(int retCode); | |
225 | void SetModal(bool flag); | |
226 | bool IsModal(); | |
227 | int ShowModal(); | |
228 | ||
229 | int GetReturnCode(); | |
230 | void SetReturnCode(int retCode); | |
231 | ||
232 | wxSizer* CreateTextSizer( const wxString &message ); | |
233 | wxSizer* CreateButtonSizer( long flags ); | |
234 | ||
235 | }; | |
236 | ||
237 | ||
9c039d08 RD |
238 | //--------------------------------------------------------------------------- |
239 | ||
9c039d08 RD |
240 | class wxMiniFrame : public wxFrame { |
241 | public: | |
242 | wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title, | |
b68dc582 RD |
243 | const wxPoint& pos = wxDefaultPosition, |
244 | const wxSize& size = wxDefaultSize, | |
9c039d08 | 245 | long style = wxDEFAULT_FRAME_STYLE, |
137b5242 | 246 | const wxString& name = wxPyFrameNameStr); |
09f3d4e6 | 247 | %name(wxPreMiniFrame)wxMiniFrame(); |
9c039d08 | 248 | |
09f3d4e6 RD |
249 | bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, |
250 | const wxPoint& pos = wxDefaultPosition, | |
251 | const wxSize& size = wxDefaultSize, | |
252 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 253 | const wxString& name = wxPyFrameNameStr); |
0122b7e3 RD |
254 | |
255 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
17c0e08c | 256 | %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" |
9c039d08 | 257 | }; |
b8b8dda7 RD |
258 | |
259 | ||
260 | //--------------------------------------------------------------------------- | |
b8b8dda7 | 261 | |
b5a5d647 RD |
262 | enum { |
263 | wxSPLASH_CENTRE_ON_PARENT, | |
264 | wxSPLASH_CENTRE_ON_SCREEN, | |
265 | wxSPLASH_NO_CENTRE, | |
266 | wxSPLASH_TIMEOUT, | |
267 | wxSPLASH_NO_TIMEOUT, | |
268 | }; | |
269 | ||
270 | ||
271 | class wxSplashScreenWindow: public wxWindow | |
272 | { | |
273 | public: | |
274 | wxSplashScreenWindow(const wxBitmap& bitmap, | |
275 | wxWindow* parent, wxWindowID id, | |
276 | const wxPoint& pos = wxDefaultPosition, | |
277 | const wxSize& size = wxDefaultSize, | |
278 | long style = wxNO_BORDER); | |
279 | ||
aacd7bb6 RD |
280 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
281 | ||
b5a5d647 RD |
282 | void SetBitmap(const wxBitmap& bitmap); |
283 | wxBitmap& GetBitmap(); | |
284 | }; | |
285 | ||
286 | ||
287 | class wxSplashScreen : public wxFrame { | |
288 | public: | |
289 | wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, | |
290 | wxWindow* parent, wxWindowID id, | |
291 | const wxPoint& pos = wxDefaultPosition, | |
292 | const wxSize& size = wxDefaultSize, | |
479101ca | 293 | long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP); |
b5a5d647 | 294 | |
aacd7bb6 RD |
295 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
296 | ||
b5a5d647 RD |
297 | long GetSplashStyle() const; |
298 | wxSplashScreenWindow* GetSplashWindow() const; | |
299 | int GetTimeout() const; | |
300 | }; | |
301 | ||
302 | ||
303 | //--------------------------------------------------------------------------- | |
304 | ||
4f3449b4 | 305 | |
b8b8dda7 RD |
306 | |
307 | ||
308 | ||
9c039d08 | 309 |