newntui/discovermdi/src/qaparams.cpp
//--------------------------------------------------------------------------------------------
// This callback will run every time the user changed the value in the edit cell.
//--------------------------------------------------------------------------------------------
This callback will run every time the user changed the value in the edit cell.
This callback will run every time the user changed the value in the edit cell .
void CQAParams::OnStringChanged(long row, long col, LPCTSTR val)  {
CString query;
CString weight;
BSTR sysQuery;
CQATree* view;
CString node;
    view=(CQATree* )(((CSplitterWnd *)GetParent())->GetPane(0,0));
    node=(*view->GetCurrentNodeName());
    if(row==2) {
        if(IsDigit(CString(val))) {
            query.Format("sev_set {%s} weight %s",node,val);
            sysQuery=query.AllocSysString();
            DataSourceAccessSync(&sysQuery);
	        SysFreeString(sysQuery); 
            query.Format("sev_get {%s} weight",node);
            sysQuery=query.AllocSysString();
            weight=DataSourceAccessSync(&sysQuery);
            m_Properties.SetCellText(2,1,weight);
	        SysFreeString(sysQuery); 
		} else {
		    MessageBox("The value you'v entered is not digital.","Properties Entry Error",MB_ICONEXCLAMATION);
            query.Format("sev_get {%s} weight",node);
            sysQuery=query.AllocSysString();
            weight=DataSourceAccessSync(&sysQuery);
            m_Properties.SetCellText(2,1,weight);
	        SysFreeString(sysQuery); 
		}
	}
    if(row==3) {
        if(IsDigit(CString(val))) {
            query.Format("sev_set {%s} threshold %s",node,val);
            sysQuery=query.AllocSysString();
            CString rr = DataSourceAccessSync(&sysQuery);
	        SysFreeString(sysQuery); 
            query.Format("sev_get {%s} threshold",node);
            sysQuery=query.AllocSysString();
            weight=DataSourceAccessSync(&sysQuery);
            m_Properties.SetCellText(3,1,weight);
	        SysFreeString(sysQuery); 
		} else {
		    MessageBox("The value you'v entered is not digital.","Properties Entry Error",MB_ICONEXCLAMATION);
            query.Format("sev_get {%s} threshold",node);
            sysQuery=query.AllocSysString();
            weight=DataSourceAccessSync(&sysQuery);
            m_Properties.SetCellText(3,1,weight);
	        SysFreeString(sysQuery); 
		}
	}
}
void CQAParams :: OnStringChanged ( long row , long col , LPCTSTR val ) { CString query ; CString weight ; BSTR sysQuery ; CQATree * view ; CString node ; view = ( CQATree * ) ( ( ( CSplitterWnd * ) GetParent ( ) ) -> GetPane ( 0 , 0 ) ) ; node = ( * view -> GetCurrentNodeName ( ) ) ; if ( row == 2 ) { if ( IsDigit ( CString ( val ) ) ) { query . Format ( " " , node , val ) ; sysQuery = query . AllocSysString ( ) ; DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; weight = DataSourceAccessSync ( & sysQuery ) ; m_Properties . SetCellText ( 2 , 1 , weight ) ; SysFreeString ( sysQuery ) ; } else { MessageBox ( " " , " " , MB_ICONEXCLAMATION ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; weight = DataSourceAccessSync ( & sysQuery ) ; m_Properties . SetCellText ( 2 , 1 , weight ) ; SysFreeString ( sysQuery ) ; } } if ( row == 3 ) { if ( IsDigit ( CString ( val ) ) ) { query . Format ( " " , node , val ) ; sysQuery = query . AllocSysString ( ) ; CString rr = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; weight = DataSourceAccessSync ( & sysQuery ) ; m_Properties . SetCellText ( 3 , 1 , weight ) ; SysFreeString ( sysQuery ) ; } else { MessageBox ( " " , " " , MB_ICONEXCLAMATION ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; weight = DataSourceAccessSync ( & sysQuery ) ; m_Properties . SetCellText ( 3 , 1 , weight ) ; SysFreeString ( sysQuery ) ; } } }
This callback will run every time the user changed the value in the edit cell.
This callback will run every time the user changed the value in the edit cell .