📄 setrule.cpp.svn-base
字号:
if( !ValidData( ) )
return -1L;
StoreData( );
return CPropertyPageEx::OnWizardBack();
}
LRESULT CSetRule::OnWizardNext()
{
// TODO: Add your specialized code here and/or call the base class
UpdateData( );
if( !ValidData( ) )
return -1L;
StoreData( );
return CPropertyPageEx::OnWizardNext();
}
BOOL CSetRule::OnWizardFinish()
{
// Add your specialized code here and/or call the base class
UpdateData( );
if( !ValidData( ) )
return FALSE;
StoreData( );
return CPropertyPageEx::OnWizardFinish();
}
void CSetRule::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
UpdateData( );
if( !ValidData( ) )
return;
StoreData( );
CPropertyPageEx::OnOK();
}
void CSetRule::OnAlldefault()
{
// TODO: Add your control notification handler code here
if( m_pTechParameters )
{
m_pTechParameters->SetDefaultParametersAll( );
}
if( m_pParamDlg && ::IsWindow(m_pParamDlg->GetSafeHwnd()) )
{
m_pParamDlg->RefreshData( FALSE );
}
}
void CSetRule::OnSelchangingTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
if( m_pParamDlg && ::IsWindow(m_pParamDlg->GetSafeHwnd()) )
{
if( !m_pParamDlg->RefreshData( TRUE ) )
{
AfxMessageBox( IDS_SETPARAM_INVALID, MB_OK | MB_ICONINFORMATION );
*pResult = -1;
return;
}
m_pParamDlg->OnCmdMsg( IDOK, 0, NULL, NULL );
delete m_pParamDlg;
m_pParamDlg = NULL;
}
*pResult = 0;
}
void CSetRule::OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
if( NULL == m_pTechParameters )
{
*pResult = 0;
return;
}
HTREEITEM hSelItem = m_tree.GetSelectedItem();
if( hSelItem )
{
DWORD dwData = m_tree.GetItemData( hSelItem );
if( !( (dwData >= STT_MIN && dwData <= STT_MAX) || dwData >= STT_USER_MIN ) )
return;
CTechParameters & param = (*m_pTechParameters);
switch( dwData )
{
case STT_MA: m_pParamDlg = new CMADlg(NULL,&(param.ma)); m_pParamDlg->Create( CMADlg::IDD, this ); break;
case STT_BBI: m_pParamDlg = new CBBIDlg(NULL,&(param.bbi)); m_pParamDlg->Create( CBBIDlg::IDD, this ); break;
case STT_BOLL: m_pParamDlg = new CBOLLDlg(NULL,&(param.boll)); m_pParamDlg->Create( CBOLLDlg::IDD, this ); break;
case STT_PV: m_pParamDlg = new CPVDlg(NULL,&(param.pv)); m_pParamDlg->Create( CPVDlg::IDD, this ); break;
case STT_SAR: m_pParamDlg = new CSARDlg(NULL,&(param.sar)); m_pParamDlg->Create( CSARDlg::IDD, this ); break;
case STT_DJ: m_pParamDlg = new CDJDlg(NULL,&(param.dj)); m_pParamDlg->Create( CDJDlg::IDD, this ); break;
case STT_CW: m_pParamDlg = new CCWDlg(NULL,&(param.cw)); m_pParamDlg->Create( CCWDlg::IDD, this ); break;
case STT_MACD: m_pParamDlg = new CMACDDlg(NULL,&(param.macd)); m_pParamDlg->Create( CMACDDlg::IDD, this ); break;
case STT_MIKE: m_pParamDlg = new CMIKEDlg(NULL,&(param.mike)); m_pParamDlg->Create( CMIKEDlg::IDD, this ); break;
case STT_PSY: m_pParamDlg = new CPSYDlg(NULL,&(param.psy)); m_pParamDlg->Create( CPSYDlg::IDD, this ); break;
case STT_VOLUME: m_pParamDlg = new CVOLUMEDlg(NULL,&(param.volume)); m_pParamDlg->Create( CVOLUMEDlg::IDD, this ); break;
case STT_NVI: m_pParamDlg = new CNVIDlg(NULL,&(param.nvi)); m_pParamDlg->Create( CNVIDlg::IDD, this ); break;
case STT_PVI: m_pParamDlg = new CPVIDlg(NULL,&(param.pvi)); m_pParamDlg->Create( CPVIDlg::IDD, this ); break;
case STT_VR: m_pParamDlg = new CVRDlg(NULL,&(param.vr)); m_pParamDlg->Create( CVRDlg::IDD, this ); break;
case STT_VROC: m_pParamDlg = new CVROCDlg(NULL,&(param.vroc)); m_pParamDlg->Create( CVROCDlg::IDD, this ); break;
case STT_OBV: m_pParamDlg = new COBVDlg(NULL,&(param.obv)); m_pParamDlg->Create( COBVDlg::IDD, this ); break;
case STT_MOBV: m_pParamDlg = new CMOBVDlg(NULL,&(param.mobv)); m_pParamDlg->Create( CMOBVDlg::IDD, this ); break;
case STT_MFI: m_pParamDlg = new CMFIDlg(NULL,&(param.mfi)); m_pParamDlg->Create( CMFIDlg::IDD, this ); break;
case STT_VMACD: m_pParamDlg = new CVMACDDlg(NULL,&(param.vmacd)); m_pParamDlg->Create( CVMACDDlg::IDD, this ); break;
case STT_WVAD: m_pParamDlg = new CWVADDlg(NULL,&(param.wvad)); m_pParamDlg->Create( CWVADDlg::IDD, this ); break;
case STT_EMV: m_pParamDlg = new CEMVDlg(NULL,&(param.emv)); m_pParamDlg->Create( CEMVDlg::IDD, this ); break;
case STT_VRSI: m_pParamDlg = new CVRSIDlg(NULL,&(param.vrsi)); m_pParamDlg->Create( CVRSIDlg::IDD, this ); break;
case STT_NVRSI: m_pParamDlg = new CNVRSIDlg(NULL,&(param.nvrsi)); m_pParamDlg->Create( CNVRSIDlg::IDD, this ); break;
case STT_AD: m_pParamDlg = new CADDlg(NULL,&(param.ad)); m_pParamDlg->Create( CADDlg::IDD, this ); break;
case STT_CI: m_pParamDlg = new CCIDlg(NULL,&(param.ci)); m_pParamDlg->Create( CCIDlg::IDD, this ); break;
case STT_KDJ: m_pParamDlg = new CKDJDlg(NULL,&(param.kdj)); m_pParamDlg->Create( CKDJDlg::IDD, this ); break;
case STT_R: m_pParamDlg = new CRDlg(NULL,&(param.r)); m_pParamDlg->Create( CRDlg::IDD, this ); break;
case STT_RSI: m_pParamDlg = new CRSIDlg(NULL,&(param.rsi)); m_pParamDlg->Create( CRSIDlg::IDD, this ); break;
case STT_BIAS: m_pParamDlg = new CBIASDlg(NULL,&(param.bias)); m_pParamDlg->Create( CBIASDlg::IDD, this ); break;
case STT_MTM: m_pParamDlg = new CMTMDlg(NULL,&(param.mtm)); m_pParamDlg->Create( CMTMDlg::IDD, this ); break;
case STT_DMI: m_pParamDlg = new CDMIDlg(NULL,&(param.dmi)); m_pParamDlg->Create( CDMIDlg::IDD, this ); break;
case STT_ROC: m_pParamDlg = new CROCDlg(NULL,&(param.roc)); m_pParamDlg->Create( CROCDlg::IDD, this ); break;
case STT_CCI: m_pParamDlg = new CCCIDlg(NULL,&(param.cci)); m_pParamDlg->Create( CCCIDlg::IDD, this ); break;
case STT_CV: m_pParamDlg = new CCVDlg(NULL,&(param.cv)); m_pParamDlg->Create( CCVDlg::IDD, this ); break;
case STT_ARBR: m_pParamDlg = new CARBRDlg(NULL,&(param.arbr)); m_pParamDlg->Create( CARBRDlg::IDD, this ); break;
case STT_CR: m_pParamDlg = new CCRDlg(NULL,&(param.cr)); m_pParamDlg->Create( CCRDlg::IDD, this ); break;
case STT_OSC: m_pParamDlg = new COSCDlg(NULL,&(param.osc)); m_pParamDlg->Create( COSCDlg::IDD, this ); break;
case STT_UOS: m_pParamDlg = new CUOSDlg(NULL,&(param.uos)); m_pParamDlg->Create( CUOSDlg::IDD, this ); break;
case STT_MAOSC: m_pParamDlg = new CMAOSCDlg(NULL,&(param.maosc)); m_pParamDlg->Create( CMAOSCDlg::IDD, this ); break;
case STT_36BIAS: m_pParamDlg = new C36BIASDlg(NULL,&(param.bias36)); m_pParamDlg->Create( C36BIASDlg::IDD, this ); break;
case STT_DPO: m_pParamDlg = new CDPODlg(NULL,&(param.dpo)); m_pParamDlg->Create( CDPODlg::IDD, this ); break;
case STT_KST: m_pParamDlg = new CKSTDlg(NULL,&(param.kst)); m_pParamDlg->Create( CKSTDlg::IDD, this ); break;
case STT_REI: m_pParamDlg = new CREIDlg(NULL,&(param.rei)); m_pParamDlg->Create( CREIDlg::IDD, this ); break;
case STT_DMKI: m_pParamDlg = new CDMKIDlg(NULL,&(param.dmki)); m_pParamDlg->Create( CDMKIDlg::IDD, this ); break;
case STT_PCNT: m_pParamDlg = new CPCNTDlg(NULL,&(param.pcnt)); m_pParamDlg->Create( CPCNTDlg::IDD, this ); break;
case STT_HLC: m_pParamDlg = new CHLCDlg(NULL,&(param.hlc)); m_pParamDlg->Create( CHLCDlg::IDD, this ); break;
case STT_CDP: m_pParamDlg = new CCDPDlg(NULL,&(param.cdp)); m_pParamDlg->Create( CCDPDlg::IDD, this ); break;
case STT_ASI: m_pParamDlg = new CASIDlg(NULL,&(param.asi)); m_pParamDlg->Create( CASIDlg::IDD, this ); break;
case STT_ATR: m_pParamDlg = new CATRDlg(NULL,&(param.atr)); m_pParamDlg->Create( CATRDlg::IDD, this ); break;
case STT_CYO: m_pParamDlg = new CCYODlg(NULL,&(param.cyo)); m_pParamDlg->Create( CCYODlg::IDD, this ); break;
case STT_DCYO: m_pParamDlg = new CDCYODlg(NULL,&(param.dcyo)); m_pParamDlg->Create( CDCYODlg::IDD, this ); break;
case STT_HSL: m_pParamDlg = new CHSLDlg(NULL,&(param.hsl)); m_pParamDlg->Create( CHSLDlg::IDD, this ); break;
case STT_DPER: m_pParamDlg = new CDPERDlg(NULL,&(param.dper)); m_pParamDlg->Create( CDPERDlg::IDD, this ); break;
default:
;
}
if( m_pParamDlg && ::IsWindow(m_pParamDlg->GetSafeHwnd()) )
m_pParamDlg->SetWindowPos( NULL, SETRULE_MAINLEFT, SETRULE_MAINTOP, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOACTIVATE );
m_tree.SetFocus();
}
*pResult = 0;
}
void CSetRule::OnClickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
::PostMessage( GetSafeHwnd(), WM_USER_SETRULECLICKTREE, 0, 0 );
*pResult = 0;
}
LRESULT CSetRule::OnSetRuleClickTree(WPARAM wParam, LPARAM lParam)
{
// Check Children same as Class Item
int nCount = 0;
HTREEITEM hItem = m_tree.GetRootItem();
while( hItem )
{
UINT temp1 = m_anClassChecked[nCount];
UINT temp2 = m_tree.GetCheck( hItem );
if( m_anClassChecked[nCount] != (UINT)m_tree.GetCheck( hItem ) )
{
BOOL bChecked = m_tree.GetCheck( hItem );
m_anClassChecked.SetAt( nCount, bChecked );
HTREEITEM hChild = m_tree.GetChildItem( hItem );
while( hChild )
{
m_tree.SetCheck( hChild, bChecked );
hChild = m_tree.GetNextItem( hChild, TVGN_NEXT );
}
}
hItem = m_tree.GetNextItem( hItem, TVGN_NEXT );
nCount ++;
}
// Check Class Item Check according Children
nCount = 0;
hItem = m_tree.GetRootItem();
while( hItem )
{
BOOL bCheckedAll = TRUE;
HTREEITEM hChild = m_tree.GetChildItem( hItem );
while( hChild )
{
if( !m_tree.GetCheck( hChild ) )
bCheckedAll = FALSE;
hChild = m_tree.GetNextItem( hChild, TVGN_NEXT );
}
m_anClassChecked.SetAt( nCount, bCheckedAll );
m_tree.SetCheck( hItem, bCheckedAll );
hItem = m_tree.GetNextItem( hItem, TVGN_NEXT );
nCount ++;
}
return 0L;
}
BOOL CSetRule::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if( WM_KEYDOWN == pMsg->message && VK_RETURN == pMsg->wParam )
return TRUE;
return CPropertyPageEx::PreTranslateMessage(pMsg);
}
BOOL CSetRule::OnSetActive()
{
// TODO: Add your specialized code here and/or call the base class
CPropertySheetEx * pSheet = DYNAMIC_DOWNCAST( CPropertySheetEx, GetParent() );
if( pSheet )
{
pSheet->SetWizardButtons( m_dwButtonFlags );
}
return CPropertyPageEx::OnSetActive();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -