X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4922c5f0dd5248dbf2b4e91dc1083d823a89cea0..6cab4fcac7fe26d9ae5a1d29066e0893d689bb38:/src/generic/choicbkg.cpp?ds=sidebyside diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index ccc51e049d..057071f96e 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -48,10 +48,9 @@ // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxChoicebookEvent, wxNotifyEvent) -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase) EVT_CHOICE(wxID_ANY, wxChoicebook::OnChoiceSelected) @@ -144,11 +143,15 @@ wxSize wxChoicebook::CalcSizeFromPage(const wxSize& sizePage) const wxSize size = sizePage; if ( IsVertical() ) { + if ( sizeChoice.x > sizePage.x ) + size.x = sizeChoice.x; size.y += sizeChoice.y + GetInternalBorder(); } else // left/right aligned { size.x += sizeChoice.x + GetInternalBorder(); + if ( sizeChoice.y > sizePage.y ) + size.y = sizeChoice.y; } return size; @@ -186,9 +189,16 @@ bool wxChoicebook::SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId)) } // ---------------------------------------------------------------------------- -// image list stuff +// miscellaneous other stuff // ---------------------------------------------------------------------------- +void wxChoicebook::DoSetWindowVariant(wxWindowVariant variant) +{ + wxCHECK_RET( m_bookctrl, "can't be called before control creation" ); + + m_bookctrl->SetWindowVariant(variant); +} + void wxChoicebook::SetImageList(wxImageList *imageList) { // TODO: can be implemented in form of static bitmap near choice control @@ -205,12 +215,12 @@ int wxChoicebook::GetSelection() const return m_selection; } -wxBookCtrlBaseEvent* wxChoicebook::CreatePageChangingEvent() const +wxBookCtrlEvent* wxChoicebook::CreatePageChangingEvent() const { - return new wxChoicebookEvent(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, m_windowId); + return new wxBookCtrlEvent(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, m_windowId); } -void wxChoicebook::MakeChangedEvent(wxBookCtrlBaseEvent &event) +void wxChoicebook::MakeChangedEvent(wxBookCtrlEvent &event) { event.SetEventType(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED); }