From 39d496f99ffb0f2d2d599d4205626886fa47a6a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 24 Mar 2000 16:02:42 +0000 Subject: [PATCH] include git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/object.cpp | 10 ---------- src/generic/treectrl.cpp | 36 +++++++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/common/object.cpp b/src/common/object.cpp index 566fa38ff9..00dfc6aa72 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -197,16 +197,6 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info) const if (info == NULL) return FALSE; - // For some reason, when making/using a DLL, static data has to be included - // in both the DLL and the application. This can lead to duplicate - // wxClassInfo objects, so we have to test the name instead of the pointers. - // PROBABLY NO LONGER TRUE now I've done DLL creation right. - /* -#if WXMAKINGDLL -if (GetClassName() && info->GetClassName() && (wxStrcmp(GetClassName(), info->GetClassName()) == 0)) -return TRUE; -#else - */ if (this == info) return TRUE; diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index b4bf898049..7daf6eb98b 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -1126,6 +1126,8 @@ void wxTreeCtrl::Expand(const wxTreeItemId& itemId) { wxGenericTreeItem *item = itemId.m_pItem; + wxCHECK_RET( item, _T("invalid item in wxTreeCtrl::Expand") ); + if ( !item->HasPlus() ) return; @@ -1136,7 +1138,6 @@ void wxTreeCtrl::Expand(const wxTreeItemId& itemId) event.m_item = item; event.SetEventObject( this ); -// if ( ProcessEvent( event ) && event.m_code ) TODO: Was this a typo ? if ( ProcessEvent( event ) && !event.IsAllowed() ) { // cancelled by program @@ -1152,6 +1153,22 @@ void wxTreeCtrl::Expand(const wxTreeItemId& itemId) ProcessEvent( event ); } +void wxTreeCtrl::ExpandAll(const wxTreeItemId& item) +{ + Expand(item); + if ( IsExpanded(item) ) + { + long cookie; + wxTreeItemId child = GetFirstChild(item, cookie); + while ( child.IsOk() ) + { + ExpandAll(child); + + child = GetNextChild(item, cookie); + } + } +} + void wxTreeCtrl::Collapse(const wxTreeItemId& itemId) { wxGenericTreeItem *item = itemId.m_pItem; @@ -1866,7 +1883,7 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event ) // + : Expand // - : Collaspe - // * : Toggle Expand/Collapse + // * : Expand all/Collapse all // ' ' | return : activate // up : go up (not last children!) // down : go down @@ -1884,6 +1901,16 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event ) } break; + case '*': + case WXK_MULTIPLY: + if ( !IsExpanded(m_current) ) + { + // expand all + ExpandAll(m_current); + break; + } + //else: fall through to Collapse() it + case '-': case WXK_SUBTRACT: if (IsExpanded(m_current)) @@ -1892,11 +1919,6 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event ) } break; - case '*': - case WXK_MULTIPLY: - Toggle(m_current); - break; - case ' ': case WXK_RETURN: {