1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2011 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
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 this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // ResetDlg.cpp : implementation file
23 #include "TortoiseProc.h"
30 IMPLEMENT_DYNAMIC(CResetDlg
, CResizableStandAloneDialog
)
32 CResetDlg::CResetDlg(CWnd
* pParent
/*=NULL*/)
33 : CResizableStandAloneDialog(CResetDlg::IDD
, pParent
)
39 CResetDlg::~CResetDlg()
43 void CResetDlg::DoDataExchange(CDataExchange
* pDX
)
45 CDialog::DoDataExchange(pDX
);
49 BEGIN_MESSAGE_MAP(CResetDlg
, CResizableStandAloneDialog
)
50 ON_BN_CLICKED(IDHELP
, &CResetDlg::OnBnClickedHelp
)
54 // CResetDlg message handlers
55 BOOL
CResetDlg::OnInitDialog()
57 CResizableStandAloneDialog::OnInitDialog();
60 CString currentBranch
= g_Git
.GetCurrentBranch();
61 resetTo
.Format(IDS_PROC_RESETBRANCH
, currentBranch
, m_ResetToVersion
);
62 GetDlgItem(IDC_RESET_BRANCH_NAME
)->SetWindowTextW(resetTo
);
64 AddAnchor(IDC_RESET_BRANCH_NAME
, TOP_LEFT
, TOP_RIGHT
);
65 AddAnchor(IDC_GROUP_RESET_TYPE
, TOP_LEFT
,TOP_RIGHT
);
67 AddAnchor(IDOK
,BOTTOM_RIGHT
);
68 AddAnchor(IDCANCEL
,BOTTOM_RIGHT
);
69 AddAnchor(IDH_HELP
,BOTTOM_RIGHT
);
71 this->CheckRadioButton(IDC_RADIO_RESET_SOFT
,IDC_RADIO_RESET_HARD
,IDC_RADIO_RESET_SOFT
+m_ResetType
);
76 void CResetDlg::OnOK()
78 m_ResetType
=this->GetCheckedRadioButton(IDC_RADIO_RESET_SOFT
,IDC_RADIO_RESET_HARD
)-IDC_RADIO_RESET_SOFT
;
79 return CResizableStandAloneDialog::OnOK();
82 void CResetDlg::OnBnClickedHelp()