newntui/discovermdi/src/qatree.cpp
//--------------------------------------------------------------------------------------------
// This callback will run when user press "Reset" button.
//--------------------------------------------------------------------------------------------
This callback will run when user press "Reset" button.
This callback will run when user press " Reset " button .
void CQATree::OnReset()  {
CTreeNodeInfo* info;
CString query;
BSTR    sysQuery;
CQAParams* view;
	if(MessageBox("Are you sure that you\nwant to reset all weights and thresholds?",
		          "QA Warning",
				  MB_ICONQUESTION|MB_OKCANCEL)==IDOK) {
            query="sev_init";
            sysQuery=query.AllocSysString();
            DataSourceAccessSync(&sysQuery);
            SysFreeString(sysQuery); 
            query="source_dis sel2sym.dis";
            sysQuery=query.AllocSysString();
            DataSourceAccessSync(&sysQuery);
	        SysFreeString(sysQuery);
            Free(m_Tree.GetRootItem());
			m_Tree.DeleteAllItems();
			FillTree();
            HTREEITEM item = m_Tree.GetSelectedItem();
            view=(CQAParams* )(((CSplitterWnd *)GetParent())->GetPane(0,1));
	        if(item!=NULL) {
 	            info=(CTreeNodeInfo *)m_Tree.GetItemData(item);
				view->Refresh(info->m_NodeName);
			} else {
				view->Refresh(CString(""));
			}
	}			
}
void CQATree :: OnReset ( ) { CTreeNodeInfo * info ; CString query ; BSTR sysQuery ; CQAParams * view ; if ( MessageBox ( " \n " , " " , MB_ICONQUESTION | MB_OKCANCEL ) == IDOK ) { query = " " ; sysQuery = query . AllocSysString ( ) ; DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; query = " " ; sysQuery = query . AllocSysString ( ) ; DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; Free ( m_Tree . GetRootItem ( ) ) ; m_Tree . DeleteAllItems ( ) ; FillTree ( ) ; HTREEITEM item = m_Tree . GetSelectedItem ( ) ; view = ( CQAParams * ) ( ( ( CSplitterWnd * ) GetParent ( ) ) -> GetPane ( 0 , 1 ) ) ; if ( item != NULL ) { info = ( CTreeNodeInfo * ) m_Tree . GetItemData ( item ) ; view -> Refresh ( info -> m_NodeName ) ; } else { view -> Refresh ( CString ( " " ) ) ; } } }
This callback will run when user press "Reset" button.
This callback will run when user press " Reset " button .