From 68827c97e131401e97ff772167acf9ab80fe8ef4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Feb 2022 22:33:57 +0300 Subject: two extensions for CCtrlTreeOpts for memory variables --- include/m_gui.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/m_gui.h b/include/m_gui.h index a320652f0e..364a255fe2 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -1352,6 +1352,8 @@ public: ~CCtrlTreeOpts(); void AddOption(const wchar_t *pwszSection, const wchar_t *pwszName, CMOption &option); + void AddOption(const wchar_t *pwszSection, const wchar_t *pwszName, bool &option); + void AddOption(const wchar_t *pwszSection, const wchar_t *pwszName, uint32_t &option, uint32_t mask); BOOL OnNotify(int idCtrl, NMHDR *pnmh) override; void OnDestroy() override; @@ -1363,16 +1365,26 @@ protected: { const wchar_t *m_pwszSection, *m_pwszName; - CMOption *m_option; + union + { + CMOption *m_option; + bool *m_pBool; + struct + { + uint32_t *m_pDword; + uint32_t m_mask; + }; + }; HTREEITEM m_hItem = nullptr; + enum OptionItemType { CMOPTION = 1, BOOL = 2, MASK = 3 }; + OptionItemType m_type; - COptionsItem(const wchar_t *pwszSection, const wchar_t *pwszName, CMOption &option) : + COptionsItem(const wchar_t *pwszSection, const wchar_t *pwszName, OptionItemType type) : m_pwszSection(pwszSection), m_pwszName(pwszName), - m_option(&option) - { - } + m_type(type) + {} }; OBJLIST m_options; -- cgit v1.2.3