2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
22 // ConvertChapDlg.cpp : implementation file
27 #include "ConvertChapDlg.h"
29 // CConvertChapDlg dialog
31 CConvertChapDlg::CConvertChapDlg(CWnd
* pParent
/*=NULL*/)
32 : CResizableDialog(CConvertChapDlg::IDD
, pParent
)
38 CConvertChapDlg::~CConvertChapDlg()
42 void CConvertChapDlg::DoDataExchange(CDataExchange
* pDX
)
44 __super::DoDataExchange(pDX
);
45 DDX_Text(pDX
, IDC_EDIT1
, m_time
);
46 DDX_Text(pDX
, IDC_EDIT2
, m_name
);
49 BEGIN_MESSAGE_MAP(CConvertChapDlg
, CResizableDialog
)
50 ON_UPDATE_COMMAND_UI(IDOK
, OnUpdateOK
)
54 // CConvertChapDlg message handlers
56 BOOL
CConvertChapDlg::OnInitDialog()
58 __super::OnInitDialog();
60 AddAnchor(IDC_EDIT1
, TOP_LEFT
);
61 AddAnchor(IDC_EDIT2
, TOP_LEFT
, TOP_RIGHT
);
62 AddAnchor(IDOK
, BOTTOM_CENTER
);
63 AddAnchor(IDCANCEL
, BOTTOM_CENTER
);
74 return TRUE
; // return TRUE unless you set the focus to a control
75 // EXCEPTION: OCX Property Pages should return FALSE
78 void CConvertChapDlg::OnOK()
85 void CConvertChapDlg::OnUpdateOK(CCmdUI
* pCmdUI
)
88 GetDlgItem(IDC_EDIT1
)->GetWindowText(str
);
90 pCmdUI
->Enable(3 == _stscanf(str
, _T("%d:%d:%d"), &i
, &i
, &i
)
91 && GetDlgItem(IDC_EDIT2
)->GetWindowTextLength() > 0);