diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-07 14:53:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-07 14:53:21 +0000 |
commit | c625ddaf81f7481bffcd528ed3012fdc3a6bc8e1 (patch) | |
tree | 9a2f26824142e0bd53b5332c2a00d86137370a51 /plugins/Clist_nicer/src | |
parent | f3bd86cba781bb179169419de8101ab32ba0760e (diff) |
EMPTY_EXTRA_ICON applied to all another plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@2232 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r-- | plugins/Clist_nicer/src/Include/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcpaint.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 63 |
4 files changed, 39 insertions, 35 deletions
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index 8fb2a7f6a4..1ffcc2ac76 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -84,6 +84,7 @@ #include <m_fontservice.h>
#include <m_metacontacts.h>
#include <m_cln_skinedit.h>
+#include <m_extraicons.h>
#include "extbackg.h"
#include "clc.h"
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 03b9e0141e..15edd69be8 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -1301,7 +1301,7 @@ nodisplay: for (int i = dat->extraColumnsCount-1; i >= 0; i--) {
COLORREF colourFg = dat->selBkColour;
int mode = ILD_NORMAL;
- if (contact->iExtraImage[i] == 0xFFFF)
+ if (contact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (selected)
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 0424afad7a..79a7eda987 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -130,7 +130,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact }
cxSmIcon = GetSystemMetrics(SM_CXSMICON);
for (i = 0; i< dat->extraColumnsCount; i++) {
- if (hitcontact->iExtraImage[i] == 0xFFFF)
+ if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (testx >= dat->extraColumnSpacing * (dat->extraColumnsCount - i) && testx < dat->extraColumnSpacing * (dat->extraColumnsCount - i) + cxSmIcon) {
if (flags)
@@ -143,7 +143,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact int images_present = 0;
for (i = EXTRA_ICON_COUNT-1; i >= 0; i--) {
- if (hitcontact->iExtraImage[i] == 0xFFFF)
+ if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
continue;
@@ -285,7 +285,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c }
cxSmIcon = GetSystemMetrics(SM_CXSMICON);
for (i = 0; i< dat->extraColumnsCount; i++) {
- if (hitcontact->iExtraImage[i] == 0xFFFF)
+ if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (testx >= clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) && testx< clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) + cxSmIcon) {
if (flags)
@@ -299,7 +299,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c int images_present = 0;
for (i = EXTRA_ICON_COUNT; i >= 0; i--) {
- if (hitcontact->iExtraImage[i] == 0xFFFF)
+ if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (!((1 << i) & cfg::eCache[hitcontact->extraCacheEntry].dwXMask))
continue;
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index e7d5e945bf..957a580a0d 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -260,55 +260,58 @@ static int FillDialog(HWND hwnd) static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iImage)
{
- int typeOfFirst,iOldIcon;
+ int iOldIcon;
HANDLE hItem,hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ int typeOfFirst = SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
//check groups
- if (typeOfFirst==CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP)
+ hItem = hFirstItem;
+ else
+ hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
while(hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ hChildItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
if (hChildItem)
- SetAllChildIcons(hwndList,hChildItem,iColumn,iImage);
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
- if (typeOfFirst==CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT)
+ hItem = hFirstItem;
+ else
+ hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
while(hItem) {
- iOldIcon=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (iOldIcon!=0xFF && iOldIcon!=iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iColumn,int iImage)
{
- int itemType;
-
- itemType=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hItem,0);
- if (itemType==CLCIT_CONTACT) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ int itemType = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
+ if (itemType == CLCIT_CONTACT) {
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
}
- else if (itemType==CLCIT_INFO) {
+ else if (itemType == CLCIT_INFO) {
int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
if (hItem == hItemAll)
- SetAllChildIcons(hwndList,hItem,iColumn,iImage);
+ SetAllChildIcons(hwndList, hItem, iColumn, iImage);
else
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage)); //hItemUnknown
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage)); //hItemUnknown
}
- else if (itemType==CLCIT_GROUP) {
+ else if (itemType == CLCIT_GROUP) {
int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItem)
- SetAllChildIcons(hwndList,hItem,iColumn,iImage);
+ SetAllChildIcons(hwndList, hItem, iColumn, iImage);
}
}
@@ -802,7 +805,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP int iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if (iImage == nullImage)
iImage = nm->iColumn;
- else if (iImage!=0xFF)
+ else if (iImage != EMPTY_EXTRA_ICON)
iImage = nullImage;
SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
break;
|