1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various window classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/minifram.h>
19 #include <wx/splash.h>
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
27 // Import some definitions of other classes, etc.
34 %pragma(python) code = "import wx"
36 //----------------------------------------------------------------------
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);
46 //----------------------------------------------------------------------
49 wxFULLSCREEN_NOMENUBAR,
50 wxFULLSCREEN_NOTOOLBAR,
51 wxFULLSCREEN_NOSTATUSBAR,
52 wxFULLSCREEN_NOBORDER,
53 wxFULLSCREEN_NOCAPTION,
60 //----------------------------------------------------------------------
63 class wxTopLevelWindow : public wxWindow
67 wxTopLevelWindow(wxWindow *parent,
69 const wxString& title,
70 const wxPoint& pos = wxDefaultPosition,
71 const wxSize& size = wxDefaultSize,
72 long style = wxDEFAULT_FRAME_STYLE,
73 const wxString& name = wxPyFrameNameStr);
74 %name(wxPreTopLevelWindow)wxTopLevelWindow();
76 bool Create(wxWindow *parent,
78 const wxString& title,
79 const wxPoint& pos = wxDefaultPosition,
80 const wxSize& size = wxDefaultSize,
81 long style = wxDEFAULT_FRAME_STYLE,
82 const wxString& name = wxPyFrameNameStr);
84 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
85 %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)"
87 // maximize = TRUE => maximize, otherwise - restore
88 virtual void Maximize(bool maximize = TRUE);
90 // undo Maximize() or Iconize()
91 virtual void Restore();
93 // iconize = TRUE => iconize, otherwise - restore
94 virtual void Iconize(bool iconize = TRUE);
96 // return TRUE if the frame is maximized
97 virtual bool IsMaximized() const;
99 // return TRUE if the frame is iconized
100 virtual bool IsIconized() const;
102 // get the frame icon
103 wxIcon GetIcon() const;
105 // set the frame icon
106 virtual void SetIcon(const wxIcon& icon);
108 // set the frame icons
109 virtual void SetIcons(const wxIconBundle& icons );
111 // maximize the window to cover entire screen
112 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
114 // return TRUE if the frame is in fullscreen mode
115 virtual bool IsFullScreen() const;
117 virtual void SetTitle(const wxString& title);
118 virtual wxString GetTitle() const;
121 //----------------------------------------------------------------------
124 class wxFrame : public wxTopLevelWindow {
126 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
127 const wxPoint& pos = wxDefaultPosition,
128 const wxSize& size = wxDefaultSize,
129 long style = wxDEFAULT_FRAME_STYLE,
130 const wxString& name = wxPyFrameNameStr);
131 %name(wxPreFrame)wxFrame();
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,
137 const wxString& name = wxPyFrameNameStr);
139 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
140 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
142 wxPoint GetClientAreaOrigin();
144 void SetMenuBar(wxMenuBar *menubar);
145 wxMenuBar *GetMenuBar();
148 // call this to simulate a menu command
149 bool Command(int id);
151 // process menu command: returns TRUE if processed
152 bool ProcessCommand(int id);
154 // create the main status bar
155 wxStatusBar* CreateStatusBar(int number = 1,
156 long style = wxST_SIZEGRIP,
158 const wxString& name = wxPyStatusLineNameStr);
160 // get the main status bar
161 wxStatusBar *GetStatusBar();
163 // sets the main status bar
164 void SetStatusBar(wxStatusBar *statBar);
166 // forward these to status bar
167 virtual void SetStatusText(const wxString &text, int number = 0);
168 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
171 // create main toolbar
172 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
174 const wxString& name = wxPyToolBarNameStr);
176 // get/set the main toolbar
177 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
178 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
182 //---------------------------------------------------------------------------
184 class wxDialog : public wxTopLevelWindow {
186 wxDialog(wxWindow* parent,
188 const wxString& title,
189 const wxPoint& pos = wxDefaultPosition,
190 const wxSize& size = wxDefaultSize,
191 long style = wxDEFAULT_DIALOG_STYLE,
192 const wxString& name = wxPyDialogNameStr);
193 %name(wxPreDialog)wxDialog();
195 bool Create(wxWindow* parent,
197 const wxString& title,
198 const wxPoint& pos = wxDefaultPosition,
199 const wxSize& size = wxDefaultSize,
200 long style = wxDEFAULT_DIALOG_STYLE,
201 const wxString& name = wxPyDialogNameStr);
203 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
204 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
206 void Centre(int direction = wxBOTH);
207 void EndModal(int retCode);
208 void SetModal(bool flag);
213 void SetReturnCode(int retCode);
215 wxSizer* CreateTextSizer( const wxString &message );
216 wxSizer* CreateButtonSizer( long flags );
221 //---------------------------------------------------------------------------
223 class wxMiniFrame : public wxFrame {
225 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
226 const wxPoint& pos = wxDefaultPosition,
227 const wxSize& size = wxDefaultSize,
228 long style = wxDEFAULT_FRAME_STYLE,
229 const wxString& name = wxPyFrameNameStr);
230 %name(wxPreMiniFrame)wxMiniFrame();
232 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
233 const wxPoint& pos = wxDefaultPosition,
234 const wxSize& size = wxDefaultSize,
235 long style = wxDEFAULT_FRAME_STYLE,
236 const wxString& name = wxPyFrameNameStr);
238 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
239 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
243 //---------------------------------------------------------------------------
246 wxSPLASH_CENTRE_ON_PARENT,
247 wxSPLASH_CENTRE_ON_SCREEN,
254 class wxSplashScreenWindow: public wxWindow
257 wxSplashScreenWindow(const wxBitmap& bitmap,
258 wxWindow* parent, wxWindowID id,
259 const wxPoint& pos = wxDefaultPosition,
260 const wxSize& size = wxDefaultSize,
261 long style = wxNO_BORDER);
263 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
265 void SetBitmap(const wxBitmap& bitmap);
266 wxBitmap& GetBitmap();
270 class wxSplashScreen : public wxFrame {
272 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
273 wxWindow* parent, wxWindowID id,
274 const wxPoint& pos = wxDefaultPosition,
275 const wxSize& size = wxDefaultSize,
276 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT);
278 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
280 long GetSplashStyle() const;
281 wxSplashScreenWindow* GetSplashWindow() const;
282 int GetTimeout() const;
286 //---------------------------------------------------------------------------