X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b68dc582b8c6dd32ef9f0a4ec91573bd5cc0296a..9f4de6b2cf06f53a98b28f53640f3b9ec8cf4182:/wxPython/src/frames.i diff --git a/wxPython/src/frames.i b/wxPython/src/frames.i index 62e49013c8..54f664cb17 100644 --- a/wxPython/src/frames.i +++ b/wxPython/src/frames.i @@ -16,6 +16,7 @@ %{ #include "helpers.h" #include +#include %} //---------------------------------------------------------------------- @@ -34,62 +35,189 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FrameNameStr); + DECLARE_DEF_STRING(DialogNameStr); + DECLARE_DEF_STRING(StatusLineNameStr); + DECLARE_DEF_STRING(ToolBarNameStr); +%} + +//---------------------------------------------------------------------- + enum { wxFULLSCREEN_NOMENUBAR, wxFULLSCREEN_NOTOOLBAR, wxFULLSCREEN_NOSTATUSBAR, wxFULLSCREEN_NOBORDER, wxFULLSCREEN_NOCAPTION, - wxFULLSCREEN_ALL + wxFULLSCREEN_ALL, + + wxTOPLEVEL_EX_DIALOG, }; -class wxFrame : public wxWindow { +//---------------------------------------------------------------------- + + +class wxTopLevelWindow : public wxWindow +{ +public: + // construction + wxTopLevelWindow(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxPyFrameNameStr); + %name(wxPreTopLevelWindow)wxTopLevelWindow(); + + bool Create(wxWindow *parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxPyFrameNameStr); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)" + + // maximize = TRUE => maximize, otherwise - restore + virtual void Maximize(bool maximize = TRUE); + + // undo Maximize() or Iconize() + virtual void Restore(); + + // iconize = TRUE => iconize, otherwise - restore + virtual void Iconize(bool iconize = TRUE); + + // return TRUE if the frame is maximized + virtual bool IsMaximized() const; + + // return TRUE if the frame is iconized + virtual bool IsIconized() const; + + // get the frame icon + wxIcon GetIcon() const; + + // set the frame icon + virtual void SetIcon(const wxIcon& icon); + + // set the frame icons + virtual void SetIcons(const wxIconBundle& icons ); + + // maximize the window to cover entire screen + virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); + + // return TRUE if the frame is in fullscreen mode + virtual bool IsFullScreen() const; + + virtual void SetTitle(const wxString& title); + virtual wxString GetTitle() const; +}; + +//---------------------------------------------------------------------- + + +class wxFrame : public wxTopLevelWindow { public: wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); + %name(wxPreFrame)wxFrame(); + + bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxPyFrameNameStr); - %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" - void Centre(int direction = wxBOTH); + wxPoint GetClientAreaOrigin(); + + void SetMenuBar(wxMenuBar *menubar); + wxMenuBar *GetMenuBar(); + + + // call this to simulate a menu command + bool Command(int id); + + // process menu command: returns TRUE if processed + bool ProcessCommand(int id); + + // create the main status bar wxStatusBar* CreateStatusBar(int number = 1, long style = wxST_SIZEGRIP, wxWindowID id = -1, - char* name = "statusBar"); - wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT, - wxWindowID id = -1, - char* name = "toolBar"); - - const wxIcon& GetIcon(); - wxMenuBar* GetMenuBar(); - wxStatusBar* GetStatusBar(); - wxString GetTitle(); - wxToolBar* GetToolBar(); - void Iconize(bool iconize); - bool IsIconized(); - void Maximize(bool maximize); - bool IsMaximized(); - void Restore(); - void SetAcceleratorTable(const wxAcceleratorTable& accel); - void SetIcon(const wxIcon& icon); - void SetMenuBar(wxMenuBar* menuBar); - void SetStatusBar(wxStatusBar *statusBar); - void SetStatusText(const wxString& text, int number = 0); - void SetStatusWidths(int LCOUNT, int* choices); // uses typemap - void SetTitle(const wxString& title); - void SetToolBar(wxToolBar* toolbar); - void MakeModal(bool modal = TRUE); - wxPoint GetClientAreaOrigin() const; - bool Command(int id); - bool ProcessCommand(int id); -#ifdef __WXMSW__ - bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); -#endif + const wxString& name = wxPyStatusLineNameStr); + + // get the main status bar + wxStatusBar *GetStatusBar(); + + // sets the main status bar + void SetStatusBar(wxStatusBar *statBar); + + // forward these to status bar + virtual void SetStatusText(const wxString &text, int number = 0); + virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap + + + // create main toolbar + virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, + wxWindowID id = -1, + const wxString& name = wxPyToolBarNameStr); + + // get/set the main toolbar + virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } + virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } + }; +//--------------------------------------------------------------------------- + +class wxDialog : public wxTopLevelWindow { +public: + wxDialog(wxWindow* parent, + const wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE, + const wxString& name = wxPyDialogNameStr); + %name(wxPreDialog)wxDialog(); + + bool Create(wxWindow* parent, + const wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE, + const wxString& name = wxPyDialogNameStr); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" + + void Centre(int direction = wxBOTH); + void EndModal(int retCode); + void SetModal(bool flag); + bool IsModal(); + int ShowModal(); + + int GetReturnCode(); + void SetReturnCode(int retCode); + + wxSizer* CreateTextSizer( const wxString &message ); + wxSizer* CreateButtonSizer( long flags ); + +}; + + //--------------------------------------------------------------------------- class wxMiniFrame : public wxFrame { @@ -98,9 +226,60 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); + %name(wxPreMiniFrame)wxMiniFrame(); - %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)" + bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxPyFrameNameStr); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" +}; + + +//--------------------------------------------------------------------------- + +enum { + wxSPLASH_CENTRE_ON_PARENT, + wxSPLASH_CENTRE_ON_SCREEN, + wxSPLASH_NO_CENTRE, + wxSPLASH_TIMEOUT, + wxSPLASH_NO_TIMEOUT, +}; + + +class wxSplashScreenWindow: public wxWindow +{ +public: + wxSplashScreenWindow(const wxBitmap& bitmap, + wxWindow* parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxNO_BORDER); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + + void SetBitmap(const wxBitmap& bitmap); + wxBitmap& GetBitmap(); +}; + + +class wxSplashScreen : public wxFrame { +public: + wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, + wxWindow* parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + + long GetSplashStyle() const; + wxSplashScreenWindow* GetSplashWindow() const; + int GetTimeout() const; }; @@ -110,3 +289,4 @@ public: +