void CFilterInfoDlg::OnAddtogroup() { CSelectGrpDlg dlg; dlg.SetMode( CSelectGrpDlg::modeGroup ); if( IDOK == dlg.DoModal() ) { CString strGrpName = dlg.GetSelectedName(); CDomainContainer & groups = AfxGetGroupContainer(); CSPStringArray astrStocks; astrStocks.SetSize( 0, m_listResult.GetCount() ); for( int i=0; i<m_listResult.GetCount(); i++ ) { CString rString; m_listResult.GetText( i, rString ); if( rString.GetLength() > 0 ) { int nIndex = rString.Find( "(" ); if( -1 != nIndex ) rString = rString.Left(nIndex); astrStocks.Add( rString ); } } groups.AddDomainStock( strGrpName, astrStocks ); } }
int CStkUIApp::OpenDefaultStrategy( ) { CSPStringArray astrStrategyToOpen; // Recent if( m_pRecentFileList ) { for( int i=m_pRecentFileList->GetSize()-1; i>=0; i-- ) { CString strPath = (*m_pRecentFileList)[i]; if( !strPath.IsEmpty() ) astrStrategyToOpen.Add( strPath ); } } // projects CString strExt = AfxGetStrategyFileExt( ); if( !strExt.IsEmpty()) { CFileFind finder; BOOL bWorking = finder.FindFile( AfxGetFilePath( (LPCTSTR)AfxGetProfile().GetProjectPath(), LPCTSTR("*" + strExt) ) ); while( bWorking ) { bWorking = finder.FindNextFile(); CString strPath = finder.GetFilePath(); int i; for( i=0; i<astrStrategyToOpen.GetSize(); i++ ) { if( 0 == strPath.Compare( astrStrategyToOpen.ElementAt(i) ) ) break; } if( i == astrStrategyToOpen.GetSize() ) astrStrategyToOpen.Add( strPath ); } finder.Close(); } AfxGetProfile().SetLastOpenedStrategy( astrStrategyToOpen ); return OpenLastOpenedStrategy( ); }
void CStkUIApp::SaveLastOpenedStrategy( ) { CSPStringArray astr; POSITION pos = GetFirstStrategyPosition(); while(pos != NULL) { CStrategy* pStrategy = GetNextStrategy(pos); if( pStrategy ) astr.Add( pStrategy->GetPathName() ); } AfxGetProfile().SetLastOpenedStrategy( astr ); }
void CSListView::GetSelectedStocks( CSPStringArray & astr ) { CStockContainer & container = AfxGetSListStockContainer(); container.Lock(); int nTotalCount = m_Grid.GetSelectedCount(); astr.RemoveAll(); astr.SetSize( 0, nTotalCount > 10 ? nTotalCount : -1 ); for( int nRow=1; nRow<m_Grid.GetRowCount(); nRow++ ) { BOOL bSelected = FALSE; for( int nCol=0; nCol<m_Grid.GetColumnCount(); nCol ++ ) bSelected |= ( m_Grid.GetItemState(nRow,nCol) & GVIS_SELECTED ); if( !bSelected ) continue; LPARAM id = m_Grid.GetItemData(nRow,0); CStockInfo & info = container.GetStockInfoByID(id); astr.Add( info.GetStockCode() ); } container.UnLock(); }
void AfxGetAllDistrict( CSPStringArray & astr ) { #ifdef CLKLAN_ENGLISH_US astr.SetSize( 0, 30 ); astr.Add( "Australia & NZ" ); astr.Add( "Argentina" ); astr.Add( "Brazil" ); astr.Add( "Canada" ); astr.Add( "China" ); astr.Add( "Denmark" ); astr.Add( "France" ); astr.Add( "Germany" ); astr.Add( "Hong Kong" ); astr.Add( "India" ); astr.Add( "Italy" ); astr.Add( "Japan" ); astr.Add( "Korea" ); astr.Add( "Mexico" ); astr.Add( "Norway" ); astr.Add( "Singapore" ); astr.Add( "Spain" ); astr.Add( "Sweden" ); astr.Add( "Taiwan" ); astr.Add( "UK & Ireland" ); astr.Add( "U.S." ); astr.Add( "Other" ); #else astr.SetSize( 0, 30 ); astr.Add( "澳大利亚" ); astr.Add( "阿根廷" ); astr.Add( "巴西" ); astr.Add( "加拿大" ); astr.Add( "中国" ); astr.Add( "丹麦" ); astr.Add( "法国" ); astr.Add( "德国" ); astr.Add( "中国香港" ); astr.Add( "印度" ); astr.Add( "意大利" ); astr.Add( "日本" ); astr.Add( "韩国" ); astr.Add( "墨西哥" ); astr.Add( "挪威" ); astr.Add( "新加坡" ); astr.Add( "西班牙" ); astr.Add( "瑞典" ); astr.Add( "中国台湾" ); astr.Add( "英国" ); astr.Add( "美国" ); astr.Add( "其他" ); #endif }