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_app/src/clcutils.cpp | 2 +- src/mir_app/src/clistgroups.cpp | 4 +--- src/mir_app/src/clui.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index 8edb3231bd..9147c6e75a 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -445,7 +445,7 @@ MIR_APP_DLL(void) Clist_DeleteFromContactList(HWND hwnd, ClcData *dat) Clist_GroupDelete(contact->groupId); break; case CLCIT_CONTACT: - CallService("CList/DeleteContactCommand", (WPARAM)contact->hContact, (LPARAM)hwnd); + CallService(MS_CLIST_DELETECONTACT, (WPARAM)contact->hContact, (LPARAM)hwnd); break; } } diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index efba13cccb..22dc25f11a 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -448,13 +448,11 @@ MIR_APP_DLL(void) Clist_SetGroup(MCONTACT hContact, const wchar_t *pwszName) ///////////////////////////////////////////////////////////////////////////////////////// -MIR_APP_DLL(HMENU) Clist_GroupBuildMenu() +MIR_APP_DLL(HMENU) Clist_GroupBuildMenu(int nextMenuId) { if (arByIds.getCount() == 0) return nullptr; - int nextMenuId = 100; - HMENU hRootMenu = CreateMenu(); for (int i = 0; i < arByIds.getCount(); i++) { const wchar_t *pNextField = arByIds[i]->groupName + 1; diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 0aabd2f7f1..d7a78df9f3 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -340,7 +340,7 @@ int LoadCLUIModule(void) mi.position = 2000070000; mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE); mi.name.a = LPGEN("De&lete"); - mi.pszService = "CList/DeleteContactCommand"; + mi.pszService = MS_CLIST_DELETECONTACT; Menu_AddContactMenuItem(&mi); CreateServiceFunction(mi.pszService, MenuItem_DeleteContact); -- cgit v1.2.3