- wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
- int nSel = -1, int nOldSel = -1)
- : wxNotifyEvent(commandType, id)
- {
- m_nSel = nSel;
- m_nOldSel = nOldSel;
- }
-
- // accessors
- // the currently selected page (-1 if none)
- int GetSelection() const { return m_nSel; }
- void SetSelection(int nSel) { m_nSel = nSel; }
- // the page that was selected before the change (-1 if none)
- int GetOldSelection() const { return m_nOldSel; }
- void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
-
-private:
- int m_nSel, // currently selected page
- m_nOldSel; // previously selected page
-
- DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
+ // ctors
+ // -----
+
+ wxNotebookBase() { }
+
+ // wxNotebook-specific additions to wxBookCtrlBase interface
+ // ---------------------------------------------------------
+
+ // get the number of rows for a control with wxNB_MULTILINE style (not all
+ // versions support it - they will always return 1 then)
+ virtual int GetRowCount() const { return 1; }
+
+ // set the padding between tabs (in pixels)
+ virtual void SetPadding(const wxSize& padding) = 0;
+
+ // set the size of the tabs for wxNB_FIXEDWIDTH controls
+ virtual void SetTabSize(const wxSize& sz) = 0;
+
+
+
+ // implement some base class functions
+ virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
+
+ // On platforms that support it, get the theme page background colour, else invalid colour
+ virtual wxColour GetThemeBackgroundColour() const { return wxNullColour; }
+
+
+ // send wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING/ED events
+
+ // 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);
+
+ // wxBookCtrlBase overrides this method to return false but we do need
+ // focus because we have tabs
+ virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); }
+
+protected:
+ wxDECLARE_NO_COPY_CLASS(wxNotebookBase);