| 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" |
| 18 | #include <wx/minifram.h> |
| 19 | #include <wx/splash.h> |
| 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 | |
| 34 | %pragma(python) code = "import wx" |
| 35 | |
| 36 | //---------------------------------------------------------------------- |
| 37 | |
| 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 | |
| 48 | enum { |
| 49 | wxFULLSCREEN_NOMENUBAR, |
| 50 | wxFULLSCREEN_NOTOOLBAR, |
| 51 | wxFULLSCREEN_NOSTATUSBAR, |
| 52 | wxFULLSCREEN_NOBORDER, |
| 53 | wxFULLSCREEN_NOCAPTION, |
| 54 | wxFULLSCREEN_ALL, |
| 55 | |
| 56 | wxTOPLEVEL_EX_DIALOG, |
| 57 | }; |
| 58 | |
| 59 | |
| 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, |
| 73 | const wxString& name = wxPyFrameNameStr); |
| 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, |
| 82 | const wxString& name = wxPyFrameNameStr); |
| 83 | |
| 84 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
| 85 | %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)" |
| 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 |
| 103 | wxIcon GetIcon() const; |
| 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 | |
| 122 | class wxFrame : public wxTopLevelWindow { |
| 123 | public: |
| 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(); |
| 130 | |
| 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); |
| 136 | |
| 137 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
| 138 | %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" |
| 139 | |
| 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 |
| 153 | wxStatusBar* CreateStatusBar(int number = 1, |
| 154 | long style = wxST_SIZEGRIP, |
| 155 | wxWindowID id = -1, |
| 156 | const wxString& name = wxPyStatusLineNameStr); |
| 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, |
| 172 | const wxString& name = wxPyToolBarNameStr); |
| 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 | |
| 178 | }; |
| 179 | |
| 180 | //--------------------------------------------------------------------------- |
| 181 | |
| 182 | class wxDialog : public wxTopLevelWindow { |
| 183 | public: |
| 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, |
| 190 | const wxString& name = wxPyDialogNameStr); |
| 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, |
| 199 | const wxString& name = wxPyDialogNameStr); |
| 200 | |
| 201 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
| 202 | %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" |
| 203 | |
| 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 | |
| 219 | //--------------------------------------------------------------------------- |
| 220 | |
| 221 | class wxMiniFrame : public wxFrame { |
| 222 | public: |
| 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(); |
| 229 | |
| 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); |
| 235 | |
| 236 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
| 237 | %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" |
| 238 | }; |
| 239 | |
| 240 | |
| 241 | //--------------------------------------------------------------------------- |
| 242 | |
| 243 | enum { |
| 244 | wxSPLASH_CENTRE_ON_PARENT, |
| 245 | wxSPLASH_CENTRE_ON_SCREEN, |
| 246 | wxSPLASH_NO_CENTRE, |
| 247 | wxSPLASH_TIMEOUT, |
| 248 | wxSPLASH_NO_TIMEOUT, |
| 249 | }; |
| 250 | |
| 251 | |
| 252 | class wxSplashScreenWindow: public wxWindow |
| 253 | { |
| 254 | public: |
| 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 | |
| 266 | class wxSplashScreen : public wxFrame { |
| 267 | public: |
| 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 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |