void PanelList::Mark( const unicode_t* mask, bool enable ) { int n = listCount; PanelCounter counter; for ( int i = 0; i < n; i++ ) { FSNode* p = list[i]; if ( !p ) { continue; } bool ok = accmask( p->GetUnicodeName(), mask ); if ( ok ) { if ( enable ) { p->SetSelected(); } else { p->ClearSelected(); } } if ( p->IsSelected() ) { counter.AddOne( p->Size() ); } } selectedCn = counter; }
void PanelList::ShiftSelection( int n, int* selectType, bool RootDir ) { FSNode* p = NULL; if ( RootDir ) { if ( n < 0 || n >= listCount ) { return; } p = list[n]; } else { if ( n <= 0 || n > listCount ) { return; } p = list[n - 1]; } if ( !p ) { return; } if ( *selectType < 0 ) //not defined { *selectType = p->IsSelected() ? 0 : 1; } bool sel = ( *selectType > 0 ); if ( sel == p->IsSelected() ) { return; } if ( sel ) { p->SetSelected(); selectedCn.AddOne( p->Size() ); } else { p->ClearSelected(); selectedCn.SubOne( p->Size() ); } }