static void ShowWnd(wxWindow* wnd, bool show)
{
#if wxUSE_MDI
- if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+ if (wxDynamicCast(wnd, wxAuiMDIChildFrame))
{
wxAuiMDIChildFrame* cf = (wxAuiMDIChildFrame*)wnd;
cf->DoShow(show);
// even if the tab is already active, because they may
// have multiple tab controls
if ((new_selection != GetActivePage() ||
- GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) && !m_hoverButton)
+ wxDynamicCast(GetParent(), wxAuiNotebook)) && !m_hoverButton)
{
wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId);
e.SetSelection(new_selection);
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
#if wxUSE_MDI
- if (page.window->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+ if (wxDynamicCast(page.window, wxAuiMDIChildFrame))
{
wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window;
wnd->ApplyMDIChildFrameRect();
#if wxUSE_MDI
// actually destroy the window now
- if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+ if (wxDynamicCast(wnd, wxAuiMDIChildFrame))
{
// delete the child frame with pending delete, as is
// customary with frame windows
return;
// make sure we are not over the hint window
- if (!tab_ctrl->IsKindOf(CLASSINFO(wxFrame)))
+ if (!wxDynamicCast(tab_ctrl, wxFrame))
{
while (tab_ctrl)
{
- if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl)))
+ if (wxDynamicCast(tab_ctrl, wxAuiTabCtrl))
break;
tab_ctrl = tab_ctrl->GetParent();
}
while (tab_ctrl)
{
- if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl)))
+ if (wxDynamicCast(tab_ctrl, wxAuiTabCtrl))
break;
tab_ctrl = tab_ctrl->GetParent();
}
#if wxUSE_MDI
- if (close_wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
+ if (wxDynamicCast(close_wnd, wxAuiMDIChildFrame))
{
close_wnd->Close();
}
return tabCtrlHeight + pageHeight + decorHeight;
}
-// Advances the selection, generation page selection events
-void wxAuiNotebook::AdvanceSelection(bool forward)
-{
- if (GetPageCount() <= 1)
- return;
-
- int currentSelection = GetSelection();
-
- if (forward)
- {
- if (currentSelection == (int) (GetPageCount() - 1))
- return;
- else if (currentSelection == -1)
- currentSelection = 0;
- else
- currentSelection ++;
- }
- else
- {
- if (currentSelection <= 0)
- return;
- else
- currentSelection --;
- }
-
- SetSelection(currentSelection);
-}
-
// Shows the window menu
bool wxAuiNotebook::ShowWindowMenu()
{
return SetPageBitmap(n, GetImageList()->GetBitmap(imageId));
}
-wxWindow* wxAuiNotebook::GetCurrentPage () const
-{
- const int sel = GetSelection();
-
- return sel == wxNOT_FOUND ? NULL : GetPage(sel);
-}
-
int wxAuiNotebook::ChangeSelection(size_t n)
{
return DoModifySelection(n, false);