策略为王源代码分析-股票列表(SListView.cpp)-自选股

Published

主菜单消息及处理函数

G:\stock\TskingVS2019\src\Client\StkUI\MainFrm.cpp

////////////////////////////////////////////////////////////////////////////////
// “列表”菜单
// 股票列表
void CMainFrame::OnSlistIndex() { AfxShowSlist(CStockContainer::typeIndex); } //指数类列表 消息响应函数的实现 by freeman
void CMainFrame::OnSlistStrategy() { AfxShowSlist(CStockContainer::typeStrategy); }
void CMainFrame::OnSlistGroup() { AfxShowSlist(CStockContainer::typeGroup); }
void CMainFrame::OnSlistGroupself()
{
	CString	strSelf;
	strSelf.LoadString(IDS_DOMAIN_SELF);
	AfxShowSlist(CStockContainer::typeGroup, strSelf);
}

G:\stock\TskingVS2019\src\Client\StkUI\AfxCore.inl

//股票类列表 股票数据选择 by freeman
_AFXCORE_INLINE void AfxShowSlist( int nType, LPCTSTR lpszDomain, DWORD dwDate )
{
	CSListView	* pSListView = AfxGetSListView( );
	if( pSListView )
	{
		pSListView->SetCurrentStatus( nType, lpszDomain, dwDate );
		AfxSwitchToStaticView( RUNTIME_CLASS(CSListView) );
	}
	else
	{
		AfxSwitchToStaticView( RUNTIME_CLASS(CSListView) );
		pSListView = AfxGetSListView( );
		if( pSListView )
			pSListView->SetCurrentStatus( nType, lpszDomain, dwDate );
	}
}

G:\stock\TskingVS2019\src\Client\StkUI\MainFrm.cpp

void CSListView::SetCurrentStatus(int nType, LPCTSTR lpszDomain, DWORD dwDate)
{
	AfxGetSListStockContainer().RetrieveFromStatic(nType, lpszDomain, AfxGetActiveStrategy(), dwDate);
	OnUpdate(NULL, UPDATE_HINT_SLISTVIEW, NULL);

	/*CMainFrame	* pFrame = AfxGetMainFrame();
	if (pFrame)
		pFrame->m_DateBox.SetCurrentWindowText();*/
}