1 /////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 /////////////////////////////////////////////////////////////////////////////
18 * @file ConfirmFolderCopyDlg.cpp
20 * @brief Implementation file for ConfirmFolderCopyDlg dialog
24 #include "ConfirmFolderCopyDlg.h"
26 #include "DDXHelper.h"
31 static char THIS_FILE[] = __FILE__;
35 // ConfirmFolderCopyDlg dialog
37 IMPLEMENT_DYNAMIC(ConfirmFolderCopyDlg, CDialog)
38 ConfirmFolderCopyDlg::ConfirmFolderCopyDlg(CWnd* pParent /*=NULL*/)
39 : CDialog(ConfirmFolderCopyDlg::IDD, pParent)
43 ConfirmFolderCopyDlg::~ConfirmFolderCopyDlg()
47 void ConfirmFolderCopyDlg::DoDataExchange(CDataExchange* pDX)
49 CDialog::DoDataExchange(pDX);
50 //{{AFX_DATA_MAP(ConfirmFolderCopyDlg)
51 DDX_Text(pDX, IDC_FLDCONFIRM_FROM_TEXT, m_fromText);
52 DDX_Text(pDX, IDC_FLDCONFIRM_TO_TEXT, m_toText);
53 DDX_Text(pDX, IDC_FLDCONFIRM_FROM_PATH, m_fromPath);
54 DDX_Text(pDX, IDC_FLDCONFIRM_TO_PATH, m_toPath);
55 DDX_Text(pDX, IDC_FLDCONFIRM_QUERY, m_question);
60 BEGIN_MESSAGE_MAP(ConfirmFolderCopyDlg, CDialog)
61 ON_BN_CLICKED(IDNO, OnBnClickedNo)
62 ON_BN_CLICKED(IDYES, OnBnClickedYes)
66 // ConfirmFolderCopyDlg message handlers
69 * @brief Handler for WM_INITDIALOG; conventional location to initialize
70 * controls. At this point dialog and control windows exist.
72 BOOL ConfirmFolderCopyDlg::OnInitDialog()
74 theApp.TranslateDialog(m_hWnd);
75 CDialog::OnInitDialog();
78 // TODO: we can have per-action icons?
79 HICON icon = AfxGetApp()->LoadStandardIcon(IDI_EXCLAMATION);
80 CStatic * pIcon = (CStatic *) GetDlgItem(IDC_FLDCONFIRM_ICON);
83 if (!m_caption.empty())
84 SetWindowText(m_caption.c_str());
86 // setup handler for resizing this dialog
87 m_constraint.InitializeCurrentSize(this);
88 // configure how individual controls adjust when dialog resizes
89 m_constraint.ConstrainItem(IDC_FLDCONFIRM_FROM_PATH, 0, 1, 0, 0); // grows right
90 m_constraint.ConstrainItem(IDC_FLDCONFIRM_TO_PATH, 0, 1, 0, 0); // grows right
91 // IDC_SAVECLOSING_DISCARDALL doesn't move
92 m_constraint.ConstrainItem(IDYES, 1, 0, 0, 0); // slides right
93 m_constraint.ConstrainItem(IDNO, 1, 0, 0, 0); // slides right
94 m_constraint.DisallowHeightGrowth();
95 m_constraint.SubclassWnd(); // install subclassing
96 // persist size via registry
97 m_constraint.LoadPosition(_T("ResizeableDialogs"), _T("FolderCopyConfirmDlg"), false);
99 return TRUE; // return TRUE unless you set the focus to a control
100 // EXCEPTION: OCX Property Pages should return FALSE
104 * @brief Close dialog when No button is clicked.
106 void ConfirmFolderCopyDlg::OnBnClickedNo()
112 * @brief Close dialog when Yes button is clicked.
114 void ConfirmFolderCopyDlg::OnBnClickedYes()