newntui/discovermdi/src/dockablebrowser.cpp
//-----------------------------------------------------------------------------------------
// This private function will analyse the categories list with {} and will form 
// category reuest command saving it in m_CategoryRequest member string.
//-----------------------------------------------------------------------------------------
This private function will analyse the categories list with {} and will form
category reuest command saving it in m_CategoryRequest member string.
This private function will analyse the categories list with {} and will form category reuest command saving it in m_CategoryRequest member string .
void CDockableBrowser::FormCategoryRequest(CString& categoriesList) {
register i;
CString oneQuery;
CString category;
   CCategoriesCombo*      Category;
   Category=(CCategoriesCombo*) GetDlgItem(IDC_CATEGORIES);
   if(categoriesList.GetLength()==0) {
       m_CategoryRequest="";
	   return;
   }
   BOOL first = TRUE;
   i=0;
   while(categoriesList[i]==' ') i++;
   for(;i<categoriesList.GetLength();i++) {
      if(categoriesList[i]=='{') {
	     category="";
		 continue;
	  }
	  if(categoriesList[i]=='}'){
	     oneQuery = Category->AccessFromName(category);
		 if(first==TRUE) {
		    m_CategoryRequest=oneQuery;
			first=FALSE;
		 } else {
			int pos = oneQuery.Find('-');
			if(pos!=-1) {
				m_CategoryRequest+=' ';
				m_CategoryRequest+=oneQuery.GetBuffer(2)+pos;
			}
		 }
		 continue;
	  }
	  category+=categoriesList[i];
   } 
 }
void CDockableBrowser :: FormCategoryRequest ( CString & categoriesList ) { register i ; CString oneQuery ; CString category ; CCategoriesCombo * Category ; Category = ( CCategoriesCombo * ) GetDlgItem ( IDC_CATEGORIES ) ; if ( categoriesList . GetLength ( ) == 0 ) { m_CategoryRequest = " " ; return ; } BOOL first = TRUE ; i = 0 ; while ( categoriesList [ i ] == ' ' ) i ++ ; for ( ; i < categoriesList . GetLength ( ) ; i ++ ) { if ( categoriesList [ i ] == ' ' ) { category = " " ; continue ; } if ( categoriesList [ i ] == ' ' ) { oneQuery = Category -> AccessFromName ( category ) ; if ( first == TRUE ) { m_CategoryRequest = oneQuery ; first = FALSE ; } else { int pos = oneQuery . Find ( ' ' ) ; if ( pos != -1 ) { m_CategoryRequest += ' ' ; m_CategoryRequest += oneQuery . GetBuffer ( 2 ) + pos ; } } continue ; } category += categoriesList [ i ] ; } }
This private function will analyse the categories list with {} and will form
category reuest command saving it in m_CategoryRequest member string.
This private function will analyse the categories list with {} and will form category reuest command saving it in m_CategoryRequest member string .
// Forming the complex command with multiple categories // from the {} separated categories list. // will return the Access equivalent to the readable category name