X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8dda225b3fcb6ac8c0860b2e81dba37862adbed..9e477492e29e03c02827b1e42a16cb09a13f5149:/wxPython/src/_notebook.i diff --git a/wxPython/src/_notebook.i b/wxPython/src/_notebook.i index 26b9486eed..703c7718c6 100644 --- a/wxPython/src/_notebook.i +++ b/wxPython/src/_notebook.i @@ -27,7 +27,15 @@ enum { wxBK_BOTTOM, wxBK_LEFT, wxBK_RIGHT, - wxBK_ALIGN_MASK + wxBK_ALIGN_MASK, + wxBK_BUTTONBAR, + + // hittest flags + wxBK_HITTEST_NOWHERE = 1, // not on tab + wxBK_HITTEST_ONICON = 2, // on icon + wxBK_HITTEST_ONLABEL = 4, // on label + wxBK_HITTEST_ONITEM = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL, + wxBK_HITTEST_ONPAGE = 8, // not on tab control, but over the selected page }; @@ -100,16 +108,23 @@ public: // get/set size of area between book control area and page area - size_t GetInternalBorder() const; - void SetInternalBorder(size_t internalBorder); + unsigned int GetInternalBorder() const; + void SetInternalBorder(unsigned int internalBorder); // returns true if we have wxCHB_TOP or wxCHB_BOTTOM style bool IsVertical() const; + // Sets/gets the margin around the controller + void SetControlMargin(int margin); + int GetControlMargin() const; + // set/get option to shrink to fit current page void SetFitToCurrentPage(bool fit); bool GetFitToCurrentPage() const; + // returns the sizer containing the control, if any + wxSizer* GetControlSizer() const; + // remove one page from the control and delete it virtual bool DeletePage(size_t n); @@ -139,12 +154,34 @@ public: // NB: this function will _not_ generate PAGE_CHANGING/ED events virtual int SetSelection(size_t n)/* = 0*/; + + // acts as SetSelection but does not generate events + virtual int ChangeSelection(size_t n)/* = 0*/; // cycle thru the pages void AdvanceSelection(bool forward = true); + DocDeclAStr( + virtual int, HitTest(const wxPoint& pt, long* OUTPUT) const, + "HitTest(Point pt) -> (tab, where)", + "Returns the page/tab which is hit, and flags indicating where using +wx.NB_HITTEST flags.", ""); + static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(ControlMargin, GetControlMargin, SetControlMargin, doc="See `GetControlMargin` and `SetControlMargin`"); + %property(ControlSizer, GetControlSizer, doc="See `GetControlSizer`"); + %property(CurrentPage, GetCurrentPage, doc="See `GetCurrentPage`"); + %property(FitToCurrentPage, GetFitToCurrentPage, SetFitToCurrentPage, doc="See `GetFitToCurrentPage` and `SetFitToCurrentPage`"); + %property(ImageList, GetImageList, SetImageList, doc="See `GetImageList` and `SetImageList`"); + %property(InternalBorder, GetInternalBorder, SetInternalBorder, doc="See `GetInternalBorder` and `SetInternalBorder`"); + %property(Page, GetPage, doc="See `GetPage`"); + %property(PageCount, GetPageCount, doc="See `GetPageCount`"); + %property(PageImage, GetPageImage, SetPageImage, doc="See `GetPageImage` and `SetPageImage`"); + %property(PageText, GetPageText, SetPageText, doc="See `GetPageText` and `SetPageText`"); + %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`"); + }; @@ -161,6 +198,10 @@ public: // the page that was selected before the change (-1 if none) int GetOldSelection() const; void SetOldSelection(int nOldSel); + + %property(OldSelection, GetOldSelection, SetOldSelection, doc="See `GetOldSelection` and `SetOldSelection`"); + %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`"); + }; @@ -178,12 +219,12 @@ enum { wxNB_MULTILINE, wxNB_NOPAGETHEME, - // hittest flags - wxNB_HITTEST_NOWHERE = 1, // not on tab - wxNB_HITTEST_ONICON = 2, // on icon - wxNB_HITTEST_ONLABEL = 4, // on label - wxNB_HITTEST_ONITEM = wxNB_HITTEST_ONICON | wxNB_HITTEST_ONLABEL, - + // for backwards compatibility only + wxNB_HITTEST_NOWHERE, + wxNB_HITTEST_ONICON, + wxNB_HITTEST_ONLABEL, + wxNB_HITTEST_ONITEM, + wxNB_HITTEST_ONPAGE, }; @@ -225,14 +266,6 @@ public: // set the size of the tabs for wxNB_FIXEDWIDTH controls virtual void SetTabSize(const wxSize& sz); - // hit test, returns which tab is hit and, optionally, where (icon, label) - // (not implemented on all platforms) - 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; @@ -242,6 +275,16 @@ wx.NB_HITTEST flags.", ""); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + // returns false if the change to nPage is vetoed by the program + bool SendPageChangingEvent(int nPage); + + // sends the event about page change from old to new (or GetSelection() if + // new is -1) + void SendPageChangedEvent(int nPageOld, int nPageNew = -1); + + %property(RowCount, GetRowCount, doc="See `GetRowCount`"); + %property(ThemeBackgroundColour, GetThemeBackgroundColour, doc="See `GetThemeBackgroundColour`"); }; @@ -344,6 +387,7 @@ public: const wxString& name = wxPyEmptyString); wxListView* GetListView(); + %property(ListView, GetListView, doc="See `GetListView`"); }; @@ -410,6 +454,9 @@ public: wxChoice* GetChoiceCtrl() const; virtual bool DeleteAllPages(); + + %property(ChoiceCtrl, GetChoiceCtrl, doc="See `GetChoiceCtrl`"); + }; @@ -516,8 +563,9 @@ public: int GetPageParent(size_t pos) const; // the tree control we use for showing the pages index tree - wxTreeCtrl* GetTreeCtrl() const; + wxPyTreeCtrl* GetTreeCtrl() const; + %property(TreeCtrl, GetTreeCtrl, doc="See `GetTreeCtrl`"); }; @@ -577,6 +625,8 @@ public: // Not part of the wxBookctrl API, but must be called in OnIdle or // by application to realize the toolbar and select the initial page. void Realize(); + + %property(ToolBar, GetToolBar, doc="See `GetToolBar`"); };