diff options
author | George Hazan <ghazan@miranda.im> | 2021-02-08 11:25:55 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-02-08 11:26:02 +0300 |
commit | 114120db3089beb1381ace40c795ba38aeb93b4b (patch) | |
tree | 18bf82ccfa181d0d190b9e9dce8208f2cbea0742 /plugins/MenuItemEx/src | |
parent | ac7cebb7d2457b3fbf13143b08924d491aa1ac80 (diff) |
more UI classes related code cleaning
Diffstat (limited to 'plugins/MenuItemEx/src')
-rw-r--r-- | plugins/MenuItemEx/src/options.cpp | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index 203ee9669d..a334e3f58b 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -30,16 +30,6 @@ class COptDialog : public CDlgBase m_chkSMName, m_chkCopyID, m_chkCopyIDName, m_chkShowID, m_chkTrimID, m_chkIgnoreHide;
CCtrlLabel m_lblHint;
- void EnableWindowChecks()
- {
- m_chkAlpha.Enable(m_chkVis.GetState());
- m_chkIgnoreHide.Enable(m_chkIgnore.GetState());
- m_chkCopyIDName.Enable(m_chkCopyID.GetState());
- m_chkShowID.Enable(m_chkCopyID.GetState());
- m_chkTrimID.Enable(m_chkCopyID.GetState() && m_chkShowID.GetState());
- m_chkSMName.Enable(m_chkStatusMsg.GetState());
- }
-
public:
COptDialog() :
CDlgBase(g_plugin, IDD_OPTIONS),
@@ -62,11 +52,10 @@ public: {
m_flags = g_plugin.getDword("flags", vf_default);
- m_chkVis.OnChange = Callback(this, &COptDialog::OnVisChange);
- m_chkIgnore.OnChange = Callback(this, &COptDialog::OnIgnoreChange);
- m_chkCopyID.OnChange = Callback(this, &COptDialog::OnCopyIDChange);
- m_chkStatusMsg.OnChange = Callback(this, &COptDialog::OnStatusMsgChange);
- m_chkShowID.OnChange = Callback(this, &COptDialog::OnShowIDChange);
+ m_chkVis.OnChange = Callback(this, &COptDialog::onChange_Vis);
+ m_chkIgnore.OnChange = Callback(this, &COptDialog::onChange_Ignore);
+ m_chkStatusMsg.OnChange = Callback(this, &COptDialog::onChange_StatusMsg);
+ m_chkCopyID.OnChange = m_chkShowID.OnChange = Callback(this, &COptDialog::onChange_CopyID);
}
bool OnInitDialog() override
@@ -82,8 +71,6 @@ public: buffer.Format(L"%s *", item.GetText());
item.SetText(buffer);
}
-
- EnableWindowChecks();
return true;
}
@@ -100,29 +87,26 @@ public: return true;
}
- void OnVisChange(CCtrlBase*)
+ void onChange_Vis(CCtrlBase*)
{
- EnableWindowChecks();
- }
-
- void OnIgnoreChange(CCtrlBase*)
- {
- EnableWindowChecks();
+ m_chkAlpha.Enable(m_chkVis.GetState());
}
- void OnCopyIDChange(CCtrlBase*)
+ void onChange_Ignore(CCtrlBase*)
{
- EnableWindowChecks();
+ m_chkIgnoreHide.Enable(m_chkIgnore.GetState());
}
- void OnStatusMsgChange(CCtrlBase*)
+ void onChange_CopyID(CCtrlBase*)
{
- EnableWindowChecks();
+ m_chkCopyIDName.Enable(m_chkCopyID.GetState());
+ m_chkShowID.Enable(m_chkCopyID.GetState());
+ m_chkTrimID.Enable(m_chkCopyID.GetState() && m_chkShowID.GetState());
}
- void OnShowIDChange(CCtrlBase*)
+ void onChange_StatusMsg(CCtrlBase*)
{
- EnableWindowChecks();
+ m_chkSMName.Enable(m_chkStatusMsg.GetState());
}
};
|