diff options
19 files changed, 326 insertions, 391 deletions
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index e515c57fa2..1f97082d4b 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -194,7 +194,7 @@ int AniAva_InitModule() {
memset(&AniAva,0,sizeof(AniAva));
if (g_CluiData.fGDIPlusFail) return 0;
- if ( !( db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
+ if ( !( db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
&& db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT))) return 0;
{
WNDCLASSEX wc;
@@ -262,7 +262,7 @@ int AniAva_UpdateOptions() {
BOOL bReloadAvatars = FALSE;
BOOL bBeEnabled = (!g_CluiData.fGDIPlusFail
- && db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
+ && db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
&& db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT));
if (bBeEnabled && !AniAva.bModuleStarted)
{
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index f0e5bc2891..76289e97d9 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -72,9 +72,9 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) HookEvent(ME_MODERNOPT_INITIALIZE,ModernOptInit);
HookEvent(ME_MODERNOPT_INITIALIZE,ModernSkinOptInit);
- if (ServiceExists(MS_MC_DISABLEHIDDENGROUP))
+ if ( ServiceExists(MS_MC_DISABLEHIDDENGROUP))
CallService(MS_MC_DISABLEHIDDENGROUP, (WPARAM)TRUE, 0);
- if (ServiceExists(MS_MC_GETPROTOCOLNAME))
+ if ( ServiceExists(MS_MC_GETPROTOCOLNAME))
g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
// Get icons
@@ -117,7 +117,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) hIconChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
- if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
+ if ( ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
SMADD_REGCAT rc;
rc.cbSize = sizeof(rc);
@@ -443,12 +443,11 @@ static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPar return 0;
}
-
-
static LRESULT clcOnHitTest(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd,WM_NCHITTEST,wParam,lParam);
}
+
static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
@@ -487,9 +486,11 @@ static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
return 0;
}
+
if (contact->type == CLCIT_GROUP)
if (CallService(MO_PROCESSCOMMANDBYMENUIDENT,LOWORD(wParam),(LPARAM)hwnd))
return 0;
+
return 0;
}
@@ -500,8 +501,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
cliRecalcScrollBar(hwnd,dat);
- if ( g_CluiData.fDisableSkinEngine || dat->force_in_dialog )
- {
+ if ( g_CluiData.fDisableSkinEngine || dat->force_in_dialog ) {
HBITMAP hBmp, hBmpMask, hoBmp, hoMaskBmp;
HDC hdc,hdcMem;
RECT rc = {0};
@@ -540,8 +540,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam DeleteObject(hBmpMask);
DeleteObject(hBmp);
}
- else if (dat->himlHighlight)
- {
+ else if (dat->himlHighlight) {
ImageList_Destroy(dat->himlHighlight);
dat->himlHighlight = NULL;
}
@@ -550,8 +549,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam static LRESULT clcOnChar(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (wParam == 27 && dat->szQuickSearch[0] == '\0') //escape and not quick search
- {
+ if (wParam == 27 && dat->szQuickSearch[0] == '\0') { //escape and not quick search
// minimize clist
CListMod_HideWindow(pcli->hwndContactList, SW_HIDE);
}
@@ -559,13 +557,10 @@ static LRESULT clcOnChar(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam }
static LRESULT clcOnPaint(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HDC hdc;
- PAINTSTRUCT ps;
- if (IsWindowVisible(hwnd))
- {
- if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
- {
- hdc = BeginPaint(hwnd,&ps);
+ if ( IsWindowVisible(hwnd)) {
+ if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList) {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd,&ps);
g_clcPainter.cliPaintClc(hwnd,dat,hdc,&ps.rcPaint);
EndPaint(hwnd,&ps);
}
@@ -586,8 +581,8 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa int pageSize;
if (wParam == VK_CONTROL)
return 0;
- pcli->pfnHideInfoTip(hwnd,dat);
+ pcli->pfnHideInfoTip(hwnd,dat);
KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
@@ -601,32 +596,25 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa switch(wParam) {
case VK_DOWN:
case VK_UP:
- {
- if (dat->szQuickSearch[0] != '\0' && dat->selection != -1) //get next contact
- {
- //get next contact
- int index = clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam == VK_UP));
- if (index == -1)
- {
- MessageBeep(MB_OK);
- return 0;
- }
- else
- {
- dat->selection = index;
- pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
- pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
- return 0;
- }
-
- }
- else
- {
- if (wParam == VK_DOWN) dat->selection++;
- if (wParam == VK_UP) dat->selection--;
- selMoved = 1; break;
+ if (dat->szQuickSearch[0] != '\0' && dat->selection != -1) { //get next contact
+ //get next contact
+ int index = clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam == VK_UP));
+ if (index == -1) {
+ MessageBeep(MB_OK);
+ return 0;
}
+
+ dat->selection = index;
+ pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ return 0;
}
+
+ if (wParam == VK_DOWN) dat->selection++;
+ if (wParam == VK_UP) dat->selection--;
+ selMoved = 1;
+ break;
+
case VK_PRIOR: dat->selection -= pageSize; selMoved = 1; break;
case VK_NEXT: dat->selection += pageSize; selMoved = 1; break;
case VK_HOME: dat->selection = 0; selMoved = 1; break;
@@ -643,16 +631,14 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa case VK_F2: cliBeginRenameSelection(hwnd,dat); /*SetCapture(hwnd);*/ return 0;
case VK_DELETE: pcli->pfnDeleteFromContactList(hwnd,dat); SetCapture(hwnd);return 0;
case VK_ESCAPE:
- {
- if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
- {
- dat->iDragItem = -1;
- dat->iInsertionMark = -1;
- dat->dragStage = 0;
- ReleaseCapture();
- }
- return 0;
+ if ((dat->dragStage & DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE) {
+ dat->iDragItem = -1;
+ dat->iInsertionMark = -1;
+ dat->dragStage = 0;
+ ReleaseCapture();
}
+ return 0;
+
default:
{
NMKEY nmkey;
@@ -662,38 +648,30 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa nmkey.nVKey = wParam;
nmkey.uFlags = HIWORD(lParam);
- if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey))
- {
+ if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey)) {
SetCapture(hwnd);
return 0;
}
}
}
- if (changeGroupExpand)
- {
+ if (changeGroupExpand) {
int hit;
ClcContact *contact;
ClcGroup *group;
//dat->szQuickSearch[0] = 0;
hit = cliGetRowByIndex(dat,dat->selection,&contact,&group);
- if (hit != -1)
- {
- if (contact->type == CLCIT_CONTACT && (contact->isSubcontact || contact->SubAllocated>0))
- {
- if (contact->isSubcontact && changeGroupExpand == 1)
- {
+ if (hit != -1) {
+ if (contact->type == CLCIT_CONTACT && (contact->isSubcontact || contact->SubAllocated > 0)) {
+ if (contact->isSubcontact && changeGroupExpand == 1) {
dat->selection -= contact->isSubcontact;
selMoved = 1;
}
- else if ( !contact->isSubcontact && contact->SubAllocated>0)
- {
- if (changeGroupExpand == 1 && !contact->SubExpanded)
- {
+ else if ( !contact->isSubcontact && contact->SubAllocated > 0) {
+ if (changeGroupExpand == 1 && !contact->SubExpanded) {
dat->selection = cliGetRowsPriorTo(&dat->list,group,-1);
selMoved = 1;
}
- else if (changeGroupExpand == 1 && contact->SubExpanded)
- {
+ else if (changeGroupExpand == 1 && contact->SubExpanded) {
//Contract
ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
@@ -705,13 +683,11 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa cliRecalcScrollBar(hwnd,dat);
hitcontact = NULL;
}
- else if (changeGroupExpand == 2 && contact->SubExpanded)
- {
+ else if (changeGroupExpand == 2 && contact->SubExpanded) {
dat->selection++;
selMoved = 1;
}
- else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta)
- {
+ else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta) {
ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
contact->SubExpanded = 1;
@@ -720,13 +696,11 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa dat->needsResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
- if (ht)
- {
+ if (ht) {
int i=0;
ClcContact *contact2;
ClcGroup *group2;
- if (FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
- {
+ if ( FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE)) {
i = cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
pcli->pfnEnsureVisible(hwnd,dat,i+contact->SubAllocated,0);
}
@@ -796,14 +770,12 @@ void clcSetDelayTimer( UINT_PTR uIDEvent, HWND hwnd, int nDelay) {
KillTimer( hwnd, uIDEvent );
int delay = nDelay;
- if ( delay == -1)
- {
- switch ( uIDEvent )
- {
- case TIMERID_DELAYEDRESORTCLC: delay = 10; break;
- case TIMERID_RECALCSCROLLBAR: delay = 10; break;
- case TIMERID_REBUILDAFTER: delay = 50; break;
- default: delay = 100; break;
+ if (delay == -1) {
+ switch ( uIDEvent ) {
+ case TIMERID_DELAYEDRESORTCLC: delay = 10; break;
+ case TIMERID_RECALCSCROLLBAR: delay = 10; break;
+ case TIMERID_REBUILDAFTER: delay = 50; break;
+ default: delay = 100; break;
}
}
CLUI_SafeSetTimer( hwnd, uIDEvent, delay, NULL );
@@ -830,10 +802,9 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara }
case TIMERID_SUBEXPAND:
{
- ClcContact * ht = NULL;
+ ClcContact *ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- if (hitcontact && dat->expandMeta)
- {
+ if (hitcontact && dat->expandMeta) {
if (hitcontact->SubExpanded) hitcontact->SubExpanded = 0; else hitcontact->SubExpanded = 1;
db_set_b(hitcontact->hContact,"CList","Expanded",hitcontact->SubExpanded);
if (hitcontact->SubExpanded)
@@ -847,15 +818,15 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara int i=0;
ClcContact *contact;
ClcGroup *group;
- if (FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
- {
+ if ( FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, NULL, FALSE)) {
i = cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
- pcli->pfnEnsureVisible(hwnd,dat,i+hitcontact->SubAllocated,0);
+ pcli->pfnEnsureVisible(hwnd, dat, i+hitcontact->SubAllocated, 0);
}
}
hitcontact = NULL;
- return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
+ return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+
case TIMERID_DELAYEDRESORTCLC:
TRACE("Do sort on Timer\n");
KillTimer(hwnd,TIMERID_DELAYEDRESORTCLC);
@@ -878,8 +849,7 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara static LRESULT clcOnActivate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
TRACE ("clcOnActivate\n");
- if (dat->bCompactMode)
- {
+ if (dat->bCompactMode) {
cliRecalcScrollBar(hwnd,dat);
if ( dat->hwndRenameEdit == NULL )
PostMessage( hwnd, WM_SIZE, 0, 0);
@@ -892,7 +862,7 @@ static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int lResult;
if ( !CLUI_IsInMainWindow(hwnd))
- return DefWindowProc(hwnd,msg,wParam,lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
if (g_CluiData.nBehindEdgeState>0)
CLUI_ShowFromBehindEdge();
@@ -901,7 +871,7 @@ static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w CLUI_UpdateTimer(0);
lResult = CLUI_TestCursorOnBorders();
- return lResult ? lResult : DefWindowProc(hwnd,msg,wParam,lParam);
+ return lResult ? lResult : DefWindowProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -912,18 +882,14 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM pt.y = HIWORD(lParam);
ClientToScreen(hwnd,&pt);
k = CLUI_SizingOnBorder(pt,0);
- if (k)
- {
+ if (k) {
int io = dat->iHotTrack;
dat->iHotTrack = 0;
- if (dat->exStyle&CLS_EX_TRACKSELECT)
- {
+ if (dat->exStyle & CLS_EX_TRACKSELECT)
pcli->pfnInvalidateItem(hwnd,dat,io);
- }
+
if (k && GetCapture() == hwnd)
- {
SendMessage(GetParent(hwnd),WM_PARENTNOTIFY,WM_LBUTTONDOWN,lParam);
- }
return FALSE;
}
}
@@ -944,127 +910,116 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM //dat->szQuickSearch[0] = 0;
hit = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),&contact,&group,&hitFlags);
if (GetFocus() != hwnd) SetFocus(hwnd);
- if (hit != -1 && !(hitFlags&CLCHT_NOWHERE))
- {
- if ( hit == dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
- {
- if ( !(dat->dragStage&DRAGSTAGEF_SKIPRENAME))
- {
+ if (hit != -1 && !(hitFlags & CLCHT_NOWHERE)) {
+ if ( hit == dat->selection && hitFlags & CLCHT_ONITEMLABEL && dat->exStyle & CLS_EX_EDITLABELS) {
+ if ( !(dat->dragStage & DRAGSTAGEF_SKIPRENAME)) {
SetCapture(hwnd);
dat->iDragItem = dat->selection;
dat->dragStage = DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME;
dat->dragAutoScrolling = 0;
return TRUE;
}
- else
- {
+ else {
dat->dragStage &= ~DRAGSTAGEF_SKIPRENAME;
return TRUE;
}
-
}
}
- if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
- if (hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
- {
- BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
- hitcontact = contact;
- HitPoint.x = (short)LOWORD(lParam);
- HitPoint.y = (short)HIWORD(lParam);
- fMouseUpped = FALSE;
- if ((GetKeyState(VK_SHIFT)&0x8000) || (GetKeyState(VK_CONTROL)&0x8000) || (GetKeyState(VK_MENU)&0x8000))
- {
- fMouseUpped = TRUE;
- hitcontact = contact;
- KillTimer(hwnd,TIMERID_SUBEXPAND);
- CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
- }
- }
- else
- hitcontact = NULL;
+ if (hit != -1 && !(hitFlags & CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
+ if (hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
+ {
+ BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
- if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_GROUP)
- if (hitFlags&CLCHT_ONITEMICON)
- {
- ClcGroup *selgroup;
- ClcContact *selcontact;
- dat->selection = cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
- pcli->pfnSetGroupExpand(hwnd,dat,contact->group,-1);
- if (dat->selection != -1)
- {
- dat->selection = cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
- if (dat->selection == -1) dat->selection = cliGetRowsPriorTo(&dat->list,contact->group,-1);
- }
- if (dat->bCompactMode)
- {
- SendMessage(hwnd,WM_SIZE,0,0);
- }
- else
- {
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- UpdateWindow(hwnd);
- }
- return TRUE;
- }
- if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && hitFlags&CLCHT_ONITEMCHECK)
+ hitcontact = contact;
+ HitPoint.x = (short)LOWORD(lParam);
+ HitPoint.y = (short)HIWORD(lParam);
+ fMouseUpped = FALSE;
+ if ((GetKeyState(VK_SHIFT)&0x8000) || (GetKeyState(VK_CONTROL)&0x8000) || (GetKeyState(VK_MENU)&0x8000))
{
- NMCLISTCONTROL nm;
- contact->flags ^= CONTACTF_CHECKED;
- if (contact->type == CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
- pcli->pfnRecalculateGroupCheckboxes(hwnd,dat);
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- nm.hdr.code = CLN_CHECKCHANGED;
- nm.hdr.hwndFrom = hwnd;
- nm.hdr.idFrom = GetDlgCtrlID(hwnd);
- nm.flags = 0;
- nm.hItem = ContactToItemHandle(contact,&nm.flags);
- SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
+ fMouseUpped = TRUE;
+ hitcontact = contact;
+ KillTimer(hwnd,TIMERID_SUBEXPAND);
+ CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
}
- if ( !(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
- {
- NMCLISTCONTROL nm;
- nm.hdr.code = NM_CLICK;
- nm.hdr.hwndFrom = hwnd;
- nm.hdr.idFrom = GetDlgCtrlID(hwnd);
- nm.flags = 0;
- if (hit == -1 || hitFlags&CLCHT_NOWHERE) nm.hItem = NULL;
- else nm.hItem = ContactToItemHandle(contact,&nm.flags);
- nm.iColumn = hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
- nm.pt = dat->ptDragStart;
- SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
+ }
+ else hitcontact = NULL;
+
+ if (hit != -1 && !(hitFlags & CLCHT_NOWHERE) && contact->type == CLCIT_GROUP)
+ if (hitFlags & CLCHT_ONITEMICON) {
+ ClcGroup *selgroup;
+ ClcContact *selcontact;
+ dat->selection = cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
+ pcli->pfnSetGroupExpand(hwnd,dat,contact->group,-1);
+ if (dat->selection != -1) {
+ dat->selection = cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
+ if (dat->selection == -1) dat->selection = cliGetRowsPriorTo(&dat->list,contact->group,-1);
}
- if (hitFlags&(CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
- return FALSE;
-
- dat->selection = (hitFlags&CLCHT_NOWHERE)?-1:hit;
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- UpdateWindow(hwnd);
- if (dat->selection != -1 && (contact->type == CLCIT_CONTACT || contact->type == CLCIT_GROUP) && !(hitFlags&(CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE)))
- {
- SetCapture(hwnd);
- dat->iDragItem = dat->selection;
- dat->dragStage = DRAGSTAGE_NOTMOVED;
- dat->dragAutoScrolling = 0;
- }
if (dat->bCompactMode)
- {
SendMessage(hwnd,WM_SIZE,0,0);
+ else {
+ CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ UpdateWindow(hwnd);
}
- if (dat->selection != -1) pcli->pfnEnsureVisible(hwnd,dat,hit,0);
return TRUE;
- }
-}
+ }
+ if (hit != -1 && !(hitFlags & CLCHT_NOWHERE) && (hitFlags & CLCHT_ONITEMCHECK)) {
+ contact->flags ^= CONTACTF_CHECKED;
+ if (contact->type == CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
+ pcli->pfnRecalculateGroupCheckboxes(hwnd,dat);
+ CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ NMCLISTCONTROL nm;
+ nm.hdr.code = CLN_CHECKCHANGED;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
+ }
+
+ if ( !(hitFlags & (CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK))) {
+ NMCLISTCONTROL nm;
+ nm.hdr.code = NM_CLICK;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ if (hit == -1 || hitFlags&CLCHT_NOWHERE) nm.hItem = NULL;
+ else nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ nm.iColumn = hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
+ nm.pt = dat->ptDragStart;
+ SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
+ }
+
+ if (hitFlags & (CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
+ return FALSE;
+
+ dat->selection = (hitFlags&CLCHT_NOWHERE)?-1:hit;
+ CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+
+ UpdateWindow(hwnd);
+ if (dat->selection != -1 && (contact->type == CLCIT_CONTACT || contact->type == CLCIT_GROUP) && !(hitFlags & (CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE))) {
+ SetCapture(hwnd);
+ dat->iDragItem = dat->selection;
+ dat->dragStage = DRAGSTAGE_NOTMOVED;
+ dat->dragAutoScrolling = 0;
+ }
+
+ if (dat->bCompactMode)
+ SendMessage(hwnd,WM_SIZE,0,0);
+
+ if (dat->selection != -1)
+ pcli->pfnEnsureVisible(hwnd,dat,hit,0);
+ return TRUE;
+ }
+}
static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if ((HWND)lParam != hwnd)
- {
- if (dat->iHotTrack != -1)
- {
+ if ((HWND)lParam != hwnd) {
+ if (dat->iHotTrack != -1) {
int i;
i = dat->iHotTrack;
dat->iHotTrack = -1;
@@ -1078,29 +1033,26 @@ static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPA static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL isOutside = FALSE;
- if (CLUI_IsInMainWindow(hwnd))
- {
- if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
+ if ( CLUI_IsInMainWindow(hwnd)) {
+ if (g_CluiData.bBehindEdgeSettings)
+ CLUI_UpdateTimer(0);
CLUI_TestCursorOnBorders();
}
+
if (clcProceedDragToScroll(hwnd, (short)HIWORD(lParam)))
return 0;
- if ( dat->dragStage&DRAGSTAGEF_MAYBERENAME )
- {
+ if (dat->dragStage & DRAGSTAGEF_MAYBERENAME) {
POINT pt;
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
- if ( abs(pt.x-dat->ptDragStart.x)>GetSystemMetrics(SM_CXDOUBLECLK)
- || abs(pt.y-dat->ptDragStart.y)>GetSystemMetrics(SM_CYDOUBLECLK))
- {
+ if ( abs(pt.x-dat->ptDragStart.x) > GetSystemMetrics(SM_CXDOUBLECLK) || abs(pt.y-dat->ptDragStart.y) > GetSystemMetrics(SM_CYDOUBLECLK)) {
KillTimer( hwnd, TIMERID_RENAME );
dat->dragStage &= (~DRAGSTAGEF_MAYBERENAME);
}
}
- if (dat->iDragItem == -1)
- {
+ if (dat->iDragItem == -1) {
POINT pt;
HWND window;
pt.x = (short)LOWORD(lParam);
@@ -1148,19 +1100,17 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (dat->iHotTrack == -1 || isOutside)
ReleaseCapture();
- if (dat->exStyle&CLS_EX_TRACKSELECT)
- {
+ if (dat->exStyle & CLS_EX_TRACKSELECT) {
pcli->pfnInvalidateItem(hwnd,dat,iOldHotTrack);
pcli->pfnInvalidateItem(hwnd,dat,dat->iHotTrack);
}
- pcli->pfnHideInfoTip(hwnd,dat);
+ pcli->pfnHideInfoTip(hwnd, dat);
}
- KillTimer(hwnd,TIMERID_INFOTIP);
+ KillTimer(hwnd, TIMERID_INFOTIP);
- if (wParam == 0 && dat->hInfoTipItem == NULL)
- {
+ if (wParam == 0 && dat->hInfoTipItem == NULL) {
dat->ptInfoTip.x = (short)LOWORD(lParam);
dat->ptInfoTip.y = (short)HIWORD(lParam);
CLUI_SafeSetTimer(hwnd,TIMERID_INFOTIP,dat->infoTipTimeout,NULL);
@@ -1180,8 +1130,10 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
HCURSOR hNewCursor = LoadCursor(NULL, IDC_NO);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- if (dat->dragAutoScrolling)
- {KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL); dat->dragAutoScrolling = 0;}
+ if (dat->dragAutoScrolling) {
+ KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL);
+ dat->dragAutoScrolling = 0;
+ }
int target = GetDropTargetInformation(hwnd,dat,pt);
if (dat->dragStage&DRAGSTAGEF_OUTSIDE && target != DROPTARGET_OUTSIDE) {
NMCLISTCONTROL nm;
@@ -1201,54 +1153,46 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w break;
case DROPTARGET_ONCONTACT:
- if (ServiceExists(MS_MC_ADDTOMETA))
- {
+ if ( ServiceExists(MS_MC_ADDTOMETA)) {
ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
- {
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) {
if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
}
-
}
break;
case DROPTARGET_ONMETACONTACT:
- if (ServiceExists(MS_MC_ADDTOMETA))
- {
- ClcContact *contSour,*contDest;
+ if ( ServiceExists(MS_MC_ADDTOMETA)) {
+ ClcContact *contSour, *contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
- {
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) {
if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ else if (contSour->subcontacts == contDest)
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
else
- if (contSour->subcontacts == contDest)
- hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
- else
- hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
+
case DROPTARGET_ONSUBCONTACT:
- if (ServiceExists(MS_MC_ADDTOMETA))
- {
+ if ( ServiceExists(MS_MC_ADDTOMETA)) {
ClcContact *contSour,*contDest;
- cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
- {
+ cliGetRowByIndex(dat, dat->selection, &contDest, NULL);
+ cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) {
if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ else if (contDest->subcontacts == contSour->subcontacts)
+ break;
else
- if (contDest->subcontacts == contSour->subcontacts)
- break;
- else
- hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
@@ -1266,12 +1210,9 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w NMCLISTCONTROL nm;
ClcContact *contact;
- if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight)))
- {
- if ( !dat->dragAutoScrolling)
- {
- if (pt.y < 0) dat->dragAutoScrolling = -1;
- else dat->dragAutoScrolling = 1;
+ if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight))) {
+ if ( !dat->dragAutoScrolling) {
+ dat->dragAutoScrolling = (pt.y < 0) ? -1 : 1;
CLUI_SafeSetTimer(hwnd,TIMERID_DRAGAUTOSCROLL,dat->scrollTime,NULL);
}
SendMessage(hwnd,WM_TIMER,TIMERID_DRAGAUTOSCROLL,0);
@@ -1287,8 +1228,9 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w nm.pt = pt;
if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm))
return 0;
- break;
}
+ break;
+
default:
{
ClcGroup *group = NULL;
@@ -1321,10 +1263,12 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
else if (dat->iHotTrack == -1 && dat->iDragItem == -1)
ReleaseCapture();
- if (dat->iDragItem == -1) return 0;
+
+ if (dat->iDragItem == -1)
+ return 0;
+
SetCursor((HCURSOR)GetClassLongPtr(hwnd,GCLP_HCURSOR));
- if (dat->exStyle & CLS_EX_TRACKSELECT)
- {
+ if (dat->exStyle & CLS_EX_TRACKSELECT) {
DWORD flags;
dat->iHotTrack = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flags);
if (dat->iHotTrack == -1)
@@ -1333,23 +1277,21 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w else if (hitcontact == NULL)
ReleaseCapture();
KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL);
- if (dat->dragStage == (DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
+ if (dat->dragStage == (DRAGSTAGE_NOTMOVED | DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd,TIMERID_RENAME,GetDoubleClickTime(),NULL);
- else if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
- {
+ else if ((dat->dragStage & DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE) {
POINT pt;
int target;
TCHAR Wording[500];
int res = 0;
pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
target = GetDropTargetInformation(hwnd,dat,pt);
- switch(target)
- {
+ switch(target) {
case DROPTARGET_ONSELF:
break;
+
case DROPTARGET_ONCONTACT:
- if (ServiceExists(MS_MC_ADDTOMETA))
- {
+ if ( ServiceExists(MS_MC_ADDTOMETA)) {
ClcContact *contDest, *contSour;
int res;
HANDLE handle,hcontact;
@@ -1357,96 +1299,73 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
hcontact = contSour->hContact;
- if (contSour->type == CLCIT_CONTACT)
- {
-
- if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
- {
- if ( !contSour->isSubcontact)
- {
+ if (contSour->type == CLCIT_CONTACT) {
+ if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName)) {
+ if ( !contSour->isSubcontact) {
HANDLE hDest = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be converted to MetaContact and '%s' be added to it?"),contDest->szText, contSour->szText);
res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
+ if (res == 1) {
handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
- else
- {
- HANDLE handle,hcontact,hfrom,hdest;
- hcontact = contSour->hContact;
- hfrom = contSour->subcontacts->hContact;
- hdest = contDest->hContact;
+ else {
+ HANDLE hcontact = contSour->hContact;
+ HANDLE hfrom = contSour->subcontacts->hContact;
+ HANDLE hdest = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be converted to MetaContact and '%s' be added to it (remove it from '%s')?"), contDest->szText,contSour->szText,contSour->subcontacts->szText);
res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
-
- handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
- if ( !handle) return 0;
+ if (res == 1) {
+ HANDLE handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
+ if ( !handle)
+ return 0;
CallService(MS_MC_REMOVEFROMMETA,0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
}
-
}
}
break;
+
case DROPTARGET_ONMETACONTACT:
{
ClcContact *contDest, *contSour;
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type == CLCIT_CONTACT)
- {
-
- if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
- {
- if ( !contSour->isSubcontact)
- {
+ if (contSour->type == CLCIT_CONTACT) {
+ if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName)) {
+ if ( !contSour->isSubcontact) {
HANDLE handle,hcontact;
hcontact = contSour->hContact;
handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want to contact '%s' be added to metacontact '%s'?"),contSour->szText, contDest->szText);
res = MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
-
+ if (res == 1) {
if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
- else
- {
- if (contSour->subcontacts == contDest)
- {
+ else {
+ if (contSour->subcontacts == contDest) {
HANDLE hsour;
hsour = contSour->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be default ?"),contSour->szText);
res = MessageBox(hwnd,Wording,TranslateT("Set default contact"),MB_OKCANCEL|MB_ICONQUESTION);
-
if (res == 1)
- {
CallService(MS_MC_SETDEFAULTCONTACT,(WPARAM)contDest->hContact,(LPARAM)hsour);
- }
}
- else
- {
- HANDLE handle,hcontact,hfrom;
- hcontact = contSour->hContact;
- hfrom = contSour->subcontacts->hContact;
- handle = contDest->hContact;
+ else {
+ HANDLE hcontact = contSour->hContact;
+ HANDLE hfrom = contSour->subcontacts->hContact;
+ HANDLE handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->szText);
res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
-
+ if (res == 1) {
if ( !handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,0,(LPARAM)hcontact);
@@ -1458,57 +1377,48 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
}
break;
+
case DROPTARGET_ONSUBCONTACT:
{
ClcContact *contDest, *contSour;
int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type == CLCIT_CONTACT)
- {
- if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
- {
- if ( !contSour->isSubcontact)
- {
- HANDLE handle,hcontact;
- hcontact = contSour->hContact;
- handle = contDest->subcontacts->hContact;
+ if (contSour->type == CLCIT_CONTACT) {
+ if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName)) {
+ if ( !contSour->isSubcontact) {
+ HANDLE hcontact = contSour->hContact;
+ HANDLE handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be added to MetaContact '%s'?"), contSour->szText,contDest->subcontacts->szText);
res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
-
+ if (res == 1) {
if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
- else
- {
- if (contSour->subcontacts != contDest->subcontacts)
- {
- HANDLE handle,hcontact,hfrom;
- hcontact = contSour->hContact;
- hfrom = contSour->subcontacts->hContact;
- handle = contDest->subcontacts->hContact;
- mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->subcontacts->szText);
- res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res == 1)
- {
-
- if ( !handle) return 0;
+ else if (contSour->subcontacts != contDest->subcontacts) {
+ HANDLE handle,hcontact,hfrom;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ handle = contDest->subcontacts->hContact;
+ mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->subcontacts->szText);
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1) {
+ if ( !handle) return 0;
- CallService(MS_MC_REMOVEFROMMETA,0,(LPARAM)hcontact);
- CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
- }
+ CallService(MS_MC_REMOVEFROMMETA,0,(LPARAM)hcontact);
+ CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
}
}
}
break;
+
case DROPTARGET_ONGROUP:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
break;
+
case DROPTARGET_INSERTION:
{
ClcContact *contact, *destcontact;
@@ -1518,19 +1428,17 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int newIndex,i;
pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
- if (i != -1 && group->groupId != destgroup->groupId)
- {
- TCHAR * groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
- TCHAR * shortGroup = NULL;
- TCHAR * sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
+ if (i != -1 && group->groupId != destgroup->groupId) {
+ TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
+ TCHAR *shortGroup = NULL;
+ TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
if (groupName) {
int len = (int)_tcslen(groupName);
do {len--;}while(len >= 0 && groupName[len] != '\\');
if (len >= 0) shortGroup = groupName+len+1;
else shortGroup = groupName;
}
- if (shortGroup)
- {
+ if (shortGroup) {
NeedRename = TRUE;
if (sourceGrName)
mir_sntprintf(newName,SIZEOF(newName),_T("%s\\%s"),sourceGrName,shortGroup);
@@ -1543,15 +1451,16 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1)?destcontact->groupId:0);
newIndex = newIndex?newIndex:contact->groupId;
if (NeedRename) pcli->pfnRenameGroup(newIndex,newName);
- break;
}
+ break;
+
case DROPTARGET_OUTSIDE:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
break;
+
default:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
break;
-
}
}
@@ -1736,7 +1645,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP static LRESULT clcOnIntmAvatarChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
Cache_GetAvatar(dat, contact);
else if (dat->use_avatar_service && !wParam)
UpdateAllAvatars(dat);
@@ -1837,12 +1746,13 @@ static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, if (wParam != 0) {
pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
if (pdnce && pdnce->m_cache_cszProto) {
- ClcContact *contact = NULL;
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->hContact,pdnce->m_cache_cszProto));
if ( !dat->force_in_dialog && (dat->second_line_show || dat->third_line_show))
gtaRenewText(pdnce->hContact);
SendMessage(hwnd,INTM_ICONCHANGED, wParam, (LPARAM) CallService(MS_CLIST_GETCONTACTICON, wParam, 1));
- if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) {
+
+ ClcContact *contact;
+ if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) {
if (contact && contact->type == CLCIT_CONTACT) {
if ( !contact->image_is_special && pdnce___GetStatus( pdnce ) > ID_STATUS_OFFLINE)
contact->iImage = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index c1739d6a3c..dc030e2e7c 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -195,6 +195,9 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,ClcContact **contact,Clc group->scanIndex++;
}
+ if (isVisible) *isVisible = FALSE;
+ if (contact) *contact = NULL;
+ if (subgroup) *subgroup = NULL;
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 48ff30bc2e..898e0d4507 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -265,20 +265,25 @@ void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flag void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
{
- ClcGroup *group;
- ClcContact * cont;
pClcCacheEntry cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hContact);
- if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added
- if ( !dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
+ if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact)
+ return; //contact should not be added
+
+ if ( !dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName))
+ return;
+
corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline);
- if (FindItem(hwnd,dat,hContact,&cont,&group,NULL,FALSE))
+
+ ClcGroup *group;
+ ClcContact *cont;
+ if ( FindItem(hwnd,dat,hContact,&cont,&group,NULL,FALSE))
_LoadDataToContact(cont, group, dat, hContact);
return;
}
void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem)
{
- struct ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0);
+ ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0);
ClearRowByIndexCache();
corecli.pfnDeleteItemFromTree(hwnd, hItem);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 5bbc96b38d..675bcd942e 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -590,7 +590,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
+ if ( ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
@@ -677,7 +677,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w {
char str[MAX_PATH],strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
- if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
+ if ( ServiceExists(MS_UTILS_PATHTORELATIVE)) {
if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)str, (LPARAM)strrel))
db_set_s(NULL,"StatusBar","BkBitmap",strrel);
else db_set_s(NULL,"StatusBar","BkBitmap",str);
@@ -856,7 +856,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL,"CList","DisableTrayFlash",SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
if (IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 955cf7e5f7..9ab5f86298 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -462,8 +462,8 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) }
dat->selection = hit;
- if (g_szMetaModuleName && !mir_strcmp(contact->proto,g_szMetaModuleName) && (ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONMETACONTACT;
- if (contact->isSubcontact && (ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONSUBCONTACT;
+ if (g_szMetaModuleName && !mir_strcmp(contact->proto,g_szMetaModuleName) && ( ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONMETACONTACT;
+ if (contact->isSubcontact && ( ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONSUBCONTACT;
return DROPTARGET_ONCONTACT;
}
COLORREF sttGetColor(char * module, char * color, COLORREF defColor)
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 533f46a51b..dfd87f3dc2 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -75,7 +75,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) char str[MAXMODULELABELLENGTH];
strcpy(str,szProto);
strcat(str,"/GetXStatusIcon");
- if (ServiceExists(str))
+ if ( ServiceExists(str))
{
// check status is online
if (status>ID_STATUS_OFFLINE)
@@ -138,7 +138,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) mir_snprintf(AdvancedService,SIZEOF(AdvancedService),"%s%s",szActProto,"/GetAdvancedStatusIcon");
int result = -1;
- if (ServiceExists(AdvancedService))
+ if ( ServiceExists(AdvancedService))
result = CallService(AdvancedService,(WPARAM)hActContact, 0);
if (result == -1 || !(LOWORD(result))) {
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index fe5ac2dc86..0a86c8b4d4 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -242,7 +242,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton(hwndDlg, IDC_AVATAR_FASTDRAW, db_get_b(NULL,"CList","AvatarsInSeparateWnd",SETTINGS_AVATARINSEPARATE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AVATAR_DRAW_BORDER, db_get_b(NULL,"CList","AvatarsDrawBorders",SETTINGS_AVATARDRAWBORDER_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton(hwndDlg, IDC_AVATAR_ROUND_CORNERS, db_get_b(NULL,"CList","AvatarsRoundCorners",SETTINGS_AVATARROUNDCORNERS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
@@ -348,7 +348,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_SPIN),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS2),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS3),enabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),enabled && (ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),enabled && ( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail));
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH_SPIN),enabled);
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index dea8708184..c0abf2a8b7 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -66,10 +66,10 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM wParam,LPARAM lParam) g_CluiData.bMetaAvail = ServiceExists(MS_MC_GETDEFAULTCONTACT) ? TRUE : FALSE;
setlocale(LC_ALL, ""); //fix for case insensitive comparing
- if (ServiceExists(MS_MC_DISABLEHIDDENGROUP))
+ if ( ServiceExists(MS_MC_DISABLEHIDDENGROUP))
CallService(MS_MC_DISABLEHIDDENGROUP, (WPARAM)TRUE, 0);
- if (ServiceExists(MS_MC_GETPROTOCOLNAME))
+ if ( ServiceExists(MS_MC_GETPROTOCOLNAME))
g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
CLUIServices_ProtocolStatusChanged(0,0);
@@ -121,7 +121,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) else {
int has_avatar;
- if (ServiceExists(MS_AV_GETAVATARBITMAP))
+ if ( ServiceExists(MS_AV_GETAVATARBITMAP))
has_avatar = CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hItem, 0);
else {
DBVARIANT dbv = {0};
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index f08b600ce5..49ccd0ba06 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -3057,7 +3057,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam case WM_COMMAND:
- if (ServiceExists(MO_CREATENEWMENUOBJECT))
+ if ( ServiceExists(MO_CREATENEWMENUOBJECT))
{
//if ( CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),0),(LPARAM)Frameid)){break;};
if (ProcessCommandProxy(MAKEWPARAM(LOWORD(wParam),0),(LPARAM)Frameid)) break;
@@ -3097,7 +3097,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam POINT pt;
GetCursorPos(&pt);
- if (ServiceExists(MS_CLIST_MENUBUILDFRAMECONTEXT))
+ if ( ServiceExists(MS_CLIST_MENUBUILDFRAMECONTEXT))
{
hmenu = (HMENU)CallService(MS_CLIST_MENUBUILDFRAMECONTEXT,Frameid,0);
}
@@ -3550,7 +3550,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP /*
if ((msg == WM_MOVE) || (msg == WM_MOVING) || (msg == WM_NCLBUTTONDOWN) || (msg == WM_SYSCOMMAND) )
{
- if (ServiceExists("Utils/SnapWindowProc"))
+ if ( ServiceExists("Utils/SnapWindowProc"))
{
SnapWindowProc_t SnapInfo;
memset(&SnapInfo,0,sizeof(SnapInfo));
@@ -3649,7 +3649,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP /*
if ((msg == WM_MOVE) || (msg == WM_MOVING) || (msg == WM_NCLBUTTONDOWN) || (msg == WM_SYSCOMMAND) )
{
- if (ServiceExists("Utils/SnapWindowProc"))
+ if ( ServiceExists("Utils/SnapWindowProc"))
{
SnapWindowProc_t SnapInfo;
memset(&SnapInfo,0,sizeof(SnapInfo));
diff --git a/plugins/Clist_modern/src/modern_framesmenu.cpp b/plugins/Clist_modern/src/modern_framesmenu.cpp index 950bf122bb..b63532c4cb 100644 --- a/plugins/Clist_modern/src/modern_framesmenu.cpp +++ b/plugins/Clist_modern/src/modern_framesmenu.cpp @@ -179,7 +179,7 @@ int InitFramesMenus(void) InternalGenMenuModule = TRUE;
};
- if (ServiceExists(MO_REMOVEMENUOBJECT))
+ if ( ServiceExists(MO_REMOVEMENUOBJECT))
{
CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
@@ -204,7 +204,7 @@ int UnitFramesMenu() {
/*
- if (ServiceExists(MO_REMOVEMENUOBJECT))
+ if ( ServiceExists(MO_REMOVEMENUOBJECT))
{
CallService(MO_REMOVEMENUOBJECT,hFrameMenuObject,0);
if (InternalGenMenuModule){UnitGenMenu();};
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index 8bae142748..3f7de498a3 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -362,7 +362,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM if (bct)
if (bct->HandleService)
- if (ServiceExists(bct->HandleService))
+ if ( ServiceExists(bct->HandleService))
{
int t;
HandleServiceParams MSG = {0};
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 0351e8c2e5..7e915d2054 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -2028,7 +2028,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName) hBitmap = ske_LoadGlyphImage_TGA(szFileName);
f = 1;
}
- else if (ServiceExists("Image/Png2Dib") && mir_bool_strcmpi(ext,".png"))
+ else if ( ServiceExists("Image/Png2Dib") && mir_bool_strcmpi(ext,".png"))
{
hBitmap = ske_LoadGlyphImage_Png2Dib(szFileName);
GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 505e27fd3f..e0ed473040 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -373,7 +373,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if ((p.xStatusMode & 8) && p.ProtoStatus > ID_STATUS_OFFLINE) {
char str[MAXMODULELABELLENGTH];
mir_snprintf(str, SIZEOF(str), "%s/GetXStatus", p.AccountName);
- if (ServiceExists(str)) {
+ if ( ServiceExists(str)) {
char *dbTitle = "XStatusName";
char *dbTitle2 = NULL;
xstatus = CallProtoService(p.AccountName,"/GetXStatus",(WPARAM)&dbTitle,(LPARAM)&dbTitle2);
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index 0dfd111c39..fe30336531 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -140,8 +140,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
case INTM_ICONCHANGED:
- { struct ClcContact *contact = NULL;
- ClcGroup *group = NULL;
+ {
int recalcScrollBar = 0,shouldShow;
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
@@ -157,7 +156,10 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L status = cacheEntry->status;
shouldShow = (GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_SHOWHIDDEN || !cacheEntry->bIsHidden) && (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline || CallService(MS_CLIST_GETCONTACTICON,wParam,0) != LOWORD(lParam)); //this means an offline msg is flashing, so the contact should be shown
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL)) {
+
+ ClcContact *contact;
+ ClcGroup *group;
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
hSelItem = pcli->pfnContactToHItem(selcontact);
@@ -196,7 +198,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L } }
if (hSelItem) {
ClcGroup *selgroup;
- if (FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
+ if ( FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact));
else
dat->selection = -1;
@@ -207,12 +209,15 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L goto LBL_Exit;
}
case INTM_STATUSMSGCHANGED:
- { struct ClcContact *contact = NULL;
- ClcGroup *group = NULL;
+ {
DBVARIANT dbv;
- if (!(dat->style&CLS_SHOWSTATUSMESSAGES)) break;
- if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
+ if (!(dat->style & CLS_SHOWSTATUSMESSAGES))
+ break;
+
+ ClcContact *contact;
+ ClcGroup *group;
+ if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
if (!DBGetContactSettingTString((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
int j;
@@ -237,6 +242,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L RecalcScrollBar(hwnd,dat);
goto LBL_Exit;
}
+
case WM_TIMER:
if (wParam == TIMERID_DELAYEDREPAINT) {
KillTimer(hwnd,TIMERID_DELAYEDREPAINT);
@@ -263,15 +269,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L stopStatusUpdater = 1;
break;
}
- {
- LRESULT res = saveContactListControlWndProc(hwnd, msg, wParam, lParam);
- switch (msg) {
- case WM_CREATE:
- mir_forkthread(StatusUpdaterThread,0);
- break;
- }
- return res;
+
+ LRESULT res = saveContactListControlWndProc(hwnd, msg, wParam, lParam);
+ switch (msg) {
+ case WM_CREATE:
+ mir_forkthread(StatusUpdaterThread,0);
+ break;
}
+ return res;
LBL_Exit:
return DefWindowProc(hwnd, msg, wParam, lParam);
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 275a7316b0..8c254fef90 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -231,6 +231,10 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont }
group->scanIndex++;
}
+
+ if (isVisible) *isVisible = FALSE;
+ if (contact) *contact = NULL;
+ if (subgroup) *subgroup = NULL;
return 0;
}
#define CacheArrSize 255
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 40d048d601..5935022209 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -187,9 +187,9 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group return group->cl.items[i];
}
-void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
+void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline)
{
- if (FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
+ if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
return;
pClcCacheEntry cacheEntry = GetContactFullCacheEntry(hContact);
diff --git a/plugins/Clist_nicer/src/clcidents.cpp b/plugins/Clist_nicer/src/clcidents.cpp index f649029c9d..12f5464e41 100644 --- a/plugins/Clist_nicer/src/clcidents.cpp +++ b/plugins/Clist_nicer/src/clcidents.cpp @@ -98,5 +98,9 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, }
group->scanIndex++;
}
+
+ if (isVisible) *isVisible = FALSE;
+ if (contact) *contact = NULL;
+ if (subgroup) *subgroup = NULL;
return 0;
}
diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index ad144c04d3..390c704325 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -132,6 +132,10 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac }
group->scanIndex++;
}
+
+ if (isVisible) *isVisible = FALSE;
+ if (contact) *contact = NULL;
+ if (subgroup) *subgroup = NULL;
return 0;
}
|