newntui/discovermdi/src/dockablebrowser.cpp
//-------------------------------------------------------------------------------------------------
// This callback runs every time the user make Ctrl+Click in the Developer Studio.
// The MSDEV Integrator fire the CtrlClick event to run this callback.
//-------------------------------------------------------------------------------------------------
This callback runs every time the user make Ctrl+Click in the Developer Studio.
The MSDEV Integrator fire the CtrlClick event to run this callback.
This callback runs every time the user make Ctrl + Click in the Developer Studio . The MSDEV Integrator fire the CtrlClick event to run this callback .
void CDockableBrowser::IntegratorCtrlClick(LPCTSTR lfile, long line,long col, long size){
CCodeRoverIntegrator* integrator=(CCodeRoverIntegrator*) GetDlgItem(IDC_CODEROVERINTEGRATORCTRL);
CString serverQuery;
CString infoString;
CString param;
CString ffile="";
BSTR q;
	if(integrator==NULL) return;
	CDataSource* DataSource;
	DataSource = (CDataSource *)     GetDlgItem(IDC_DATASOURCE);
	unsigned register i;
	if(lfile!=NULL) {
		for(i=0;i<strlen(lfile);i++) {
		    if(lfile[i]=='\\') 
			    ffile+="/";
		    else
			    ffile+=lfile[i];
		}
	}
	serverQuery.Format("printformat \"%%s\" etag;set SYMBOL_INSTANCE [get_instance_symbol [set_copy -e %ld,%ld:[lname {%s}]]]",line,col,ffile);
	q=serverQuery.AllocSysString();
	param=DataSourceAccessSync(DataSource, &q);
    ::SysFreeString(q);
	serverQuery = "printformat \"\t%s\t%s\t%s\t%s\t%s\t%s\" name kind type language public protected private;print $SYMBOL_INSTANCE";
	q=serverQuery.AllocSysString();
	param=DataSource->AccessOutput(&q);
    ::SysFreeString(q);
    serverQuery="unset SYMBOL_INSTANCE";
	q=serverQuery.AllocSysString();
	DataSourceAccessSync(DataSource, &q);
    ::SysFreeString(q);
	CString reply;
	if(param[0] == _T('\t')) { 
		param = param.Mid(1);
		CString name,kind,type,lang;
		bool bPublic,bProtected,bPrivate;
		int nLen = param.GetLength();
		int nStart = 0;
		int nEnd = 0;
		int nField = 0;
		while(nStart < nLen) {
			CString szField;
			nEnd = param.Find(_T('\t'),nStart);
			if(nEnd == -1)
				szField = param.Mid(nStart);
			else
				szField = param.Mid(nStart,nEnd-nStart);
			switch(nField) {
				case 0 : name = szField; break;
				case 1 : kind = szField; break;
				case 2 : type = szField; break;
				case 3 : lang = szField; break;
				case 4 : bPublic = szField.Compare("1")==0; break;
				case 5 : bProtected = szField.Compare("1")==0; break;
				case 6 : bPrivate = szField.Compare("1")==0; break;
			}
			nField++;
			if(nEnd!=-1)
				nStart = nEnd + 1;
			else
				nStart = nLen + 1;
		}
		reply = getDescription(name,kind,type,lang,bPublic,bProtected,bPrivate);
	}
	if(reply.GetLength()>0)  integrator->SetInfo(reply);
	else                     integrator->SetInfo("Can't describe selected symbol");
}
void CDockableBrowser :: IntegratorCtrlClick ( LPCTSTR lfile , long line , long col , long size ) { CCodeRoverIntegrator * integrator = ( CCodeRoverIntegrator * ) GetDlgItem ( IDC_CODEROVERINTEGRATORCTRL ) ; CString serverQuery ; CString infoString ; CString param ; CString ffile = " " ; BSTR q ; if ( integrator == NULL ) return ; CDataSource * DataSource ; DataSource = ( CDataSource * ) GetDlgItem ( IDC_DATASOURCE ) ; unsigned register i ; if ( lfile != NULL ) { for ( i = 0 ; i < strlen ( lfile ) ; i ++ ) { if ( lfile [ i ] == ' \\ ' ) ffile += " " ; else ffile += lfile [ i ] ; } } serverQuery . Format ( " \" \" " , line , col , ffile ) ; q = serverQuery . AllocSysString ( ) ; param = DataSourceAccessSync ( DataSource , & q ) ; :: SysFreeString ( q ) ; serverQuery = " \" \t \t \t \t \t \t \" " ; q = serverQuery . AllocSysString ( ) ; param = DataSource -> AccessOutput ( & q ) ; :: SysFreeString ( q ) ; serverQuery = " " ; q = serverQuery . AllocSysString ( ) ; DataSourceAccessSync ( DataSource , & q ) ; :: SysFreeString ( q ) ; CString reply ; if ( param [ 0 ] == _T ( ' \t ' ) ) { param = param . Mid ( 1 ) ; CString name , kind , type , lang ; bool bPublic , bProtected , bPrivate ; int nLen = param . GetLength ( ) ; int nStart = 0 ; int nEnd = 0 ; int nField = 0 ; while ( nStart < nLen ) { CString szField ; nEnd = param . Find ( _T ( ' \t ' ) , nStart ) ; if ( nEnd == -1 ) szField = param . Mid ( nStart ) ; else szField = param . Mid ( nStart , nEnd - nStart ) ; switch ( nField ) { case 0 : name = szField ; break ; case 1 : kind = szField ; break ; case 2 : type = szField ; break ; case 3 : lang = szField ; break ; case 4 : bPublic = szField . Compare ( " " ) == 0 ; break ; case 5 : bProtected = szField . Compare ( " " ) == 0 ; break ; case 6 : bPrivate = szField . Compare ( " " ) == 0 ; break ; } nField ++ ; if ( nEnd != -1 ) nStart = nEnd + 1 ; else nStart = nLen + 1 ; } reply = getDescription ( name , kind , type , lang , bPublic , bProtected , bPrivate ) ; } if ( reply . GetLength ( ) > 0 ) integrator -> SetInfo ( reply ) ; else integrator -> SetInfo ( " " ) ; }
This callback runs every time the user make Ctrl+Click in the Developer Studio.
This callback runs every time the user make Ctrl + Click in the Developer Studio .
// Asking Developer Studio for it's current tab size. //int tabsize = integrator->GetTabSize(); // Getting info string //	line = integrator->GetModelLine(ffile,ffile,line); // if reply is valid // Extracting parameters