From 4cf710575cefebfa54e0a976fc378d118a891796 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 14 Feb 2016 14:37:56 +0900 Subject: [PATCH] Use CheckDlgButton() instead of SetDlgItemChecked() --- Src/PluginsListDlg.cpp | 2 +- Src/PropColors.cpp | 2 +- Src/TrDialogs.h | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Src/PluginsListDlg.cpp b/Src/PluginsListDlg.cpp index 1923d2322..933d7df01 100644 --- a/Src/PluginsListDlg.cpp +++ b/Src/PluginsListDlg.cpp @@ -51,7 +51,7 @@ BOOL PluginsListDlg::OnInitDialog() AddPlugins(); m_list.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); - SetDlgItemChecked(IDC_PLUGINS_ENABLE, + CheckDlgButton(IDC_PLUGINS_ENABLE, GetOptionsMgr()->GetBool(OPT_PLUGINS_ENABLED) ? BST_CHECKED : BST_UNCHECKED); return FALSE; // return TRUE unless you set the focus to a control diff --git a/Src/PropColors.cpp b/Src/PropColors.cpp index f690469eb..77bf75aa3 100644 --- a/Src/PropColors.cpp +++ b/Src/PropColors.cpp @@ -138,7 +138,7 @@ void PropMergeColors::BrowseColor(CColorButton & colorButton) void PropMergeColors::UpdateTextColorButtonState(int checkboxId, CColorButton &btn) { - SetDlgItemChecked(checkboxId, btn.GetColor() != COLOR_NONE); + CheckDlgButton(checkboxId, btn.GetColor() != COLOR_NONE ? BST_CHECKED : BST_UNCHECKED); btn.ShowWindow(btn.GetColor() != COLOR_NONE ? SW_SHOW : SW_HIDE); } diff --git a/Src/TrDialogs.h b/Src/TrDialogs.h index 921a79290..0d2bd04ba 100644 --- a/Src/TrDialogs.h +++ b/Src/TrDialogs.h @@ -5,12 +5,6 @@ namespace DlgUtils { template - void SetDlgItemChecked(T* dlg, unsigned id, unsigned value) - { - dlg->SendDlgItemMessage(id, BM_SETCHECK, value); - } - - template void EnableDlgItem(T* dlg, unsigned id, bool enabled) { dlg->GetDlgItem(id)->EnableWindow(enabled); @@ -44,7 +38,6 @@ public: CTrDialog(LPCTSTR lpszTemplateName, CWnd *pParentWnd = NULL) : CDialog(lpszTemplateName, pParentWnd) {} virtual BOOL OnInitDialog(); - void SetDlgItemChecked(unsigned id, unsigned value) { DlgUtils::SetDlgItemChecked(this, id, value); } void EnableDlgItem(unsigned id, bool enabled) { DlgUtils::EnableDlgItem(this, id, enabled); } void SetDlgItemFocus(unsigned id) { DlgUtils::SetDlgItemFocus(this, id); } unsigned GetDlgItemText(unsigned id, String& text) { return DlgUtils::GetDlgItemText(this, id, text); } @@ -62,7 +55,6 @@ public: : CPropertyPage(lpszTemplateName, nIDCaption, dwSize) {} virtual BOOL OnInitDialog(); - void SetDlgItemChecked(unsigned id, bool value) { DlgUtils::SetDlgItemChecked(this, id, value); } void EnableDlgItem(unsigned id, bool enabled) { DlgUtils::EnableDlgItem(this, id, enabled); } void SetDlgItemFocus(unsigned id) { DlgUtils::SetDlgItemFocus(this, id); } unsigned GetDlgItemText(unsigned id, String& text) { return DlgUtils::GetDlgItemText(this, id, text); } @@ -77,7 +69,6 @@ public: UINT nStyle, UINT nID); virtual BOOL Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID); - void SetDlgItemChecked(unsigned id, bool value) { DlgUtils::SetDlgItemChecked(this, id, value); } void EnableDlgItem(unsigned id, bool enabled) { DlgUtils::EnableDlgItem(this, id, enabled); } void SetDlgItemFocus(unsigned id) { DlgUtils::SetDlgItemFocus(this, id); } unsigned GetDlgItemText(unsigned id, String& text) { return DlgUtils::GetDlgItemText(this, id, text); } -- 2.11.0