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:
Vadim Zeitlin
2021-06-08 22:40:29 +02:00
parent fbe12789f6
commit 894861becb
2 changed files with 9 additions and 1 deletions

View File

@@ -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