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 --- include/m_clist.h | 10 ++++++++-- include/m_contacts.h | 1 + include/m_gui.h | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/m_clist.h b/include/m_clist.h index 37d8520cbd..a5e61560e2 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -343,6 +343,13 @@ EXTERN_C MIR_APP_DLL(BOOL) Clist_IsDocked(void); #define MS_CLIST_SHOWHIDE "CList/ShowHide" +///////////////////////////////////////////////////////////////////////////////////////// +// deletes a contact from contact list +// wParam = MCONTACT - contact to be deleted +// lParam = 0 + +#define MS_CLIST_DELETECONTACT "CList/DeleteContactCommand" + ///////////////////////////////////////////////////////////////////////////////////////// // sent when the group get modified (created, renamed or deleted) // or contact is moving from group to group @@ -435,9 +442,8 @@ EXTERN_C MIR_APP_DLL(int) Clist_GroupMoveBefore(MGROUP hGroup, MGROUP hGroupBefo // The return value must be DestroyMenu()ed when you're done with it. // NULL will be returned if the user doesn't have any groups // The dwItemData of every menu item is the handle to that group. -// Menu item IDs are assigned starting at 100, in no particular order. -EXTERN_C MIR_APP_DLL(HMENU) Clist_GroupBuildMenu(void); +EXTERN_C MIR_APP_DLL(HMENU) Clist_GroupBuildMenu(int iStartMenuId = 100); ///////////////////////////////////////////////////////////////////////////////////////// // gets group name for a contact diff --git a/include/m_contacts.h b/include/m_contacts.h index b7a693b809..a83acd22c1 100644 --- a/include/m_contacts.h +++ b/include/m_contacts.h @@ -63,6 +63,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CNF_COCOUNTRY 37 // returns company country (string) #define CNF_COHOMEPAGE 38 // returns company homepage (string) #define CNF_DISPLAYUID 39 // returns uniqueid to display in interface (must check type for type of return) +#define CNF_MAX 40 // maximum number // Special types // Return the custom name using the name order setting diff --git a/include/m_gui.h b/include/m_gui.h index d5fd8ebf98..8662659a7a 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -1140,6 +1140,7 @@ public: NMLVFINDITEM *nmlvfi; NMITEMACTIVATE *nmlvia; NMLVKEYDOWN *nmlvkey; + NMLVCUSTOMDRAW *nmcd; }; }; @@ -1148,6 +1149,7 @@ public: CCallback OnBeginRDrag; CCallback OnBeginScroll; CCallback OnColumnClick; + CCallback OnCustomDraw; CCallback OnDeleteAllItems; CCallback OnDeleteItem; CCallback OnClick; @@ -1284,6 +1286,7 @@ public: NMTVKEYDOWN *nmtvkey; NMTVDISPINFO *nmtvdi; NMTVGETINFOTIP *nmtvit; + NMTVCUSTOMDRAW *nmcd; HTREEITEM hItem; // for OnItemChanged }; }; @@ -1291,6 +1294,7 @@ public: CCallback OnBeginDrag; CCallback OnBeginLabelEdit; CCallback OnBeginRDrag; + CCallback OnCustomDraw; CCallback OnDeleteItem; CCallback OnEndLabelEdit; CCallback OnGetDispInfo; -- cgit v1.2.3