A Fast Bresenham Type Algorithm For Drawing Ellipses by John Kennedy
[xy_vsfilter.git] / src / apps / mplayerc / ConvertChapDlg.cpp
blobb77c35bed52ed6d53088f20099b7a05a6db69175
1 /*
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)
8 * any later version.
9 *
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
25 #include "stdafx.h"
26 #include "mplayerc.h"
27 #include "ConvertChapDlg.h"
29 // CConvertChapDlg dialog
31 CConvertChapDlg::CConvertChapDlg(CWnd* pParent /*=NULL*/)
32 : CResizableDialog(CConvertChapDlg::IDD, pParent)
33 , m_time(_T(""))
34 , m_name(_T(""))
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)
51 END_MESSAGE_MAP()
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);
65 CRect r;
66 GetWindowRect(r);
67 CSize s = r.Size();
68 SetMinTrackSize(s);
69 s.cx = 1000;
70 SetMaxTrackSize(s);
72 UpdateData(FALSE);
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()
80 UpdateData();
82 __super::OnOK();
85 void CConvertChapDlg::OnUpdateOK(CCmdUI* pCmdUI)
87 CString str;
88 GetDlgItem(IDC_EDIT1)->GetWindowText(str);
89 int i;
90 pCmdUI->Enable(3 == _stscanf(str, _T("%d:%d:%d"), &i, &i, &i)
91 && GetDlgItem(IDC_EDIT2)->GetWindowTextLength() > 0);