newntui/discovermdi/src/dockablebrowser.cpp
//-------------------------------------------------------------------------------------------------
// Callback runs every time the user clicked "Definition" button in the Developer
// Studio. We are opening definition of the selected symbol.
//-------------------------------------------------------------------------------------------------
Callback runs every time the user clicked "Definition" button in the Developer
Studio. We are opening definition of the selected symbol.
Callback runs every time the user clicked " Definition " button in the Developer Studio . We are opening definition of the selected symbol .
void CDockableBrowser::IntegratorDefinition(LPCTSTR lfile, long line,long col, long size){
register i;
CCodeRoverIntegrator* integrator=(CCodeRoverIntegrator*) GetDlgItem(IDC_CODEROVERINTEGRATORCTRL);
CString serverQuery;
CString ffile;
CString param;
CString filestr;
CString tokenstr;
CString linestr;
CString colstr;
BSTR q;
	if(integrator==NULL) return;
	CDataSource* DataSource;
	DataSource = (CDataSource *)     GetDlgItem(IDC_DATASOURCE);
	if(lfile!=NULL) {
		for(i=0;i<(int)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 \"%s\t%s\" fname line;print $SYMBOL_INSTANCE";
	q=serverQuery.AllocSysString();
	param=DataSource->AccessOutput(&q);
    ::SysFreeString(q);
	int nFileDelim = param.Find(_T('\t'));
	filestr = param.Left(nFileDelim);
	linestr = param.Mid(nFileDelim+1);
	colstr = "-1";
	tokenstr = "";
	if(filestr.GetLength()!=0) {
       integrator->MakeSelection(filestr,atoi(linestr),atoi(colstr),tokenstr.GetLength());
	} else
		integrator->SetInfo("Can't find selected symbol");
    serverQuery="unset SYMBOL_INSTANCE";
	q=serverQuery.AllocSysString();
	DataSourceAccessSync(DataSource, &q);
    ::SysFreeString(q);
}
void CDockableBrowser :: IntegratorDefinition ( LPCTSTR lfile , long line , long col , long size ) { register i ; CCodeRoverIntegrator * integrator = ( CCodeRoverIntegrator * ) GetDlgItem ( IDC_CODEROVERINTEGRATORCTRL ) ; CString serverQuery ; CString ffile ; CString param ; CString filestr ; CString tokenstr ; CString linestr ; CString colstr ; BSTR q ; if ( integrator == NULL ) return ; CDataSource * DataSource ; DataSource = ( CDataSource * ) GetDlgItem ( IDC_DATASOURCE ) ; if ( lfile != NULL ) { for ( i = 0 ; i < ( int ) 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 \" " ; q = serverQuery . AllocSysString ( ) ; param = DataSource -> AccessOutput ( & q ) ; :: SysFreeString ( q ) ; int nFileDelim = param . Find ( _T ( ' \t ' ) ) ; filestr = param . Left ( nFileDelim ) ; linestr = param . Mid ( nFileDelim + 1 ) ; colstr = " " ; tokenstr = " " ; if ( filestr . GetLength ( ) != 0 ) { integrator -> MakeSelection ( filestr , atoi ( linestr ) , atoi ( colstr ) , tokenstr . GetLength ( ) ) ; } else integrator -> SetInfo ( " " ) ; serverQuery = " " ; q = serverQuery . AllocSysString ( ) ; DataSourceAccessSync ( DataSource , & q ) ; :: SysFreeString ( q ) ; }
Callback runs every time the user clicked "Definition" button in the Developer
Studio.
Callback runs every time the user clicked " Definition " button in the Developer Studio .
// Asking Developer Studio for it's current tab size. //int tabsize = integrator->GetTabSize(); // Getting symbol //	line = integrator->GetModelLine(ffile,ffile,line); // Extracting parameters // Selecting