123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- // YkCmdDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "IDE.h"
- #include "YkCmdDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CYkCmdDlg dialog
- CYkCmdDlg::CYkCmdDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CYkCmdDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CYkCmdDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- m_strValue = "";
- }
- void CYkCmdDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CYkCmdDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CYkCmdDlg, CDialog)
- //{{AFX_MSG_MAP(CYkCmdDlg)
- ON_BN_CLICKED(IDC_BUTTON_OFF, OnButtonOff)
- ON_BN_CLICKED(IDC_BUTTON_ON, OnButtonOn)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CYkCmdDlg message handlers
- BOOL CYkCmdDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- int nPos = m_strValue.Find( "-" );
- m_sOn = m_strValue.Left( nPos );
- m_sOff = m_strValue.Right( m_strValue.GetLength()-nPos-1 );
- return TRUE;
- }
- void CYkCmdDlg::OnButtonOff()
- {
- m_strValue = m_sOff;
- CDialog::OnOK();
- }
- void CYkCmdDlg::OnButtonOn()
- {
- m_strValue = m_sOn;
- CDialog::OnOK();
- }
- void CYkCmdDlg::OnCancel()
- {
- CDialog::OnCancel();
- }
|