newntui/discovermdi/src/dockablebrowser.cpp
//-----------------------------------------------------------------------------------------
// Forms the complete query from the selected queries and selected project lists or 
// selection variable.
//-----------------------------------------------------------------------------------------
Forms the complete query from the selected queries and selected project lists or
selection variable.
Forms the complete query from the selected queries and selected project lists or selection variable .
void  CDockableBrowser::FormQueryRequest(CString& queriesList) {
register  i;
CString query;
CMainFrame* main=(CMainFrame*) AfxGetMainWnd();
    CQueriesCombo*      Query;
    Query=(CQueriesCombo*) GetDlgItem(IDC_QUERIES);
	m_QueryRequest="set tmp [nil_set];";
	i=0;
	queriesList.TrimLeft();
	for(;i<queriesList.GetLength();i++) {
	   if(queriesList[i]=='{') {
		  query="";
		  continue;
	   }
	   if(queriesList[i]=='}'){
		  CString oneQuery;
		  oneQuery = Query->AccessFromName(query);
		  CString merge;
		  if(main->m_SelectionSize>0) {
			  if(m_Closure==TRUE) {
		          merge.Format("sappend $tmp [query_closure 0 {%s} $DiscoverSelection];",oneQuery);
			  } else {
		          merge.Format("sappend $tmp [%s $DiscoverSelection];",oneQuery);
			  }
		  } else {
		      merge.Format("sappend $tmp [%s %s];",oneQuery,m_CurrentProject);
		  }
		  m_QueryRequest+=merge;
		  continue;			 
	   }
	   query+=queriesList[i];
	}
	query.Format("list $tmp");
	m_QueryRequest+=query;
}
void CDockableBrowser :: FormQueryRequest ( CString & queriesList ) { register i ; CString query ; CMainFrame * main = ( CMainFrame * ) AfxGetMainWnd ( ) ; CQueriesCombo * Query ; Query = ( CQueriesCombo * ) GetDlgItem ( IDC_QUERIES ) ; m_QueryRequest = " " ; i = 0 ; queriesList . TrimLeft ( ) ; for ( ; i < queriesList . GetLength ( ) ; i ++ ) { if ( queriesList [ i ] == ' ' ) { query = " " ; continue ; } if ( queriesList [ i ] == ' ' ) { CString oneQuery ; oneQuery = Query -> AccessFromName ( query ) ; CString merge ; if ( main -> m_SelectionSize > 0 ) { if ( m_Closure == TRUE ) { merge . Format ( " " , oneQuery ) ; } else { merge . Format ( " " , oneQuery ) ; } } else { merge . Format ( " " , oneQuery , m_CurrentProject ) ; } m_QueryRequest += merge ; continue ; } query += queriesList [ i ] ; } query . Format ( " " ) ; m_QueryRequest += query ; }
Forms the complete query from the selected queries and selected project lists or
selection variable.
Forms the complete query from the selected queries and selected project lists or selection variable .
// Forming the complex command with multiple queries // Query end. Forming the results command and adding it to the // summarized query. // Access command from the query name // Access appending command with the arguments // If argument variable is not set we will use projects list as an argument. // Results command