newntui/discovermdi/src/qatree.cpp
//---------------------------------------------------------------------------------------
// This function will change the current item status.
//---------------------------------------------------------------------------------------
This function will change the current item status.
This function will change the current item status .
void CQATree::SetCurrentItemStatus(BOOL status) {
CTreeNodeInfo* info;
CString query;
BSTR    sysQuery;
    HTREEITEM item = m_Tree.GetSelectedItem();
	if(item!=NULL) {
 	    info=(CTreeNodeInfo *)m_Tree.GetItemData(item);
	    if(info->m_RootEnabled!=FALSE) {
			CString stStr;
			if(status==TRUE) stStr="1";
			else             stStr="0";
            query.Format("sev_set {%s} on %s",info->m_NodeName,stStr);
            sysQuery=query.AllocSysString();
            CString res = DataSourceAccessSync(&sysQuery);
            SysFreeString(sysQuery); 
	        if(info->m_NodeType=="folder") {
	            if(stStr=="1") m_Tree.SetItemImage(item,1,0);
		        else            m_Tree.SetItemImage(item,7,6);
			}
	        if(info->m_NodeType=="query_0") {
	            if(stStr=="1") m_Tree.SetItemImage(item,3,2);
		        else            m_Tree.SetItemImage(item,9,8);
			}
	        if(info->m_NodeType=="query_1") {
	            if(stStr=="1") m_Tree.SetItemImage(item,5,4);
		        else            m_Tree.SetItemImage(item,9,8);
			}
			HTREEITEM child=m_Tree.GetChildItem(item);
			if(child!=NULL) PropagateStatus(child,stStr=="1");
		}
	}
}
void CQATree :: SetCurrentItemStatus ( BOOL status ) { CTreeNodeInfo * info ; CString query ; BSTR sysQuery ; HTREEITEM item = m_Tree . GetSelectedItem ( ) ; if ( item != NULL ) { info = ( CTreeNodeInfo * ) m_Tree . GetItemData ( item ) ; if ( info -> m_RootEnabled != FALSE ) { CString stStr ; if ( status == TRUE ) stStr = " " ; else stStr = " " ; query . Format ( " " , info -> m_NodeName , stStr ) ; sysQuery = query . AllocSysString ( ) ; CString res = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; if ( info -> m_NodeType == " " ) { if ( stStr == " " ) m_Tree . SetItemImage ( item , 1 , 0 ) ; else m_Tree . SetItemImage ( item , 7 , 6 ) ; } if ( info -> m_NodeType == " " ) { if ( stStr == " " ) m_Tree . SetItemImage ( item , 3 , 2 ) ; else m_Tree . SetItemImage ( item , 9 , 8 ) ; } if ( info -> m_NodeType == " " ) { if ( stStr == " " ) m_Tree . SetItemImage ( item , 5 , 4 ) ; else m_Tree . SetItemImage ( item , 9 , 8 ) ; } HTREEITEM child = m_Tree . GetChildItem ( item ) ; if ( child != NULL ) PropagateStatus ( child , stStr == " " ) ; } } }
This function will change the current item status.
This function will change the current item status .
// Setting the node status // Setting the new status according to the parent status and  // the current node status.