newntui/activex/groupscombo/src/groupscomboctl.cpp
//-------------------------------------------------------------------------------------
// This private function will fill the output variable which name is given in the
// m_OutputVariable member, if any, with the results of group operation or with the
// elements in the current group if only one group selected.
//-------------------------------------------------------------------------------------
This private function will fill the output variable which name is given in the
m_OutputVariable member, if any, with the results of group operation or with the
elements in the current group if only one group selected.
This private function will fill the output variable which name is given in the m_OutputVariable member if any with the results of group operation or with the elements in the current group if only one group selected .
void CGroupsComboCtrl::FillElementsList(void) {
CString serverQuery;
    if(m_OutputVar.GetLength()==0) return;
    EvaluateSync(CString("group tmp __distmp__"));
    if((m_ControlsEnable==FALSE) || (m_OpTools.IsButtonChecked(IDB_ALL)!=0)) {
		MakeGroupsConcat(CString("__distmp__"));
    } else { 
        if(m_OpTools.IsButtonChecked(IDB_INTERSECT)!=0) {
		   MakeGroupsConcat(CString("__distmp__"));
		   MakeGroupsIntersect(CString("__distmp__"));
		} else { 
           if(m_OpTools.IsButtonChecked(IDB_DIFF)!=0) {
			   MakeGroupsConcat(CString("__distmp__"));
               EvaluateSync(CString("group tmp __distmp1__"));
               EvaluateSync(CString("group set __distmp1__ __distmp__"));
			   MakeGroupsIntersect(CString("__distmp1__"));
               EvaluateSync(CString("group subtract __distmp__ __distmp1__"));
	           EvaluateSync(CString("group delete __distmp1__"));
		   } 
		}
	}
	serverQuery.Format("set %s [group get __distmp__]",m_OutputVar);
	EvaluateSync(serverQuery);
	EvaluateSync(CString("group delete __distmp__"));
}
void CGroupsComboCtrl :: FillElementsList ( void ) { CString serverQuery ; if ( m_OutputVar . GetLength ( ) == 0 ) return ; EvaluateSync ( CString ( " " ) ) ; if ( ( m_ControlsEnable == FALSE ) || ( m_OpTools . IsButtonChecked ( IDB_ALL ) != 0 ) ) { MakeGroupsConcat ( CString ( " " ) ) ; } else { if ( m_OpTools . IsButtonChecked ( IDB_INTERSECT ) != 0 ) { MakeGroupsConcat ( CString ( " " ) ) ; MakeGroupsIntersect ( CString ( " " ) ) ; } else { if ( m_OpTools . IsButtonChecked ( IDB_DIFF ) != 0 ) { MakeGroupsConcat ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; MakeGroupsIntersect ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; EvaluateSync ( CString ( " " ) ) ; } } } serverQuery . Format ( " " , m_OutputVar ) ; EvaluateSync ( serverQuery ) ; EvaluateSync ( CString ( " " ) ) ; }
This private function will fill the output variable which name is given in the
m_OutputVariable member, if any, with the results of group operation or with the
elements in the current group if only one group selected.
This private function will fill the output variable which name is given in the m_OutputVariable member if any with the results of group operation or with the elements in the current group if only one group selected .
// No need to fill any output server variable if the variable name wasn't set. // creating new temporary group which will store all operationd  // results. // If all elements button selected ... // If intersect button selected // intersect END // If diff button selected // pass 1 : collecting all elements in a single group // pass 2 : calculating elements intersection  // pass 3 : calculating difference  // Removing group for temporary intersect stirage // coping data to the output variable // removing temporary group - all results are in the output variable now