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);
109 // maximize the window to cover entire screen
110 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
112 // return TRUE if the frame is in fullscreen mode
113 virtual bool IsFullScreen() const;
115 virtual void SetTitle(const wxString& title);
116 virtual wxString GetTitle() const;
119 //----------------------------------------------------------------------
122 class wxFrame : public wxTopLevelWindow {
124 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
125 const wxPoint& pos = wxDefaultPosition,
126 const wxSize& size = wxDefaultSize,
127 long style = wxDEFAULT_FRAME_STYLE,
128 const wxString& name = wxPyFrameNameStr);
129 %name(wxPreFrame)wxFrame();
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,
135 const wxString& name = wxPyFrameNameStr);
137 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
138 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
140 wxPoint GetClientAreaOrigin();
142 void SetMenuBar(wxMenuBar *menubar);
143 wxMenuBar *GetMenuBar();
146 // call this to simulate a menu command
147 bool Command(int id);
149 // process menu command: returns TRUE if processed
150 bool ProcessCommand(int id);
152 // create the main status bar
153 wxStatusBar* CreateStatusBar(int number = 1,
154 long style = wxST_SIZEGRIP,
156 const wxString& name = wxPyStatusLineNameStr);
158 // get the main status bar
159 wxStatusBar *GetStatusBar();
161 // sets the main status bar
162 void SetStatusBar(wxStatusBar *statBar);
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
169 // create main toolbar
170 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
172 const wxString& name = wxPyToolBarNameStr);
174 // get/set the main toolbar
175 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
176 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
180 //---------------------------------------------------------------------------
182 class wxDialog : public wxTopLevelWindow {
184 wxDialog(wxWindow* parent,
186 const wxString& title,
187 const wxPoint& pos = wxDefaultPosition,
188 const wxSize& size = wxDefaultSize,
189 long style = wxDEFAULT_DIALOG_STYLE,
190 const wxString& name = wxPyDialogNameStr);
191 %name(wxPreDialog)wxDialog();
193 bool Create(wxWindow* parent,
195 const wxString& title,
196 const wxPoint& pos = wxDefaultPosition,
197 const wxSize& size = wxDefaultSize,
198 long style = wxDEFAULT_DIALOG_STYLE,
199 const wxString& name = wxPyDialogNameStr);
201 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
202 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
204 void Centre(int direction = wxBOTH);
205 void EndModal(int retCode);
206 void SetModal(bool flag);
211 void SetReturnCode(int retCode);
213 wxSizer* CreateTextSizer( const wxString &message );
214 wxSizer* CreateButtonSizer( long flags );
219 //---------------------------------------------------------------------------
221 class wxMiniFrame : public wxFrame {
223 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
224 const wxPoint& pos = wxDefaultPosition,
225 const wxSize& size = wxDefaultSize,
226 long style = wxDEFAULT_FRAME_STYLE,
227 const wxString& name = wxPyFrameNameStr);
228 %name(wxPreMiniFrame)wxMiniFrame();
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,
234 const wxString& name = wxPyFrameNameStr);
236 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
237 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
241 //---------------------------------------------------------------------------
244 wxSPLASH_CENTRE_ON_PARENT,
245 wxSPLASH_CENTRE_ON_SCREEN,
252 class wxSplashScreenWindow: public wxWindow
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);
261 void SetBitmap(const wxBitmap& bitmap);
262 wxBitmap& GetBitmap();
266 class wxSplashScreen : public wxFrame {
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);
274 long GetSplashStyle() const;
275 wxSplashScreenWindow* GetSplashWindow() const;
276 int GetTimeout() const;
280 //---------------------------------------------------------------------------