forked from CobaltFusion/DebugViewPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistoryDlg.cpp
More file actions
83 lines (66 loc) · 2.02 KB
/
Copy pathHistoryDlg.cpp
File metadata and controls
83 lines (66 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// (C) Copyright Gert-Jan de Vos and Jan Wilmans 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "CobaltFusion/AtlWinExt.h"
#include "CobaltFusion/Str.h"
#include "CobaltFusion/fusionassert.h"
#include "Win32/Utilities.h"
#include "HistoryDlg.h"
namespace fusion {
namespace debugviewpp {
BEGIN_MSG_MAP2(CHistoryDlg)
MSG_WM_INITDIALOG(OnInitDialog)
COMMAND_ID_HANDLER_EX(IDC_UNLIMITED, OnUnlimited)
COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
COMMAND_ID_HANDLER_EX(IDOK, OnOk)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
CHistoryDlg::CHistoryDlg(size_t historySize, bool unlimited) :
m_historySize(static_cast<int>(historySize)),
m_unlimited(unlimited)
{
}
void CHistoryDlg::OnException() const
{
FUSION_REPORT_EXCEPTION("Unknown Exception");
}
void CHistoryDlg::OnException(const std::exception& ex) const
{
FUSION_REPORT_EXCEPTION(ex.what());
}
BOOL CHistoryDlg::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
SetDlgItemInt(IDC_HISTORY, m_historySize);
CButton unlimited(GetDlgItem(IDC_UNLIMITED));
unlimited.SetCheck(static_cast<int>(m_unlimited));
UpdateUi();
CenterWindow(GetParent());
return TRUE;
}
void CHistoryDlg::OnUnlimited(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
{
CButton unlimited(GetDlgItem(IDC_UNLIMITED));
m_unlimited = unlimited.GetCheck() == BST_CHECKED;
UpdateUi();
}
void CHistoryDlg::UpdateUi() const
{
GetDlgItem(IDC_HISTORY).EnableWindow(static_cast<BOOL>(!m_unlimited));
}
void CHistoryDlg::OnCancel(UINT /*uNotifyCode*/, int nID, CWindow /*wndCtl*/)
{
EndDialog(nID);
}
void CHistoryDlg::OnOk(UINT /*uNotifyCode*/, int nID, CWindow /*wndCtl*/)
{
m_historySize = GetDlgItemInt(IDC_HISTORY);
// m_unlimited = fusion::GetDlgItemText(*this, IDC_ARGUMENTS);
EndDialog(nID);
}
int CHistoryDlg::GetHistorySize() const
{
return m_historySize;
}
} // namespace debugviewpp
} // namespace fusion