newntui/commonresources/src/filterlist.cpp
//----------------------------------------------------------------------------------------
// This callback runs when user press "Change" button. Will change the current filter
// name getting the new one from the name edit field. Will update the information in the
// m_AllFilters array.
//----------------------------------------------------------------------------------------
This callback runs when user press "Change" button. Will change the current filter
name getting the new one from the name edit field. Will update the information in the
m_AllFilters array.
This callback runs when user press " Change " button . Will change the current filter name getting the new one from the name edit field . Will update the information in the m_AllFilters array .
void CFilterList::OnChangebutton()  {
int index = m_SaveList.GetCurSel();
int pos   = m_SaveList.GetItemData(index);
CString name;
CString command;
    m_NameEdit.GetWindowText(name);
	name.TrimLeft();
	name.TrimRight();
	if(name.GetLength()==0) {
		MessageBox("Can't save unnamed filter.","Add",MB_ICONSTOP|MB_OK);
		return;
	}
    m_CommandEdit.GetWindowText(command);
	m_AllFilters[pos]->Name    = name;
	m_AllFilters[pos]->Command = command;
    m_SaveList.DeleteString(index);
	index = m_SaveList.AddString(m_AllFilters[pos]->Name);
	m_SaveList.SetItemData(index,pos);
    m_SaveList.SetCurSel(index);
	SetModified(TRUE);
    SaveFilters();
	UpdateParentName();
}
void CFilterList :: OnChangebutton ( ) { int index = m_SaveList . GetCurSel ( ) ; int pos = m_SaveList . GetItemData ( index ) ; CString name ; CString command ; m_NameEdit . GetWindowText ( name ) ; name . TrimLeft ( ) ; name . TrimRight ( ) ; if ( name . GetLength ( ) == 0 ) { MessageBox ( " " , " " , MB_ICONSTOP | MB_OK ) ; return ; } m_CommandEdit . GetWindowText ( command ) ; m_AllFilters [ pos ] -> Name = name ; m_AllFilters [ pos ] -> Command = command ; m_SaveList . DeleteString ( index ) ; index = m_SaveList . AddString ( m_AllFilters [ pos ] -> Name ) ; m_SaveList . SetItemData ( index , pos ) ; m_SaveList . SetCurSel ( index ) ; SetModified ( TRUE ) ; SaveFilters ( ) ; UpdateParentName ( ) ; }
This callback runs when user press "Change" button.
This callback runs when user press " Change " button .