コード例 #1
0
ファイル: CommandDlgBar.cpp プロジェクト: Spritutu/AiPI-1
LRESULT CCommandDlgBar::UserMsg(WPARAM n1, LPARAM n2)
{
	//this is where the messages from ParseCommand() get sent
	
	CString *command, str;

	command = (CString *) n1;
	
	
	//Add Command to the CRichEditCtrl
	CMDIFrameWnd* pFrame = (CMDIFrameWnd*)::AfxGetApp()->m_pMainWnd;
	CMDIChildWnd* pChild = (CMDIChildWnd*) pFrame->MDIGetActive();	
	CRichEditView* pView = (CRichEditView*) pChild->GetActiveView();
	ASSERT(pView);
	pView->GetRichEditCtrl().GetWindowText(str);
	str = str + "\r\n" "Command: " + *command;
	pView->GetRichEditCtrl().SetWindowText(str);

	//Save the input
	g_currentCmdInput = *command;

	
	//Continue with the parser
	if( g_currentParserClass == EXP_PARSER_FILE )
	{
		g_bStopFlag = false; 
		CAipi_ExpParserFile epf;
		epf.cmd_input_continue();
		//AfxMessageBox(_T("Sale CMD EXP_PARS_FILE"));
		//CAipi_Tokenizer tkz;
		//tkz.v_printTokenizer();
	}
	else if( g_currentParserClass == EXP_PARSER_FILE_GLOBAL )
	{
		g_bStopFlag = false; 
		CAipi_ExpParserFileGlobal epfg;
		epfg.cmd_input_continue();

	}
	else if( g_currentParserClass == EXP_PARSER_GUI )
	{
		g_bStopFlag = false; 
		CAipi_ExpParserGUI epg;
		epg.cmd_input_continue();

		
	}
	else if( g_currentParserClass == EXP_PARSER_GUI_GLOBAL )
	{
		g_bStopFlag = false; 
		CAipi_ExpParserGUIGlobal epgg;
		epgg.cmd_input_continue();


	}

	
	
/*	
	//Add Command to the CRichEditCtrl
	CMainFrame* pMainFrame = (CMainFrame*)::AfxGetMainWnd();
	pMainFrame->GetActiveDocument();
	
	CRichEditView *pView = (CRichEditView*) pMainFrame->GetActiveView();
	pView->GetRichEditCtrl().GetWindowText(str);
	str = str + "\r\n" "Command: " + *command;
	pView->GetRichEditCtrl().SetWindowText(str);
*/	
	
	return 0;
}
コード例 #2
0
ファイル: ListOptionCtrl.cpp プロジェクト: malpharo/AiPI
void CListOptionCtrl::OnDblclkListBoxEx()
{
	if(!UpdateData(TRUE))
		return;

	for(int nIndex=0; nIndex<m_listBoxEx.GetCount(); nIndex++)
	{
	
		VERIFY(m_listBoxEx.SetItemImageIndex( nIndex, 0));
	}
	
	CString strSelection;
	nIndex=m_listBoxEx.GetCurSel();
	m_listBoxEx.GetText(nIndex, strSelection);
	
	VERIFY(m_listBoxEx.SetItemImageIndex( nIndex, 1));
	//MessageBox(str);
	
	//Add Command to the CRichEditCtrl
	CMDIFrameWnd* pFrame = (CMDIFrameWnd*)::AfxGetApp()->m_pMainWnd;
	CMDIChildWnd* pChild = (CMDIChildWnd*) pFrame->MDIGetActive();	
	CRichEditView* pView = (CRichEditView*) pChild->GetActiveView();
	ASSERT(pView);
	CString str;
	pView->GetRichEditCtrl().GetWindowText(str);
	str = str + "\r\n" "Command: " + strSelection;
	pView->GetRichEditCtrl().SetWindowText(str);
	
	g_currentCmdInput = strSelection;


	//Continue with the parser
	if( g_currentParserClass == EXP_PARSER_FILE )
	{
		AfxMessageBox(_T("EXP_PARS_FILE"));
		g_bStopFlag = false; 
		CAipi_ExpParserFile epf;
		epf.ctrl_listoption_continue();
		
		//CAipi_Tokenizer tkz;
		//tkz.v_printTokenizer();
	}
	else if( g_currentParserClass == EXP_PARSER_FILE_GLOBAL )
	{
		AfxMessageBox(_T("EXP_PARS_FILE_GLOBAL"));
		g_bStopFlag = false; 
		CAipi_ExpParserFileGlobal epfg;
		epfg.ctrl_listoption_continue();

	}
	else if( g_currentParserClass == EXP_PARSER_GUI )
	{
		//AfxMessageBox(_T("EXP_PARS_GUI"));
		g_bStopFlag = false; 
		CAipi_ExpParserGUI epg;
		epg.ctrl_listoption_continue();

		
	}
	else if( g_currentParserClass == EXP_PARSER_GUI_GLOBAL )
	{
		//AfxMessageBox(_T("EXP_PARS_GUI_GLOBAL"));
		g_bStopFlag = false; 
		CAipi_ExpParserGUIGlobal epgg;
		epgg.ctrl_listoption_continue();


	}

	
	
}