From ce09a6d8185f0d9ee8c2b67969aed25e5a29eebe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Mar 2021 18:50:20 +0300 Subject: code cleaning --- include/m_gui.h | 2 +- libs/win32/mir_core.lib | Bin 475208 -> 475218 bytes libs/win64/mir_core.lib | Bin 480308 -> 480318 bytes plugins/MirLua/src/options.cpp | 31 ++++--------------------------- plugins/MirLua/src/options.h | 4 ---- src/mir_core/src/mir_core.def | 2 +- src/mir_core/src/mir_core64.def | 2 +- 7 files changed, 7 insertions(+), 34 deletions(-) diff --git a/include/m_gui.h b/include/m_gui.h index 73fd9de525..f1ac5c07e4 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -470,7 +470,7 @@ public: __forceinline int GetCtrlId() const { return m_idCtrl; } __forceinline CDlgBase *GetParent() const { return m_parentWnd; } __forceinline bool IsChanged() const { return m_bChanged; } - __forceinline void SetSilent() { m_bSilent = true; } + __forceinline void SetSilent(bool bSilent = true) { m_bSilent = bSilent; } __forceinline void UseSystemColors() { m_bUseSystemColors = true; } void Show(bool bShow = true); diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib index 2b146a38c2..700387b3e0 100644 Binary files a/libs/win32/mir_core.lib and b/libs/win32/mir_core.lib differ diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib index 99b560204b..cc69bf62f7 100644 Binary files a/libs/win64/mir_core.lib and b/libs/win64/mir_core.lib differ diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp index a47ae51bd0..8eac5798e0 100644 --- a/plugins/MirLua/src/options.cpp +++ b/plugins/MirLua/src/options.cpp @@ -1,9 +1,8 @@ #include "stdafx.h" -CMLuaOptionsMain::CMLuaOptionsMain(CMPlugin &plugin) - : CDlgBase(plugin, IDD_OPTIONSMAIN), +CMLuaOptionsMain::CMLuaOptionsMain(CMPlugin &plugin) : + CDlgBase(plugin, IDD_OPTIONSMAIN), m_plugin(plugin), - isScriptListInit(false), m_popupOnError(this, IDC_POPUPONERROR), m_popupOnObsolete(this, IDC_POPUPONOBSOLETE), m_scriptsList(this, IDC_SCRIPTS), @@ -47,7 +46,6 @@ bool CMLuaOptionsMain::OnInitDialog() { CDlgBase::OnInitDialog(); - m_scriptsList.SetSilent(); m_scriptsList.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP); HIMAGELIST hImageList = m_scriptsList.CreateImageList(LVSIL_SMALL); @@ -72,8 +70,6 @@ bool CMLuaOptionsMain::OnInitDialog() m_scriptsList.AddColumn(3, nullptr, 36 - GetSystemMetrics(SM_CXVSCROLL)); LoadScripts(); - - isScriptListInit = true; return true; } @@ -90,25 +86,6 @@ bool CMLuaOptionsMain::OnApply() return true; } -INT_PTR CMLuaOptionsMain::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_NOTIFY: - { - LPNMHDR lpnmHdr = (LPNMHDR)lParam; - if (lpnmHdr->idFrom == (UINT_PTR)m_scriptsList.GetCtrlId() && lpnmHdr->code == LVN_ITEMCHANGED) { - LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam; - if (pnmv->uChanged & LVIF_STATE && pnmv->uNewState & LVIS_STATEIMAGEMASK) { - if (isScriptListInit) - NotifyChange(); - } - } - } - break; - } - return CDlgBase::DlgProc(msg, wParam, lParam); -} - void CMLuaOptionsMain::OnScriptListClick(CCtrlListView::TEventInfo *evt) { LVITEM lvi = {}; @@ -155,11 +132,11 @@ void CMLuaOptionsMain::OnScriptListClick(CCtrlListView::TEventInfo *evt) void CMLuaOptionsMain::OnReload(CCtrlBase*) { - isScriptListInit = false; + m_scriptsList.SetSilent(true); m_scriptsList.DeleteAllItems(); m_plugin.ReloadLuaScripts(); LoadScripts(); - isScriptListInit = true; + m_scriptsList.SetSilent(false); } /***********************************************/ diff --git a/plugins/MirLua/src/options.h b/plugins/MirLua/src/options.h index 879f06b55a..f109f4f83d 100644 --- a/plugins/MirLua/src/options.h +++ b/plugins/MirLua/src/options.h @@ -5,8 +5,6 @@ class CMLuaOptionsMain : public CDlgBase private: CMPlugin &m_plugin; - bool isScriptListInit; - CCtrlCheck m_popupOnError; CCtrlCheck m_popupOnObsolete; @@ -22,8 +20,6 @@ protected: void OnScriptListClick(CCtrlListView::TEventInfo *evt); void OnReload(CCtrlBase*); - INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; - public: CMLuaOptionsMain(CMPlugin &plugin); }; diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 2a9322ac5e..594ecb68c0 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -897,7 +897,7 @@ WindowList_Create @1105 WindowList_Destroy @1106 WindowList_Find @1107 WindowList_Remove @1108 -?SetSilent@CCtrlBase@@QAEXXZ @1109 NONAME +?SetSilent@CCtrlBase@@QAEX_N@Z @1109 NONAME Utils_AssertInsideScreen @1110 Utils_RestoreWindowPosition @1111 Utils_SaveWindowPosition @1112 diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 4d694019fb..658b27f538 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -897,7 +897,7 @@ WindowList_Create @1105 WindowList_Destroy @1106 WindowList_Find @1107 WindowList_Remove @1108 -?SetSilent@CCtrlBase@@QEAAXXZ @1109 NONAME +?SetSilent@CCtrlBase@@QEAAX_N@Z @1109 NONAME Utils_AssertInsideScreen @1110 Utils_RestoreWindowPosition @1111 Utils_SaveWindowPosition @1112 -- cgit v1.2.3