summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-10-24 16:55:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-10-24 16:55:46 +0300
commite733ae39773abeb2c9bce9cb3e25812564506e6b (patch)
tree1b66d1d3f68b21ab7331bdac0112cf1d3fa85958 /include
parent3506ad40b99f33066288494bd49768cdebf9d78c (diff)
CCtrlTreeOpts class moved to mir_core, to be reused later
Diffstat (limited to 'include')
-rw-r--r--include/m_gui.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index d278f6b319..92a9033169 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -1260,6 +1260,46 @@ protected:
};
/////////////////////////////////////////////////////////////////////////////////////////
+// CCtrlTreeOpts - array of options with sections
+
+class MIR_CORE_EXPORT CCtrlTreeOpts : public CCtrlTreeView
+{
+ typedef CCtrlTreeView CSuper;
+
+public:
+ CCtrlTreeOpts(CDlgBase *dlg, int ctrlId);
+ ~CCtrlTreeOpts();
+
+ void AddOption(const wchar_t *pwszSection, const wchar_t *pwszName, CMOption<bool> &option);
+
+ BOOL OnNotify(int idCtrl, NMHDR *pnmh) override;
+ void OnDestroy() override;
+ void OnInit() override;
+ bool OnApply() override;
+
+protected:
+ struct COptionsItem
+ {
+ const wchar_t *m_pwszSection, *m_pwszName;
+
+ CMOption<bool> *m_option;
+
+ HTREEITEM m_hItem = nullptr;
+
+ COptionsItem(const wchar_t *pwszSection, const wchar_t *pwszName, CMOption<bool> &option) :
+ m_pwszSection(pwszSection),
+ m_pwszName(pwszName),
+ m_option(&option)
+ {
+ }
+ };
+
+ OBJLIST<COptionsItem> m_options;
+
+ void ProcessItemClick(HTREEITEM hti);
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlPages
#define PSN_INFOCHANGED 1