本文整理汇总了C++中CExpression::GetParamVar方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpression::GetParamVar方法的具体用法?C++ CExpression::GetParamVar怎么用?C++ CExpression::GetParamVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpression
的用法示例。
在下文中一共展示了CExpression::GetParamVar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCurExp
//.........这里部分代码省略.........
m_wndData2.ShowWindow(SW_HIDE);
m_wndMiddle.ShowWindow(SW_HIDE);
}
break;
case CExpression::Exchange:
{
//"选出交易系统发出以下信号的股票:");
m_sSingleSel.m_SubData.m_cType = FormulaCompareSubData::Exchange;
m_wndPeriod.ShowWindow(SW_SHOW);
#ifdef _ONLY_SUPPORT_DAYLINE
m_wndPeriod.SetCurSel(0);
#else
m_wndPeriod.SetCurSel(5);
#endif
m_wndPeriodStc.ShowWindow(SW_SHOW);
m_wndConNotes.ShowWindow(SW_HIDE);
m_wndConNotes.SetWindowText(HS_LANGUAGE("发出"));
m_wndCon.ShowWindow(SW_HIDE);
m_wndStaticCon.ShowWindow(SW_HIDE);
m_wndCompare.ShowWindow(SW_HIDE);
m_wndData1.ShowWindow(SW_HIDE);
m_wndAndOr.ShowWindow(SW_HIDE);
m_wndData2.ShowWindow(SW_HIDE);
m_wndMiddle.ShowWindow(SW_HIDE);
}
break;
case CExpression::MoreKLine:
{
//"选出五彩K线发出指示的股票:");
m_sSingleSel.m_SubData.m_cType = FormulaCompareSubData::MoreKLine;
m_wndPeriod.ShowWindow(SW_SHOW);
#ifdef _ONLY_SUPPORT_DAYLINE
m_wndPeriod.SetCurSel(0);
#else
m_wndPeriod.SetCurSel(5);
#endif
m_wndPeriodStc.ShowWindow(SW_SHOW);
m_wndConNotes.ShowWindow(SW_HIDE);
m_wndCon.ShowWindow(SW_HIDE);
m_wndStaticCon.ShowWindow(SW_HIDE);
m_wndCompare.ShowWindow(SW_HIDE);
m_wndData1.ShowWindow(SW_HIDE);
m_wndAndOr.ShowWindow(SW_HIDE);
m_wndData2.ShowWindow(SW_HIDE);
m_wndMiddle.ShowWindow(SW_HIDE);
}
break;
}
}
// 注释/参数修改
// CWnd* pWnd = GetDlgItem(IDC_NOTES);
// pWnd->ShowWindow(SW_SHOW);
m_EditEidolon.ShowWindow(SW_SHOW);
CDlgNotesAndEidolon* pDlgNotes = pParentDlg->GetDlgNotes();
CDlgNotesAndEidolon* pDlgParam = pParentDlg->GetDlgParam();
if( pDlgNotes != NULL &&
pDlgNotes->IsWindowVisible() )
{
pDlgNotes->SetNotes(pExpression->GetNotes(), pExpression->GetName());
}
if( m_EditEidolon.m_hWnd != NULL )
{
CString strText;
strText.Format("%s",pExpression->GetEidolon());
if( !strText.IsEmpty() )
{
m_EditEidolon.SetText(strText,pExpression->GetParamVar(),FALSE);
}
else
{
CStringArray* pArray = pExpression->GetDefEidolon();
if(pArray->GetSize() <= 1)
{
pArray = NULL;
}
m_EditEidolon.SetText(pArray,pExpression->GetParamVar(),FALSE);
}
m_EditEidolon.Invalidate();
}
}
return 0;
}
示例2: OnOK
//.........这里部分代码省略.........
{
::MessageBox( m_hWnd,_T(" 请正确填写几次达标后触发! "),_T(" 提示 "), MB_OK);
m_wndTrigerNum.SetFocus();
return ;
}
gap = atoi(csGap);
if( gap < -1 || gap > SHORT_MAX)//
{
::MessageBox( m_hWnd,_T(" 请正确填写连续委托间隔! "),_T(" 提示 "), MB_OK);
m_wndGap.SetFocus();
return ;
}
m_pStrategy->m_nPeriodType = perType;
m_pStrategy->m_nPeriodNumber = perNum;
m_pStrategy->m_nMaxBuyTimes = buyTimes;
m_pStrategy->m_nMaxSellTimes = sellTimes;
m_pStrategy->m_nTrigTimes = trigTime;
m_pStrategy->m_nMaxTrigTimes = trigNum;
m_pStrategy->m_nGap = gap;
if(m_pStrategy->m_nGap == 0)//默认为30秒
{
m_pStrategy->m_nGap = 30;
}
if (m_wndCheck.GetCheck())
{
m_pStrategy->m_bFuQuan = 0;
}
else
{
m_pStrategy->m_bFuQuan = 1;
}
if (m_wndXD.GetCheck())
{
m_pStrategy->m_bXD = 1;
}
else
{
m_pStrategy->m_bXD = 0;
}
if (m_pStrategy->m_pData == NULL)
{
m_pStrategy->m_pData = new CLineProperty;
}
if (!m_pStrategy->m_pData->m_pCurVal)
{
m_pStrategy->m_pData->m_pCurVal = new CExpValue;
}
//只保存公式名和变量
CExpression *pNew;
if (!((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->GetExp())
{
pNew = new CExpression;
}
else
pNew = ((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->GetExp();
CExpression *pTreeExp = pTreeGroup->GetData();
if (pTreeExp)//复制参数值
{
CMapVariabile *pMv = pTreeExp->GetParamVar();
//----------------------------------------------
if (pMv)
{
CMapVariabile *pMap = new CMapVariabile;
CString key;
CValue *cvalue;
POSITION pos;
pos = pMv->GetStartPosition();
while(pos)
{
pMv->GetNextAssoc(pos,key,cvalue);
CNumericValue *pnum = new CNumericValue;
double db = cvalue->GetValue();
pnum->SetValue(db);
pnum->SetStyle(cvalue->GetStyle());
pnum->SetMaxValue(((CNumericValue*)cvalue)->GetMaxValue());
pnum->SetMinValue(((CNumericValue*)cvalue)->GetMinValue());
pnum->SetTestStepValue(((CNumericValue*)cvalue)->GetTestStepValue());
pnum->SetDescribe(((CNumericValue*)cvalue)->GetDescribe());
pMap->SetAt(key,pnum);
}
//===============================================================
pNew->SetParamVar(pMap);//存储变量值
}
memcpy(m_pStrategy->m_sExpName,pTreeExp->GetName(),32);//存储公式名
}
((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->SetValue(pNew);
}
CWnd* pwnd = GetParent();
if (pwnd && pwnd->IsKindOf(RUNTIME_CLASS(CDlgStrategyMain)))
{
CDlgStrategyMain *pMain = (CDlgStrategyMain*)pwnd;
pMain->m_bHQOK = TRUE;
}
OnCancel();
return ;
_Exit:
::MessageBox( m_hWnd,_T(" 请选择一个公式! "),_T(" 提示 "), MB_OK);
return ;
}
示例3: 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;
//.........这里部分代码省略.........
示例4: LoadCurExp
long CDlgStrategyHQ::LoadCurExp(WPARAM wParam /*= 0*/, LPARAM lParam /*= 0*/)
{
CDlgFormulaMan* pParentDlg = (CDlgFormulaMan*)AfxGetMainWnd();
if( pParentDlg == NULL )
return 0;
EnableItem(FALSE);
if( wParam == CCompileEditView::UpdateExpress )
{
CDlgFormulaEdit* pDlg = pParentDlg->GetExpDlg();
if( pDlg != NULL )
{
if(pDlg->SendMessage(HX_USER_LOADCUR,wParam,lParam))
{
pParentDlg->Enable(FALSE);
pDlg->ShowWindow(SW_SHOWNORMAL);
}
}
}
else if( wParam == HX_EXPRESSSENTENCE )
{
//EnableItem(FALSE);
CExpression* pExpression = (CExpression*)lParam;
if( pExpression == NULL )
return 0;
CString csName = pExpression->GetName();
CString cExpName = m_pStrategy->m_sExpName;
if (m_bSetVar && csName == cExpName && m_pStrategy->m_pData->m_pCurVal)
{
CExpression *pex = ((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->GetExp();
if (pex)//设置参数
{
CMapVariabile *pMap = pExpression->GetParamVar();
CMapVariabile *pMv = pex->GetParamVar();
//--------------------------------------------------
if (pMv && pMap)
{
CString key;
CValue *cvalue;
CValue *pval;
POSITION pos;
pos = pMv->GetStartPosition();
while(pos)
{
pMv->GetNextAssoc(pos,key,cvalue);
if (pMap->Lookup(key,pval))
{
((CNumericValue*)pval)->SetValueOnly(cvalue->GetValue());
}
}
//=====================================================================
}
}
}
CString cs = pExpression->GetName();
m_EditEidolon.ShowWindow(SW_SHOW);
CDlgNotesAndEidolon* pDlgNotes = pParentDlg->GetDlgNotes();
CDlgNotesAndEidolon* pDlgParam = pParentDlg->GetDlgParam();
if( pDlgNotes != NULL &&
pDlgNotes->IsWindowVisible() )
{
pDlgNotes->SetNotes(pExpression->GetNotes(), pExpression->GetName());
}
if( m_EditEidolon.m_hWnd != NULL )
{
CString strText;
strText.Format("%s",pExpression->GetEidolon());
if( !strText.IsEmpty() )
{
m_EditEidolon.SetText(strText,pExpression->GetParamVar(),FALSE);
}
else
{
CStringArray* pArray = pExpression->GetDefEidolon();
if(pArray->GetSize() <= 1)
{
pArray = NULL;
}
m_EditEidolon.SetText(pArray,pExpression->GetParamVar(),FALSE);
}
m_EditEidolon.Invalidate();
}
}
return 0;
}