newntui/activex/groupscombo/src/groupscomboctl.cpp
//------------------------------------------------------------------------------------
// If the server selection variable is set, takes all selected elements and adds them
// to all selected groups.
//------------------------------------------------------------------------------------
If the server selection variable is set, takes all selected elements and adds them
to all selected groups.
If the server selection variable is set takes all selected elements and adds them to all selected groups .
void CGroupsComboCtrl::OnAddSel() {
register i;
CString serverQuery;
   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 add %s $%s",
				             m_ElementsList.GetItemText(i,0),m_SelectionVar);
		 EvaluateSync(serverQuery);
	  }
   }
   FillElementsList();
   FireSelectionInserted();
}
void CGroupsComboCtrl :: OnAddSel ( ) { register i ; CString serverQuery ; 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 ) ; } } FillElementsList ( ) ; FireSelectionInserted ( ) ; }
If the server selection variable is set, takes all selected elements and adds them
to all selected groups.
If the server selection variable is set takes all selected elements and adds them to all selected groups .
// No need to add something if selection variable is not available // Searching all  selected groups