当前位置: 首页>>代码示例>>C++>>正文


C++ CExpression::GetName方法代码示例

本文整理汇总了C++中CExpression::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpression::GetName方法的具体用法?C++ CExpression::GetName怎么用?C++ CExpression::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CExpression的用法示例。


在下文中一共展示了CExpression::GetName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DeleteCurExp

long CCompileEditView::DeleteCurExp(WPARAM wParam /*= 0*/, LPARAM lParam /*= 0*/)
{
	HSTreeToCompileEdit* pppData = (HSTreeToCompileEdit*)lParam;
	if(pppData == NULL)
		return 0;

	CTreeGroup* pTreeGroup = (CTreeGroup*)pppData->m_pName;
	if(pTreeGroup != NULL)
	{
		CExpression* pExpress = pTreeGroup->GetData();
		if(pExpress != NULL)
		{
			CString strName;
			strName.Format("%s",pExpress->GetName());

			CValue* pValoare;
			if ( m_pExternExpression->Lookup(strName,pExpress->GetExpressType(),pValoare) )
			{
				if( !pExpress->GetPWD().IsEmpty() ) // 有密码
				{
					CInputPassPwD dlg(this,_T("请输入公式密码"),strName);
					dlg.m_pExp = pExpress;
					if( dlg.DoModal() == IDCANCEL )
					{
						return 2;
					}
				}
				if( wParam )
				{
					m_pExternExpression->RemoveKey(strName,pExpress->GetExpressType());
					delete pValoare;
				}
			}

			if(m_pwndDlgMainBar != NULL)
			{
				CComboBox* pCombox = (CComboBox*)m_pwndDlgMainBar->GetDlgItem(IDC_NAMECOMBO);
				if(pCombox != NULL)
				{
					int nIndex = pCombox->FindString( 0, strName );
					if(nIndex != -1)
					{
						pCombox->DeleteString( nIndex );
					}
				}
			}
		}
	}
	else
	{
	}

	if(m_hExpressInTreePos == (HTREEITEM)pppData->m_pData)
	{
		OnNewExpress();
	}

	return 0;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:59,代码来源:CompileEditView.cpp

示例2: OnLvnItemActivateResultlist

void CDlgFormulaFind::OnLvnItemActivateResultlist(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
	DWORD dwData = m_wndResultList.GetItemData(pNMIA->iItem);
	//发双击在K线处显示消息
	//双击指标 将指标发送回外部
	if(m_pParentWnd != NULL)
	{
		m_pParentWnd->SendMessage(HX_USER_DRAGDATA,
			HSCurKeyInfo::UpdateExpressData/*HX_USER_DRAGDATA-1*/, (LPARAM)dwData);

		if( !m_pParentWnd->IsZoomed() && !m_pParentWnd->IsIconic() )
		{
			CRect rect,rcDes,rcThis;
			CWnd* pDesWnd = GetDesktopWindow();
			if( pDesWnd )
			{
				pDesWnd->GetWindowRect(rcDes);
			}
			m_pParentWnd->GetWindowRect(rect);
			this->GetWindowRect(rcThis);
			if( rect.right + rcThis.Width() > rcDes.right )
				rect.right = rcDes.right - rcThis.Width();
			this->SetWindowPos(NULL,rect.right,rcThis.top,0,0,SWP_NOSIZE);
		}
		//m_pParentWnd->SetFocus();
	}
	else
	{
		CExpression* pExpression = (CExpression*)dwData;
		ExpPropery NameProp;
		NameProp.m_dExpType = pExpression->GetExpressType();
		NameProp.m_strName.Format("%s", pExpression->GetName());
		NameProp.m_strDescribe.Format("%s",  pExpression->GetDescribe());
		NameProp.m_bStyle = pExpression->GetStyle();		
		if ( g_pFormulaMan )
			g_pFormulaMan->SendLinkMsg(DiagramMsg_FormulaParamChanged, (LPARAM)&NameProp);
	}
	*pResult = 0;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:40,代码来源:DlgFormulaFind.cpp

示例3: LoadCurExp


//.........这里部分代码省略.........

				m_wndCon.ResetContent();
				CDlgCondition::InitCWData(&m_wndCon,YLS_GB_GUBEN_NAME);
				CDlgCondition::InitCWData(&m_wndCon,YLS_Cj_GUBEN_NAME);

				CDlgCondition::InitCondition(&m_wndCompare,4);
			}
		}
	}
	else if( wParam == CCompileEditView::UpdateExpress )
	{
		CDlgFormulaEdit* pDlg = pParentDlg->GetExpDlg();
		if( pDlg != NULL )
		{
			if(pDlg->SendMessage(HX_USER_LOADCUR,wParam,lParam))
			{
				pParentDlg->Enable(FALSE);
				pDlg->ShowWindowEx(SW_SHOWNORMAL);
			}
		}
	}
	else if( wParam == HX_EXPRESSSENTENCE )
	{
		//EnableItem(FALSE);

		CExpression* pExpression = (CExpression*)lParam;
		if( pExpression == NULL )
			return 0;

		//
		if(m_nType == 1)
		{
			m_sSingleSel.m_nType = pExpression->GetExpressType();
			m_sSingleSel.m_strExp.Format("%s",pExpression->GetName());
			CDlgCondition::InitCondition(&m_wndCompare,-1);

			switch ( m_sSingleSel.m_nType )
			{
			case CExpression::Tech:
				{
					//"选出技术指标数值满足下列条件的股票:");

					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_SHOW);
 					m_wndConNotes.SetWindowText(HS_LANGUAGE("指标线"));
					m_wndCon.ShowWindow(SW_SHOW);
					m_wndCon.ResetContent();
					m_wndStaticCon.ShowWindow(SW_SHOW);

					m_wndCompare.ShowWindow(SW_SHOW);
					m_wndData1.ShowWindow(SW_SHOW);

					CValue* valoare = NULL;
					if( CExpression::m_pExternExpression->Lookup(pExpression->GetName(),pExpression->GetExpressType(),valoare) ) // over
					{
						CExpValue* pExpValue = (CExpValue*)valoare;
开发者ID:hefen1,项目名称:XCaimi,代码行数:66,代码来源:DlgStrategyParamConf.cpp

示例4: 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;
//.........这里部分代码省略.........
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:CompileEditView.cpp

示例5: Compile


//.........这里部分代码省略.........
			pExpresie->SetDescribe(strText);
		}
		pWnd = pDlg->GetDlgItem(IDC_PWDEDIT);        // 密码
		if(pWnd != NULL && !(pWnd->GetStyle() & WS_DISABLED) )
		{
			pWnd->GetWindowText(strText);
			pExpresie->SetPWD(strText);
		}
		
		if(pDlg->m_pDlgNotes != NULL)  // 注释
		{
			strText = pDlg->m_pDlgNotes->GetText();
			pExpresie->SetNotes(strText); 
		}
		
		if( pDlg->m_pDlgEidolon )       // 参数精灵
		{
			strText = pDlg->m_pDlgEidolon->GetText();
			pExpresie->SetEidolon(strText);
		}

		if( m_pEstopPeriodDlg != NULL )
		{
			*pExpresie->GetEstopPeriod()   = m_pEstopPeriodDlg->GetEstopPeriod();   // 禁用周期
			*pExpresie->GetDefaultPeriod() = m_pEstopPeriodDlg->GetDefaultPeriod(); // 缺省周期
		}

		// 更新树
		if( pDlg->m_pFormulaMan != NULL )
		{
			pHxTreeCtrl = pDlg->m_pFormulaMan->GetCurTree((WORD)pDlg->m_nExpressType);
			if(pHxTreeCtrl != NULL)
			{
				//pExpresie->SetExpressType(pHxTreeCtrl->GetType());

				if(pValoare != NULL)
				{	
					//pHxTreeCtrl->UpdateTreeItemData(pValoare,pValue);
				}
				else
				{
					if(pDlg != NULL)
					{
						pDlg->SetTitle(pExpresie->GetExpressType(),strName);
					}

					pHxTreeCtrl->AddItem(strName,pValue,m_pExternExpression);

					if( pDlg->IsType(CDlgFormulaEdit::NewExp) )
					{
						pDlg->m_strOldName = strName;
						pExpresie->AddStyle(HS_EXP_USEREDIT);
						pDlg->SetType(CDlgFormulaEdit::Update | pDlg->IsType(CDlgFormulaEdit::SpeedNew));
					}
				}
			}
		}

		// 更新绘图窗口
		ExpPropery NameProp;
		NameProp.m_dExpType = pExpresie->GetExpressType();
		NameProp.m_strName.Format("%s", pExpresie->GetName());
		NameProp.m_strDescribe.Format("%s",  pExpresie->GetDescribe());
		NameProp.m_bStyle = pExpresie->GetStyle();
		if ( g_pFormulaMan )
			g_pFormulaMan->SendLinkMsg(DiagramMsg_FormulaParamChanged,(LPARAM)&NameProp);

		if(pPromptWnd != NULL)
		{
			pPromptWnd->SendMessage(HX_USER_COMPILE_INFO,0,0);
			//pPromptWnd->SetWindowText(strErroText);
		}

		m_pParentDlg->ShowResult(CDlgFormulaEdit::CompileResult);
		::SendMessage(g_hParentWnd,g_SendReLoadTabItemMsg,0,0); //qinhn 20090721 Add 重新载入T指标ab页,防止点修改公式对话框里面的"保存"后出错
		
		return (long)pExpresie;
	}
	else
	{
		/*strErroText = "公式有几个错误!";
		if(pBtError != NULL)
		{
			pBtError->EnableWindow(TRUE);
		}
		if(pPromptWnd != NULL)
		{
			pPromptWnd->SetWindowText(strErroText);
		}*/

		//AddCompileInfotoList(11,(LPARAM)&info);


		m_pParentDlg->ShowResult(CDlgFormulaEdit::CompileResult);

		delete pExpresie;
	}

	return 0;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:CompileEditView.cpp

示例6: 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 ;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:101,代码来源:DlgStrategyHQ.cpp

示例7: 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;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:90,代码来源:DlgStrategyHQ.cpp


注:本文中的CExpression::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。