本文整理汇总了C++中CExpression::GetSource方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpression::GetSource方法的具体用法?C++ CExpression::GetSource怎么用?C++ CExpression::GetSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpression
的用法示例。
在下文中一共展示了CExpression::GetSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSendAddStr
long CCompileEditView::OnSendAddStr(WPARAM wParam /*= 0*/, LPARAM lParam /*= 0*/)
{
if(lParam == NULL)
return 0;
if( IsCompileEdit(COMPILE) )
{
HSAddStrCompileEdit* pData = (HSAddStrCompileEdit*)lParam;
CString strRep;
long nStartChar;
long nEndChar;
GetRichEditCtrl().GetSel( nStartChar, nEndChar );
if(wParam == HX_EXPRESSSENTENCE)
{
CExpression* pExpression = (CExpression*)pData->m_strText;
pData->m_strText = NULL;
strRep.Format(_T("\n\n{ 插入%s公式体开始 }\n\n %s \n\n{ 插入%s公式体结束 }\n"),
pExpression->GetName(),pExpression->GetSource(),pExpression->GetName());
GetRichEditCtrl().SetSel (-1,-1); // 插入到最后
GetRichEditCtrl().ReplaceSel(strRep,TRUE);
if( m_pParentDlg->m_WndGridCtrl.GetSafeHwnd() )
{
//m_pParentDlg->m_WndGridCtrl.SetParamer(pExpression->GetParamVar(),TRUE);
CMapVariabile* pVarsMap = pExpression->GetParamVar();
int nRow = m_pParentDlg->m_WndGridCtrl.GetFixedRowCount();
if ( pVarsMap ==NULL )
{
for(;nRow < m_pParentDlg->m_WndGridCtrl.GetRowCount(); nRow++)
{
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,1,"");
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,2,"");
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,3,"");
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,4,"");
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,5,"");
}
}
CNumericValue* pValue;
CArray<class CValue*,class CValue*>* pArray = pVarsMap->GetObjArray();
CString sName;
CString strRetName;
for(int nObj = 0; pArray != NULL && nObj < pArray->GetSize(); nObj++)
{
pValue = (CNumericValue*)pArray->GetAt(nObj);
if( !pValue->IsStyle(HX_EXPRESSNUMBER) )
continue;
CString strValue;
sName = pVarsMap->GetObjectName(pValue);
strRetName.Format("%s",sName);
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,1,strRetName);
strValue.Format("%d", pValue->GetMinValue());
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,2,strValue);
strValue.Format("%d", pValue->GetMaxValue());
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,3,strValue);
strValue.Format("%d", pValue->GetValue());
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,4,strValue);
strValue.Format("%d", pValue->GetTestStepValue());
m_pParentDlg->m_WndGridCtrl.SetItemText(nRow,5,strValue);
nRow++;
}
m_pParentDlg->m_WndGridCtrl.Invalidate();
}
}
else
{
strRep.Format("%s",*pData->m_strText);
GetRichEditCtrl().ReplaceSel(strRep,FALSE);
GetRichEditCtrl().SetSel( nStartChar+pData->m_nCharPos, nStartChar+pData->m_nCharPos );
}
SetFocus();
}
else if( IsCompileEdit(HELP) )
{
CString* str = (CString*)lParam;
GetRichEditCtrl().SetWindowText(*str);
int nCount = GetRichEditCtrl().GetLineCount();
CDC* pDC = GetRichEditCtrl().GetDC();
if(pDC != NULL)
{
nCount = pDC->GetTextExtent("A").cy * (nCount + 1);
GetRichEditCtrl().ReleaseDC(pDC);
}
CSplitterWnd* pWnd = (CSplitterWnd*)this->GetParent();
if( pWnd != NULL && pWnd->IsKindOf(RUNTIME_CLASS(CSplitterWnd)) )
{
CRect rect;
pWnd->GetClientRect(rect);
int nHeight = rect.Height() - nCount;
if(nHeight < 0) nHeight = rect.Height();
pWnd->SetRowInfo(0,nHeight,0);
pWnd->SetRowInfo(1,nCount,0);
pWnd->RecalcLayout();
}
}
return 0;
//.........这里部分代码省略.........