From 1aecfbf8295912ccfc26bdbd9d745aed96966e66 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 13 May 2021 11:40:17 +0300 Subject: UI classes & core code cleaning: - MS_CLIST_DELETECONTACT introduced to avoid the usage of string constants directly; - start menu item id parameter added to Clist_GroupBuildMenu(); - CNF_MAX macro added to simplify cycles over CNF_* array; - custom draw support for CCtrlListView & CCtrlTreeView; - Miranda's specific WM_MEASUREITEM & WM_DRAWITEM processing in CDlgBase --- src/mir_core/src/CCtrlListView.cpp | 1 + src/mir_core/src/CCtrlTreeView.cpp | 1 + src/mir_core/src/CDlgBase.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/CCtrlListView.cpp b/src/mir_core/src/CCtrlListView.cpp index 9ef8687bc6..5ac8f4d32e 100644 --- a/src/mir_core/src/CCtrlListView.cpp +++ b/src/mir_core/src/CCtrlListView.cpp @@ -36,6 +36,7 @@ BOOL CCtrlListView::OnNotify(int, NMHDR *pnmh) switch (pnmh->code) { case NM_CLICK: OnClick(&evt); return TRUE; case NM_DBLCLK: OnDoubleClick(&evt); return TRUE; + case NM_CUSTOMDRAW: OnCustomDraw(&evt); return TRUE; case LVN_BEGINDRAG: OnBeginDrag(&evt); return TRUE; case LVN_BEGINLABELEDIT: OnBeginLabelEdit(&evt); return TRUE; case LVN_BEGINRDRAG: OnBeginRDrag(&evt); return TRUE; diff --git a/src/mir_core/src/CCtrlTreeView.cpp b/src/mir_core/src/CCtrlTreeView.cpp index 056f149588..0522bfee03 100644 --- a/src/mir_core/src/CCtrlTreeView.cpp +++ b/src/mir_core/src/CCtrlTreeView.cpp @@ -285,6 +285,7 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh) switch (pnmh->code) { case NM_RCLICK: OnRightClick(&evt); return TRUE; + case NM_CUSTOMDRAW: OnCustomDraw(&evt); return TRUE; case TVN_BEGINLABELEDIT: OnBeginLabelEdit(&evt); return TRUE; case TVN_BEGINRDRAG: OnBeginRDrag(&evt); return TRUE; case TVN_DELETEITEM: OnDeleteItem(&evt); return TRUE; diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index de23eec3d9..bc051554de 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -245,7 +245,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_MEASUREITEM: - { + if (!Menu_MeasureItem(lParam)) { MEASUREITEMSTRUCT *param = (MEASUREITEMSTRUCT *)lParam; if (param && param->CtlID) if (CCtrlBase *ctrl = FindControl(param->CtlID)) @@ -254,7 +254,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return FALSE; case WM_DRAWITEM: - { + if (!Menu_DrawItem(lParam)) { DRAWITEMSTRUCT *param = (DRAWITEMSTRUCT *)lParam; if (param && param->CtlID) if (CCtrlBase *ctrl = FindControl(param->CtlID)) -- cgit v1.2.3