added wxBookCtrl::ChangeSelection() which is the same as SetSelection() but doesn't send the page change events (second part of patch 1553551)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-10-08 17:37:23 +00:00
parent 982a44cc9f
commit 1d6fcbcc70
30 changed files with 447 additions and 224 deletions

View File

@@ -20,6 +20,10 @@
class WXDLLEXPORT wxChoice;
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED;
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING;
// ----------------------------------------------------------------------------
// wxChoicebook
// ----------------------------------------------------------------------------
@@ -64,7 +68,8 @@ public:
const wxString& text,
bool bSelect = false,
int imageId = -1);
virtual int SetSelection(size_t n);
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList);
virtual bool DeleteAllPages();
@@ -78,6 +83,19 @@ protected:
// get the size which the choice control should have
virtual wxSize GetControllerSize() const;
int DoSetSelection(size_t nPage, int flags = 0);
void UpdateSelectedPage(size_t newsel)
{
m_selection = newsel;
GetChoiceCtrl()->Select(newsel);
}
void MakeChangedEvent(wxBookCtrlBaseEvent &event)
{
event.SetEventType(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED);
}
// event handlers
void OnChoiceSelected(wxCommandEvent& event);
@@ -116,9 +134,6 @@ private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChoicebookEvent)
};
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED;
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING;
typedef void (wxEvtHandler::*wxChoicebookEventFunction)(wxChoicebookEvent&);
#define wxChoicebookEventHandler(func) \