newntui/activex/groupscombo/src/groupscomboctl.cpp
//------------------------------------------------------------------------------------
// If the server selection variable is set, takes all selected elements and removes 
// them from all selected groups, if possible.
//------------------------------------------------------------------------------------
If the server selection variable is set, takes all selected elements and removes
them from all selected groups, if possible.
If the server selection variable is set takes all selected elements and removes them from all selected groups if possible .
void CGroupsComboCtrl::OnRemoveSel() {
register i;
CString serverQuery;
CString serverResults;
   if(m_SelectionVar.GetLength()==0) return;
   for(i=0;i<m_ElementsList.GetItemCount();i++) {
      if(m_ElementsList.GetItemState(i,LVIS_SELECTED)!=0) {
	     serverQuery.Format("group subtract %s $%s",
				             m_ElementsList.GetItemText(i,0),m_SelectionVar);
		 EvaluateSync(serverQuery);
         serverQuery.Format("group kind %s",m_ElementsList.GetItemText(i,0));
		 EvaluateSync(serverQuery,&serverResults);
		 if(serverResults.Find("persistant")>=0) {
	         serverQuery.Format("group save %s",m_ElementsList.GetItemText(i,0));
		     EvaluateSync(serverQuery,&serverResults);
		 }
	  }
   }
   FillElementsList();
   FireSelectionRemoved();
}
void CGroupsComboCtrl :: OnRemoveSel ( ) { register i ; CString serverQuery ; CString serverResults ; if ( m_SelectionVar . GetLength ( ) == 0 ) return ; for ( i = 0 ; i < m_ElementsList . GetItemCount ( ) ; i ++ ) { if ( m_ElementsList . GetItemState ( i , LVIS_SELECTED ) != 0 ) { serverQuery . Format ( " " , m_ElementsList . GetItemText ( i , 0 ) , m_SelectionVar ) ; EvaluateSync ( serverQuery ) ; serverQuery . Format ( " " , m_ElementsList . GetItemText ( i , 0 ) ) ; EvaluateSync ( serverQuery , & serverResults ) ; if ( serverResults . Find ( " " ) >= 0 ) { serverQuery . Format ( " " , m_ElementsList . GetItemText ( i , 0 ) ) ; EvaluateSync ( serverQuery , & serverResults ) ; } } } FillElementsList ( ) ; FireSelectionRemoved ( ) ; }
If the server selection variable is set, takes all selected elements and removes
them from all selected groups, if possible.
If the server selection variable is set takes all selected elements and removes them from all selected groups if possible .
// No need to remove something if selection variable is not available // Searching all  selected groups