git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-03-24 16:02:42 +00:00
parent 8fb34454e4
commit 39d496f99f
2 changed files with 29 additions and 17 deletions

View File

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

View File

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