diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-06 22:23:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-06 22:23:39 +0000 |
commit | b8a20c7e3e0dca06effc09868bc5cf1702be30cf (patch) | |
tree | 3fc23f24f6aaff7c0796d1fbedfd907cda9d86f4 /plugins/Clist_modern/modern_clcmsgs.cpp | |
parent | f6943a588688a64a0154a0bc3a2a56ad8727e9fa (diff) |
more correct autoformatter
git-svn-id: http://svn.miranda-ng.org/main/trunk@803 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_clcmsgs.cpp')
-rw-r--r-- | plugins/Clist_modern/modern_clcmsgs.cpp | 198 |
1 files changed, 90 insertions, 108 deletions
diff --git a/plugins/Clist_modern/modern_clcmsgs.cpp b/plugins/Clist_modern/modern_clcmsgs.cpp index 23892a4795..251a540d26 100644 --- a/plugins/Clist_modern/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/modern_clcmsgs.cpp @@ -30,23 +30,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARAM wParam,LPARAM lParam)
{
- switch(msg)
- {
-
+ ClcContact *contact;
+ ClcGroup *group;
+
+ switch(msg) {
case CLM_DELETEITEM:
- {
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
- clcSetDelayTimer( TIMERID_DELAYEDRESORTCLC, hwnd, 1 ); //pcli->pfnSortCLC(hwnd, dat, 1);
- clcSetDelayTimer( TIMERID_RECALCSCROLLBAR, hwnd, 2 ); //pcli->pfnRecalcScrollBar(hwnd, dat);
- }
+ pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
+ clcSetDelayTimer( TIMERID_DELAYEDRESORTCLC, hwnd, 1 ); //pcli->pfnSortCLC(hwnd, dat, 1);
+ clcSetDelayTimer( TIMERID_RECALCSCROLLBAR, hwnd, 2 ); //pcli->pfnRecalcScrollBar(hwnd, dat);
return 0;
+
case CLM_AUTOREBUILD:
if (dat->force_in_dialog)
- {
pcli->pfnSaveStateAndRebuildList(hwnd, dat);
- }
- else
- {
+ else {
clcSetDelayTimer( TIMERID_REBUILDAFTER, hwnd );
CLM_AUTOREBUILD_WAS_POSTED = FALSE;
}
@@ -69,7 +66,6 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return 0;
-
case CLM_SETHIDEEMPTYGROUPS:
{
BOOL old = ((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS) != 0);
@@ -81,7 +77,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA SendMessage(hwnd,CLM_AUTOREBUILD,0,0);
}
return 0;
-
+
case CLM_SETTEXTCOLOR:
if (wParam < 0 || wParam>FONTID_MODERN_MAX) break;
@@ -89,51 +85,46 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA dat->force_in_dialog = TRUE;
// Issue 40: option knows nothing about moderns colors
// others who know have to set colors from lowest to highest
- switch ( wParam )
- {
- case FONTID_CONTACTS:
- dat->fontModernInfo[FONTID_SECONDLINE].colour = lParam;
- dat->fontModernInfo[FONTID_THIRDLINE].colour = lParam;
- dat->fontModernInfo[FONTID_AWAY].colour = lParam;
- dat->fontModernInfo[FONTID_DND].colour = lParam;
- dat->fontModernInfo[FONTID_NA].colour = lParam;
- dat->fontModernInfo[FONTID_OCCUPIED].colour = lParam;
- dat->fontModernInfo[FONTID_CHAT].colour = lParam;
- dat->fontModernInfo[FONTID_INVISIBLE].colour = lParam;
- dat->fontModernInfo[FONTID_PHONE].colour = lParam;
- dat->fontModernInfo[FONTID_LUNCH].colour = lParam;
- dat->fontModernInfo[FONTID_CONTACT_TIME].colour = lParam;
- break;
- case FONTID_OPENGROUPS:
- dat->fontModernInfo[FONTID_CLOSEDGROUPS].colour = lParam;
- break;
- case FONTID_OPENGROUPCOUNTS:
- dat->fontModernInfo[FONTID_CLOSEDGROUPCOUNTS].colour = lParam;
- break;
+ switch ( wParam ) {
+ case FONTID_CONTACTS:
+ dat->fontModernInfo[FONTID_SECONDLINE].colour = lParam;
+ dat->fontModernInfo[FONTID_THIRDLINE].colour = lParam;
+ dat->fontModernInfo[FONTID_AWAY].colour = lParam;
+ dat->fontModernInfo[FONTID_DND].colour = lParam;
+ dat->fontModernInfo[FONTID_NA].colour = lParam;
+ dat->fontModernInfo[FONTID_OCCUPIED].colour = lParam;
+ dat->fontModernInfo[FONTID_CHAT].colour = lParam;
+ dat->fontModernInfo[FONTID_INVISIBLE].colour = lParam;
+ dat->fontModernInfo[FONTID_PHONE].colour = lParam;
+ dat->fontModernInfo[FONTID_LUNCH].colour = lParam;
+ dat->fontModernInfo[FONTID_CONTACT_TIME].colour = lParam;
+ break;
+ case FONTID_OPENGROUPS:
+ dat->fontModernInfo[FONTID_CLOSEDGROUPS].colour = lParam;
+ break;
+ case FONTID_OPENGROUPCOUNTS:
+ dat->fontModernInfo[FONTID_CLOSEDGROUPCOUNTS].colour = lParam;
+ break;
}
return 0;
case CLM_GETNEXTITEM:
{
- struct ClcContact *contact;
- struct ClcGroup *group;
int i;
-
- if (wParam !=CLGN_ROOT) {
+ if (wParam != CLGN_ROOT) {
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
return (LRESULT) (HANDLE) NULL;
i = List_IndexOf((SortedList*)&group->cl,contact);
if (i < 0) return 0;
}
- switch (wParam)
- {
+ switch (wParam) {
case CLGN_ROOT:
if (dat->list.cl.count)
return (LRESULT) pcli->pfnContactToHItem(dat->list.cl.items[0]);
else
return (LRESULT) (HANDLE) NULL;
case CLGN_CHILD:
- if (contact->type !=CLCIT_GROUP)
+ if (contact->type != CLCIT_GROUP)
return (LRESULT) (HANDLE) NULL;
group = contact->group;
if (group->cl.count == 0)
@@ -142,30 +133,30 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
case CLGN_NEXT:
- do {
- if (++i >= group->cl.count)
- return NULL;
- }
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ do {
+ if (++i >= group->cl.count)
+ return NULL;
+ }
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUS:
- do {
- if (--i < 0)
- return NULL;
- }
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ do {
+ if (--i < 0)
+ return NULL;
+ }
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTCONTACT:
for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSCONTACT:
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i < 0)
@@ -175,13 +166,13 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSGROUP:
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i < 0)
@@ -193,8 +184,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA return 0;
case CLM_SELECTITEM:
{
- struct ClcContact *contact;
- struct ClcGroup *group, *tgroup;
+ struct ClcGroup *tgroup;
int index = -1;
int mainindex = -1;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
@@ -213,68 +203,60 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA mainindex = index;
index += contact->isSubcontact;
}
- {
- BYTE k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- if (k)
+
+ BYTE k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ if (k) {
+ for (int i=0; i < mainindex; i++)
{
- int subcontactscount = 0;
- int i;
- for ( i = 0; i < mainindex; i++)
- {
- struct ClcContact *tempCont = group->cl.items[i];
- if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
- index += tempCont->SubAllocated;
- }
- }
- }
+ struct ClcContact *tempCont = group->cl.items[i];
+ if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
+ index += tempCont->SubAllocated;
+ }
+ }
+
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, group, index);
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
}
return 0;
case CLM_SETEXTRAIMAGE:
- {
- struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
- return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
- return 0;
- contact->iExtraImage[LOWORD(lParam)] = (BYTE) HIWORD(lParam); //set oldstyle icon
- contact->iWideExtraImage[LOWORD(lParam)] = (WORD) 0xFFFF; //reset wide icon
- pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
- }
+
+ if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ return 0;
+
+ contact->iExtraImage[LOWORD(lParam)] = (BYTE) HIWORD(lParam); //set oldstyle icon
+ contact->iWideExtraImage[LOWORD(lParam)] = (WORD) 0xFFFF; //reset wide icon
+ pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ return 0;
case CLM_SETWIDEEXTRAIMAGE:
- {
- struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
- return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
- return 0;
- contact->iExtraImage[LOWORD(lParam)] = (BYTE) 0xFF; //reset oldstyle icon
- contact->iWideExtraImage[LOWORD(lParam)] = (WORD) HIWORD(lParam); //set wide icon
- pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
- return 0;
- }
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
+ return 0;
- case CLM_SETEXTRAIMAGELIST:
- {
- dat->himlExtraColumns = (HIMAGELIST) lParam;
- dat->himlWideExtraColumns = (HIMAGELIST) wParam;
- pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0;
- }
+
+ contact->iExtraImage[LOWORD(lParam)] = (BYTE) 0xFF; //reset oldstyle icon
+ contact->iWideExtraImage[LOWORD(lParam)] = (WORD) HIWORD(lParam); //set wide icon
+ pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ return 0;
+
+ case CLM_SETEXTRAIMAGELIST:
+ dat->himlExtraColumns = (HIMAGELIST) lParam;
+ dat->himlWideExtraColumns = (HIMAGELIST) wParam;
+ pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ return 0;
case CLM_GETWIDEEXTRAIMAGE:
- {
- struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
- return 0xFFFF;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
- return 0xFFFF;
- return contact->iWideExtraImage[LOWORD(lParam)];
- }
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
+ return 0xFFFF;
+
+ if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ return 0xFFFF;
+
+ return contact->iWideExtraImage[LOWORD(lParam)];
}
return corecli.pfnProcessExternalMessages(hwnd, dat, msg, wParam, lParam);
}
|