newntui/discovermdi/src/dockablebrowser.cpp
//-----------------------------------------------------------------------------------------
// This function will inspect current selection and will form the kinds list.
//-----------------------------------------------------------------------------------------
This function will inspect current selection and will form the kinds list.
This function will inspect current selection and will form the kinds list .
void CDockableBrowser::FillKindList(void) {
CString kinds;
CString kindName;
       m_KindList.RemoveAll();
       kinds = ExecuteCommand(CString("apply kind $DiscoverSelection"));
	   BOOL in=FALSE;
	   for(register i=0;i<kinds.GetLength();i++) {
		   if(kinds[i]=='{') {
			   in=TRUE;
			   continue;
		   }
		   if( (kinds[i]=='}' && in==TRUE) || (kinds[i]==' ' && in==FALSE)) {
			   kindName.TrimLeft();
			   kindName.TrimRight();
			   if(kindName.GetLength()>0) {
			      m_KindList.AddTail(kindName);
			      kindName="";
			   }
			   in=FALSE;
			   continue;
		   }
		   kindName+=kinds[i];
	   }
	   kindName.TrimLeft();
	   kindName.TrimRight();
	   if(kindName.GetLength()>0)  m_KindList.AddTail(kindName);
}
void CDockableBrowser :: FillKindList ( void ) { CString kinds ; CString kindName ; m_KindList . RemoveAll ( ) ; kinds = ExecuteCommand ( CString ( " " ) ) ; BOOL in = FALSE ; for ( register i = 0 ; i < kinds . GetLength ( ) ; i ++ ) { if ( kinds [ i ] == ' ' ) { in = TRUE ; continue ; } if ( ( kinds [ i ] == ' ' && in == TRUE ) || ( kinds [ i ] == ' ' && in == FALSE ) ) { kindName . TrimLeft ( ) ; kindName . TrimRight ( ) ; if ( kindName . GetLength ( ) > 0 ) { m_KindList . AddTail ( kindName ) ; kindName = " " ; } in = FALSE ; continue ; } kindName += kinds [ i ] ; } kindName . TrimLeft ( ) ; kindName . TrimRight ( ) ; if ( kindName . GetLength ( ) > 0 ) m_KindList . AddTail ( kindName ) ; }
This function will inspect current selection and will form the kinds list.
This function will inspect current selection and will form the kinds list .