From 4698d9baf75de69d3f1c2e7f62e83f6e14e0878b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Feb 2018 14:02:57 +0200 Subject: fixes #1155 (Checkboxes do not show checkmarks in options) --- src/mir_core/src/CCtrlCheck.cpp | 6 ++++-- src/mir_core/src/CCtrlData.cpp | 3 +-- src/mir_core/src/CDlgBase.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/CCtrlCheck.cpp b/src/mir_core/src/CCtrlCheck.cpp index 603d5da22a..13983b148c 100644 --- a/src/mir_core/src/CCtrlCheck.cpp +++ b/src/mir_core/src/CCtrlCheck.cpp @@ -39,12 +39,14 @@ void CCtrlCheck::OnApply() { CSuper::OnApply(); - SaveInt(GetState()); + if (m_dbLink != nullptr) + SaveInt(GetState()); } void CCtrlCheck::OnReset() { - SetState(LoadInt()); + if (m_dbLink != nullptr) + SetState(LoadInt()); } int CCtrlCheck::GetState() diff --git a/src/mir_core/src/CCtrlData.cpp b/src/mir_core/src/CCtrlData.cpp index eab24a4092..c0677778a8 100644 --- a/src/mir_core/src/CCtrlData.cpp +++ b/src/mir_core/src/CCtrlData.cpp @@ -32,8 +32,7 @@ CCtrlData::CCtrlData(CDlgBase *wnd, int idCtrl) CCtrlData::~CCtrlData() { - if (m_dbLink) - delete m_dbLink; + delete m_dbLink; } void CCtrlData::OnInit() diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index 258a4d94fa..e6a4d6f08b 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -138,12 +138,12 @@ BOOL CALLBACK CDlgBase::GlobalFieldEnum(HWND hwnd, LPARAM lParam) new CCtrlEdit(pDlg, id); else if (!wcsicmp(wszClass, L"ComboBox")) new CCtrlCombo(pDlg, id); -/* else if (!wcsicmp(wszClass, L"Button")) { + else if (!wcsicmp(wszClass, L"Button")) { if (GetWindowLongW(hwnd, GWL_STYLE) & (BS_CHECKBOX | BS_RADIOBUTTON)) new CCtrlCheck(pDlg, id); else new CCtrlButton(pDlg, id); - } */ + } else if (!wcsicmp(wszClass, L"RichEdit50W")) new CCtrlRichEdit(pDlg, id); else if (!wcsicmp(wszClass, L"msctls_updown32")) -- cgit v1.2.3