X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d6fcbcc7088e9c104b3dc5b4704a07f728d55ae..f262b25c93c89d2f2bd0b388bac293c8969a2d72:/src/generic/toolbkg.cpp diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index fbfbd0b0bc..0b87be4bc7 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -50,7 +50,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolbookEvent, wxNotifyEvent) const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wxNewEventType(); const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wxNewEventType(); #endif -const int wxID_TOOLBOOKTOOLBAR = wxNewId(); BEGIN_EVENT_TABLE(wxToolbook, wxBookCtrlBase) EVT_SIZE(wxToolbook::OnSize) @@ -102,7 +101,7 @@ bool wxToolbook::Create(wxWindow *parent, m_bookctrl = new wxButtonToolBar ( this, - wxID_TOOLBOOKTOOLBAR, + wxID_ANY, wxDefaultPosition, wxDefaultSize, orient|wxTB_TEXT|wxTB_FLAT|wxNO_BORDER @@ -114,7 +113,7 @@ bool wxToolbook::Create(wxWindow *parent, m_bookctrl = new wxToolBar ( this, - wxID_TOOLBOOKTOOLBAR, + wxID_ANY, wxDefaultPosition, wxDefaultSize, orient|wxTB_TEXT|wxTB_FLAT|wxTB_NODIVIDER|wxNO_BORDER @@ -245,10 +244,20 @@ int wxToolbook::GetSelection() const return m_selection; } -int wxToolbook::DoSetSelection(size_t n, int flags) +wxBookCtrlBaseEvent* wxToolbook::CreatePageChangingEvent() const { - wxToolbookEvent event(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, m_windowId); - return wxBookCtrlBase::DoSetSelection(n, flags, event); + return new wxToolbookEvent(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, m_windowId); +} + +void wxToolbook::MakeChangedEvent(wxBookCtrlBaseEvent &event) +{ + event.SetEventType(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED); +} + +void wxToolbook::UpdateSelectedPage(size_t newsel) +{ + m_selection = newsel; + GetToolBar()->ToggleTool(newsel + 1, true); } // Not part of the wxBookctrl API, but must be called in OnIdle or