Fix wxRTTI for wxAuiNotebook by deriving it from wxBookCtrlBase
Otherwise wxDynamicCast-ing wxAuiNotebook to wxBookCtrlBase didn't work (even if the more usual and useful upcast did still work). Add a unit test for this.
This commit is contained in:
@@ -53,7 +53,7 @@ wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_TAB_MIDDLE_DOWN, wxAuiNotebookEvent);
|
|||||||
wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebookEvent);
|
wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebookEvent);
|
||||||
wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebookEvent);
|
wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebookEvent);
|
||||||
|
|
||||||
wxIMPLEMENT_CLASS(wxAuiNotebook, wxControl);
|
wxIMPLEMENT_CLASS(wxAuiNotebook, wxBookCtrlBase);
|
||||||
wxIMPLEMENT_CLASS(wxAuiTabCtrl, wxControl);
|
wxIMPLEMENT_CLASS(wxAuiTabCtrl, wxControl);
|
||||||
wxIMPLEMENT_DYNAMIC_CLASS(wxAuiNotebookEvent, wxBookCtrlEvent);
|
wxIMPLEMENT_DYNAMIC_CLASS(wxAuiNotebookEvent, wxBookCtrlEvent);
|
||||||
|
|
||||||
|
@@ -143,4 +143,12 @@ TEST_CASE_METHOD(AuiNotebookTestCase, "wxAuiNotebook::DoGetBestSize", "[aui]")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_METHOD(AuiNotebookTestCase, "wxAuiNotebook::RTTI", "[aui][rtti]")
|
||||||
|
{
|
||||||
|
wxBookCtrlBase* const book = nb;
|
||||||
|
CHECK( wxDynamicCast(book, wxAuiNotebook) == nb );
|
||||||
|
|
||||||
|
CHECK( wxDynamicCast(nb, wxBookCtrlBase) == book );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user