IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxBookCtrlBase)
IMPLEMENT_DYNAMIC_CLASS(wxTreebookEvent, wxNotifyEvent)
+#if !WXWIN_COMPATIBILITY_EVENT_TYPES
const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxNewEventType();
const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wxNewEventType();
const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED = wxNewEventType();
const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED = wxNewEventType();
+#endif
const int wxID_TREEBOOKTREEVIEW = wxNewId();
BEGIN_EVENT_TABLE(wxTreebook, wxBookCtrlBase)
return DoInsertPage(pagePos, page, text, bSelect, imageId);
}
-bool wxTreebook::AddSubPage(size_t pagePos,
- wxWindow *page,
- const wxString& text,
- bool bSelect,
- int imageId)
+bool wxTreebook::InsertSubPage(size_t pagePos,
+ wxWindow *page,
+ const wxString& text,
+ bool bSelect,
+ int imageId)
{
return DoInsertSubPage(pagePos, page, text, bSelect, imageId);
}
DoUpdateSelection(bSelect, pagePos);
- m_bookctrl->InvalidateBestSize();
-
return true;
}
DoUpdateSelection(bSelect, newPos);
- m_bookctrl->InvalidateBestSize();
-
return true;
}
tree->DeleteChildren( pageId );
tree->Delete( pageId );
- tree->InvalidateBestSize();
return oldPage;
}
// find the next page suitable to be shown: the first (grand)child
// of this one with a non-NULL associated page
wxTreeItemId childId = m_treeIds[pagePos];
- m_actualSelection = pagePos;
+ int actualPagePos = pagePos;
while ( !page && childId.IsOk() )
{
wxTreeItemIdValue cookie;
childId = tree->GetFirstChild( childId, cookie );
if ( childId.IsOk() )
{
- page = wxBookCtrlBase::GetPage(++m_actualSelection);
+ page = wxBookCtrlBase::GetPage(++actualPagePos);
}
}
- wxASSERT_MSG( page, wxT("no page to show found!") );
+ m_actualSelection = page ? actualPagePos : m_selection;
}
if ( page )
- {
- page->SetSize(GetPageRect());
page->Show();
- }
tree->SelectItem(DoInternalGetPage(pagePos));