diff options
author | George Hazan <ghazan@miranda.im> | 2021-01-24 18:07:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-01-24 18:07:04 +0300 |
commit | d32ceca89165c3f537c5b32c38c153d26cd4aed7 (patch) | |
tree | 03d9f9f5517e0bb059fbf13b1a5411c6ec56a369 /plugins/Scriver/src/msgoptions.cpp | |
parent | d87f80faa7cb073ee7f19176192cb1465c488ed8 (diff) |
more effective way to use OnChange callbacks automatically
Diffstat (limited to 'plugins/Scriver/src/msgoptions.cpp')
-rw-r--r-- | plugins/Scriver/src/msgoptions.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 01a240729e..b095ef49ee 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -271,7 +271,9 @@ public: CreateLink(chkStayMinimized, g_plugin.bStayMinimized);
CreateLink(chkSavePerContact, g_plugin.bSavePerContact);
+ chkCascade.OnChange = Callback(this, &CMainOptionsDlg::onChange_Cascade);
chkAutoPopup.OnChange = Callback(this, &CMainOptionsDlg::onChange_AutoPopup);
+ chkSavePerContact.OnChange = Callback(this, &CMainOptionsDlg::onChange_SavePerContact);
}
bool OnInitDialog() override
@@ -301,6 +303,16 @@ public: m_tree.Enable(bChecked);
EnableWindow(GetDlgItem(m_hwnd, IDC_STAYMINIMIZED), bChecked);
}
+
+ void onChange_Cascade(CCtrlCheck *pCheck)
+ {
+ chkSavePerContact.SetState(!pCheck->GetState());
+ }
+
+ void onChange_SavePerContact(CCtrlCheck *pCheck)
+ {
+ chkCascade.SetState(!pCheck->GetState());
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////
|