A Fast Bresenham Type Algorithm For Drawing Ellipses by John Kennedy
[xy_vsfilter.git] / src / apps / mplayerc / SaveThumbnailsDialog.cpp
blob3bc269fd7f213edeecabf49e65f2db0ea6725101
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 // SaveThumbnailsDialog.cpp : implementation file
25 #include "stdafx.h"
26 #include "mplayerc.h"
27 #include "SaveThumbnailsDialog.h"
30 // CSaveThumbnailsDialog
32 IMPLEMENT_DYNAMIC(CSaveThumbnailsDialog, CFileDialog)
33 CSaveThumbnailsDialog::CSaveThumbnailsDialog(
34 int rows, int cols, int width,
35 LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
36 LPCTSTR lpszFilter, CWnd* pParentWnd) :
37 CFileDialog(FALSE, lpszDefExt, lpszFileName,
38 OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
39 lpszFilter, pParentWnd, 0),
40 m_rows(rows), m_cols(cols), m_width(width)
42 if(m_ofn.lStructSize == sizeof(OPENFILENAME))
44 SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL);
46 else /*if(m_ofn.lStructSize == OPENFILENAME_SIZE_VERSION_400)*/
48 SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL_400);
52 CSaveThumbnailsDialog::~CSaveThumbnailsDialog()
56 void CSaveThumbnailsDialog::DoDataExchange(CDataExchange* pDX)
58 DDX_Control(pDX, IDC_SPIN1, m_rowsctrl);
59 DDX_Control(pDX, IDC_SPIN2, m_colsctrl);
60 DDX_Control(pDX, IDC_SPIN3, m_widthctrl);
61 __super::DoDataExchange(pDX);
64 BOOL CSaveThumbnailsDialog::OnInitDialog()
66 __super::OnInitDialog();
68 m_rowsctrl.SetRange(1, 8);
69 m_colsctrl.SetRange(1, 8);
70 m_widthctrl.SetRange(256, 2048);
71 m_rowsctrl.SetPos(m_rows);
72 m_colsctrl.SetPos(m_cols);
73 m_widthctrl.SetPos(m_width);
75 return TRUE; // return TRUE unless you set the focus to a control
76 // EXCEPTION: OCX Property Pages should return FALSE
79 BEGIN_MESSAGE_MAP(CSaveThumbnailsDialog, CFileDialog)
80 END_MESSAGE_MAP()
82 // CSaveThumbnailsDialog message handlers
84 BOOL CSaveThumbnailsDialog::OnFileNameOK()
86 m_rows = m_rowsctrl.GetPos();
87 m_cols = m_colsctrl.GetPos();
88 m_width = m_widthctrl.GetPos();
90 return __super::OnFileNameOK();