From e733ae39773abeb2c9bce9cb3e25812564506e6b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 24 Oct 2020 16:55:39 +0300 Subject: CCtrlTreeOpts class moved to mir_core, to be reused later --- include/m_gui.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'include') 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 @@ -1259,6 +1259,46 @@ protected: HTREEITEM m_hDragItem; // valid if m_bDragging == true }; +///////////////////////////////////////////////////////////////////////////////////////// +// 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 &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 *m_option; + + HTREEITEM m_hItem = nullptr; + + COptionsItem(const wchar_t *pwszSection, const wchar_t *pwszName, CMOption &option) : + m_pwszSection(pwszSection), + m_pwszName(pwszName), + m_option(&option) + { + } + }; + + OBJLIST m_options; + + void ProcessItemClick(HTREEITEM hti); +}; + ///////////////////////////////////////////////////////////////////////////////////////// // CCtrlPages -- cgit v1.2.3