X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..ae5aafdc71da118d56fcd9f2d9252e94acb8d05c:/wxPython/src/_notebook.i diff --git a/wxPython/src/_notebook.i b/wxPython/src/_notebook.i index e150afc6cc..e058b6e9bf 100644 --- a/wxPython/src/_notebook.i +++ b/wxPython/src/_notebook.i @@ -15,15 +15,15 @@ //--------------------------------------------------------------------------- -%{ - DECLARE_DEF_STRING(NOTEBOOK_NAME); -%} +MAKE_CONST_WXSTRING(NOTEBOOK_NAME); //--------------------------------------------------------------------------- %newgroup // TODO: Virtualize this class so other book controls can be derived in Python +MustHaveApp(wxBookCtrl); + // Common base class for wxList/Tree/Notebook class wxBookCtrl : public wxControl { @@ -66,8 +66,9 @@ public: virtual void SetImageList(wxImageList *imageList); // as SetImageList() but we will delete the image list ourselves - %addtofunc AssignImageList "args[1].thisown = 0" + %apply SWIGTYPE *DISOWN { wxImageList *imageList }; void AssignImageList(wxImageList *imageList); + %clear wxImageList *imageList; // get pointer (may be NULL) to the associated image list wxImageList* GetImageList() const; @@ -97,14 +98,14 @@ public: // adds a new page to the control virtual bool AddPage(wxWindow *page, const wxString& text, - bool select = false, + bool select = False, int imageId = -1); // the same as AddPage(), but adds the page at the specified position virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text, - bool select = false, + bool select = False, int imageId = -1)/* = 0*/; // set the currently selected page, return the index of the previously @@ -115,7 +116,10 @@ public: // cycle thru the pages - void AdvanceSelection(bool forward = true); + void AdvanceSelection(bool forward = True); + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); }; @@ -158,21 +162,27 @@ enum { +MustHaveApp(wxNotebook); + class wxNotebook : public wxBookCtrl { public: - %addtofunc wxNotebook "self._setOORInfo(self)" - %addtofunc wxNotebook() "" + %pythonAppend wxNotebook "self._setOORInfo(self)" + %pythonAppend wxNotebook() "" + %typemap(out) wxNotebook*; // turn off this typemap wxNotebook(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyNOTEBOOK_NAME); %name(PreNotebook)wxNotebook(); + // Turn it back on again + %typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -191,7 +201,11 @@ public: // hit test, returns which tab is hit and, optionally, where (icon, label) // (not implemented on all platforms) - virtual int HitTest(const wxPoint& pt, long* OUTPUT) const; + DocDeclAStr( + virtual int, HitTest(const wxPoint& pt, long* OUTPUT) const, + "HitTest(Point pt) -> (tab, where)", + "Returns the tab which is hit, and flags indicating where using +wx.NB_HITTEST flags.", ""); // implement some base class functions virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; @@ -200,6 +214,9 @@ public: // Windows only: attempts to apply the UX theme page background to this page void ApplyThemeBackground(wxWindow* window, const wxColour& colour); #endif + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); }; @@ -277,15 +294,17 @@ enum +MustHaveApp(wxListbook); + // wxListCtrl and wxNotebook combination class wxListbook : public wxBookCtrl { public: - %addtofunc wxListbook "self._setOORInfo(self)" - %addtofunc wxListbook() "" + %pythonAppend wxListbook "self._setOORInfo(self)" + %pythonAppend wxListbook() "" wxListbook(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -293,13 +312,13 @@ public: %name(PreListbook)wxListbook(); bool Create(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPyEmptyString); - // returns true if we have wxLB_TOP or wxLB_BOTTOM style + // returns True if we have wxLB_TOP or wxLB_BOTTOM style bool IsVertical() const; }; @@ -330,7 +349,7 @@ public: class wxBookCtrlSizer: public wxSizer { public: - %addtofunc wxBookCtrlSizer "self._setOORInfo(self)" + %pythonAppend wxBookCtrlSizer "self._setOORInfo(self)" wxBookCtrlSizer( wxBookCtrl *nb ); @@ -342,7 +361,7 @@ public: class wxNotebookSizer: public wxSizer { public: - %addtofunc wxNotebookSizer "self._setOORInfo(self)" + %pythonAppend wxNotebookSizer "self._setOORInfo(self)" wxNotebookSizer( wxNotebook *nb );