1 // HMMParams.cpp : implementation file
11 static char THIS_FILE[] = __FILE__;
14 /////////////////////////////////////////////////////////////////////////////
15 // CHMMParams property page
17 IMPLEMENT_DYNCREATE(CHMMParams, CPropertyPage)
19 CHMMParams::CHMMParams() : CPropertyPage(CHMMParams::IDD)
21 m_States[0] = 5;//superstate
31 //{{AFX_DATA_INIT(CHMMParams)
36 CHMMParams::~CHMMParams()
40 void CHMMParams::DoDataExchange(CDataExchange* pDX)
42 CPropertyPage::DoDataExchange(pDX);
43 //{{AFX_DATA_MAP(CHMMParams)
44 DDX_Text(pDX, IDC_NUMIX, m_NumMix);
45 DDX_Text(pDX, IDC_EDIT1, m_States[1]);
46 DDX_Text(pDX, IDC_EDIT2, m_States[2]);
47 DDX_Text(pDX, IDC_EDIT3, m_States[3]);
48 DDX_Text(pDX, IDC_EDIT4, m_States[4]);
49 DDX_Text(pDX, IDC_EDIT5, m_States[5]);
50 DDX_Text(pDX, IDC_EDIT6, m_States[6]);
51 DDX_Text(pDX, IDC_EDIT7, m_States[7]);
52 DDV_MinMaxInt(pDX, m_NumMix, 0, 255);
57 BEGIN_MESSAGE_MAP(CHMMParams, CPropertyPage)
58 //{{AFX_MSG_MAP(CHMMParams)
62 /////////////////////////////////////////////////////////////////////////////
63 // CHMMParams message handlers
65 BOOL CHMMParams::OnInitDialog()
67 CPropertyPage::OnInitDialog();
70 for( int i = 0; i < 7; i++ )
72 BOOL enable = i < m_States[0];
73 ((CButton*)GetDlgItem( IDC_CHECK1 + i ))->SetCheck( enable );
74 GetDlgItem( IDC_EDIT1 + i )->EnableWindow( enable );
77 // TODO: Add extra initialization here
79 return TRUE; // return TRUE unless you set the focus to a control
80 // EXCEPTION: OCX Property Pages should return FALSE
83 BOOL CHMMParams::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
85 // TODO: Add your specialized code here and/or call the base class
86 if ( (nID >= IDC_CHECK1) && (nID <= IDC_CHECK7) )
88 int offset = nID - IDC_CHECK1;
91 enable = ((CButton*)GetDlgItem( nID ))->GetCheck();
96 for( int i = 0 ; i <= offset; i++ )
98 ((CButton*)GetDlgItem( IDC_CHECK1 + i ))->SetCheck( enable );
99 GetDlgItem( IDC_EDIT1 + i )->EnableWindow( enable );
101 m_States[0] = offset+1;
104 else //disable all consequtive
106 for( int i = offset ; i < 7; i++ )
108 ((CButton*)GetDlgItem( IDC_CHECK1 + i ))->SetCheck( enable );
109 GetDlgItem( IDC_EDIT1 + i )->EnableWindow( enable );
111 m_States[0] = offset;
117 return CPropertyPage::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);