📄 setparamdlg.cpp.svn-base
字号:
// SetParamDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SetParamDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTechComboBox
BOOL CTechComboBox::Initialize( )
{
ResetContent();
for( int nTech = STT_MIN; nTech < STT_MAX; nTech ++ )
{
int nIndex = AddString( AfxGetSTTFullName(nTech) );
SetItemData( nIndex, nTech );
}
SetCurSel( 0 );
return TRUE;
}
BOOL CTechComboBox::Select( int nTech )
{
for( int i=0; i<GetCount(); i++ )
{
if( ((UINT)nTech) == GetItemData(i) )
{
SetCurSel(i);
return TRUE;
}
}
return FALSE;
}
int CTechComboBox::GetSelect( )
{
int nSel = GetCurSel();
if( CB_ERR == nSel )
return STT_MIN;
int nTech = GetItemData(nSel);
if( nTech >= STT_MIN && nTech <= STT_MAX )
return nTech;
return STT_MIN;
}
/////////////////////////////////////////////////////////////////////////////
// CKTypeComboBox
BOOL CKTypeComboBox::Initialize( )
{
ResetContent();
int ktype, nIndex, nSel = CB_ERR;
ktype = CKData::ktypeMin5;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin15;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin30;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMin60;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeDay;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
nSel = nIndex;
ktype = CKData::ktypeWeek;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMonth;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
SetCurSel( nSel );
return TRUE;
}
BOOL CKTypeComboBox::InitializeDayMin5( )
{
ResetContent();
int ktype, nIndex, nSel = CB_ERR;
ktype = CKData::ktypeMin5;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeDay;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
nSel = nIndex;
SetCurSel( nSel );
return TRUE;
}
BOOL CKTypeComboBox::InitializeDay( )
{
ResetContent();
int ktype, nIndex, nSel = CB_ERR;
ktype = CKData::ktypeDay;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
nSel = nIndex;
ktype = CKData::ktypeWeek;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
ktype = CKData::ktypeMonth;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
SetCurSel( nSel );
return TRUE;
}
BOOL CKTypeComboBox::InitializeWeek( )
{
ResetContent();
int ktype, nIndex, nSel = CB_ERR;
ktype = CKData::ktypeWeek;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
nSel = nIndex;
ktype = CKData::ktypeMonth;
nIndex = AddString( AfxGetKTypeString(ktype) );
SetItemData( nIndex, ktype );
SetCurSel( nSel );
return TRUE;
}
BOOL CKTypeComboBox::Select( int nKType )
{
for( int i=0; i<GetCount(); i++ )
{
if( ((UINT)nKType) == GetItemData(i) )
{
SetCurSel(i);
return TRUE;
}
}
return FALSE;
}
int CKTypeComboBox::GetSelect( )
{
int nSel = GetCurSel();
if( CB_ERR == nSel )
return CKData::ktypeDay;
int nKType = GetItemData(nSel);
if( nKType >= CKData::ktypeMin && nKType <= CKData::ktypeMax )
return nKType;
return CKData::ktypeDay;
}
/////////////////////////////////////////////////////////////////////////////
// CIntensityComboBox
BOOL CIntensityComboBox::InitializeGate( )
{
ResetContent();
int nSignal, nIndex, nSel = CB_ERR;
for( nSignal = ITS_MAX; nSignal >= ITS_MIN; nSignal -- )
{
if( ITSG_BUYINTENSE != nSignal && ITSG_BUY != nSignal && ITSG_BUYFEEBLE != nSignal && ITS_NOTHING != nSignal
&& ITSG_SELLINTENSE != nSignal && ITSG_SELL != nSignal && ITSG_SELLFEEBLE != nSignal )
continue;
nIndex = AddString( AfxGetIntensityString(nSignal) );
SetItemData( nIndex, nSignal );
if( ITS_NOTHING == nSignal )
nSel = nIndex;
}
SetCurSel( nSel );
return TRUE;
}
BOOL CIntensityComboBox::Initialize( )
{
ResetContent();
int nSignal, nIndex, nSel = CB_ERR;
for( nSignal = ITS_MAX; nSignal >= ITS_MIN; nSignal -- )
{
if( ITS_BUYINTENSE != nSignal && ITS_BUY != nSignal && ITS_BUYFEEBLE != nSignal && ITS_NOTHING != nSignal
&& ITS_SELLINTENSE != nSignal && ITS_SELL != nSignal && ITS_SELLFEEBLE != nSignal )
continue;
nIndex = AddString( AfxGetIntensityString(nSignal) );
SetItemData( nIndex, nSignal );
if( ITS_NOTHING == nSignal )
nSel = nIndex;
}
SetCurSel( nSel );
return TRUE;
}
BOOL CIntensityComboBox::Select( UINT nITS )
{
for( int i=0; i<GetCount(); i++ )
{
if( nITS == GetItemData(i) )
{
SetCurSel(i);
return TRUE;
}
}
return FALSE;
}
BOOL CIntensityComboBox::ResetAndSelect( UINT nITS )
{
Initialize( );
return Select( nITS );
}
int CIntensityComboBox::GetSelect( )
{
int nSel = GetCurSel();
if( CB_ERR == nSel )
return ITS_NOTHING;
int nITS = GetItemData(nSel);
if( nITS >= ITS_MIN && nITS <= ITS_MAX )
return nITS;
return ITS_NOTHING;
}
/////////////////////////////////////////////////////////////////////////////
// ParamHelp
void ParamHelp( UINT nTech )
{
CString strTech = AfxGetSTTShortName( nTech );
if( !strTech.IsEmpty() )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -