newntui/commonresources/src/filterwizard.cpp
//---------------------------------------------------------------------------------------
// Callback for the Add button. Adds subexpression to the result expression.
//---------------------------------------------------------------------------------------
Callback for the Add button. Adds subexpression to the result expression.
Callback for the Add button . Adds subexpression to the result expression .
void CFilterWizard::OnAddbutton()  {
CToken token;
    if(MakeToken(token) == FALSE) {
		SayError();
		return;
	}
	if(AddToken(token)==FALSE) {
		m_ErrorType = ERROR_EXISTING_TOKEN;
		SayError();
		return;
	}
	CommandFromTokens();
	m_CommandEdit.SetWindowText(m_Command);
	HighlightToken(m_TokensTable.GetSize()-1);
    item.mask=TCIF_TEXT | TCIF_IMAGE;
	switch(token.Concatination) {
	   case OP_AND : item.iImage=0; break;
	   case OP_OR  : item.iImage=1; break;
	}
	item.pszText=(char *)(LPCSTR)token.Attribute;
   	m_FlowTab.InsertItem(m_TokensTable.GetSize()-1,&item);
	m_FlowTab.SetCurSel(m_TokensTable.GetSize()-1);
	m_RemoveButton.EnableWindow(TRUE);
	m_ChangeButton.EnableWindow(TRUE);
	SetModified(TRUE);
}
void CFilterWizard :: OnAddbutton ( ) { CToken token ; if ( MakeToken ( token ) == FALSE ) { SayError ( ) ; return ; } if ( AddToken ( token ) == FALSE ) { m_ErrorType = ERROR_EXISTING_TOKEN ; SayError ( ) ; return ; } CommandFromTokens ( ) ; m_CommandEdit . SetWindowText ( m_Command ) ; HighlightToken ( m_TokensTable . GetSize ( ) - 1 ) ; item . mask = TCIF_TEXT | TCIF_IMAGE ; switch ( token . Concatination ) { case OP_AND : item . iImage = 0 ; break ; case OP_OR : item . iImage = 1 ; break ; } item . pszText = ( char * ) ( LPCSTR ) token . Attribute ; m_FlowTab . InsertItem ( m_TokensTable . GetSize ( ) - 1 , & item ) ; m_FlowTab . SetCurSel ( m_TokensTable . GetSize ( ) - 1 ) ; m_RemoveButton . EnableWindow ( TRUE ) ; m_ChangeButton . EnableWindow ( TRUE ) ; SetModified ( TRUE ) ; }
Callback for the Add button.
Callback for the Add button .
// Make new token array element - error goes wrong. // New token will be in the array // Adding new token to the tokens array // Form the new command string // New command will be shown in the command editor // with the new token highlighted // Insert and select new item in the tab // Now we have something to change or remove // Can apply changes