summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_newrowopts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern/src/modern_newrowopts.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_newrowopts.cpp105
1 files changed, 52 insertions, 53 deletions
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp
index 4e44190c77..2cf437935d 100644
--- a/plugins/Clist_modern/src/modern_newrowopts.cpp
+++ b/plugins/Clist_modern/src/modern_newrowopts.cpp
@@ -58,11 +58,11 @@ NodeList * AddNode(NodeList * Parent)
memset(res, 0, sizeof(NodeList));
return res;
}
- Parent->childNodes = (NodeList*) mir_realloc(Parent->childNodes,sizeof(NodeList)*(Parent->AllocatedChilds+1));
+ Parent->childNodes = (NodeList*)mir_realloc(Parent->childNodes, sizeof(NodeList)*(Parent->AllocatedChilds + 1));
memset(&(Parent->childNodes[Parent->AllocatedChilds]), 0, sizeof(NodeList));
Parent->childNodes[Parent->AllocatedChilds].itemParent = Parent;
Parent->AllocatedChilds++;
- return &(Parent->childNodes[Parent->AllocatedChilds-1]);
+ return &(Parent->childNodes[Parent->AllocatedChilds - 1]);
}
@@ -71,7 +71,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index)
if (!FromList) return FALSE;
if (FromList->AllocatedChilds <= index) return FALSE;
NodeList *work = &(FromList->childNodes[index]);
- for (size_t i=0; i < work->AllocatedChilds; i++)
+ for (size_t i = 0; i < work->AllocatedChilds; i++)
if (work->childNodes[i].AllocatedChilds)
RemoveChildNode(work->childNodes, (DWORD)i);
@@ -79,7 +79,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index)
mir_free_and_nil(work->childNodes);
work->AllocatedChilds = 0;
}
- memmove(FromList->childNodes+index,FromList->childNodes+index+1,sizeof(NodeList)*(FromList->AllocatedChilds-index-1));
+ memmove(FromList->childNodes + index, FromList->childNodes + index + 1, sizeof(NodeList)*(FromList->AllocatedChilds - index - 1));
FromList->AllocatedChilds--;
return TRUE;
}
@@ -90,18 +90,17 @@ BOOL RemoveNode(NodeList * FromList)
if (FromList->itemParent)
{
DWORD k;
- for (k = 0;k < FromList->itemParent->AllocatedChilds;k++)
+ for (k = 0; k < FromList->itemParent->AllocatedChilds; k++)
if (&(FromList->itemParent->childNodes[k]) == FromList)
{
- BOOL res = RemoveChildNode(FromList->itemParent,k);
+ BOOL res = RemoveChildNode(FromList->itemParent, k);
return res;
}
}
do
{
- RemoveChildNode(FromList,0);
- }
- while (FromList->AllocatedChilds>0);
+ RemoveChildNode(FromList, 0);
+ } while (FromList->AllocatedChilds>0);
mir_free_and_nil(FromList->childNodes);
mir_free_and_nil(FromList);
return TRUE;
@@ -110,7 +109,7 @@ int ident = 0;
void PrintIdent()
{
int k;
- for (k = 0;k < ident;k++)
+ for (k = 0; k < ident; k++)
TRACE("-");
}
@@ -121,11 +120,11 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf,SIZEOF(buf),"%d\n",node->pData);
+ mir_snprintf(buf, SIZEOF(buf), "%d\n", node->pData);
TRACE(buf);
}
ident += 5;
- for (i=0; i < node->AllocatedChilds; i++)
+ for (i = 0; i < node->AllocatedChilds; i++)
{
if (node->childNodes[i].AllocatedChilds>0)
@@ -135,7 +134,7 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf,SIZEOF(buf),"%d\n",node->childNodes[i].pData);
+ mir_snprintf(buf, SIZEOF(buf), "%d\n", node->childNodes[i].pData);
TRACE(buf);
}
}
@@ -143,55 +142,55 @@ void TraceTreeLevel(NodeList * node)
ident -= 5;
}
-BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
- {
- NodeList * res1,*res2, *res3;
- int i=0;
- RootNode = AddNode(NULL);
- RootNode->pData = i++;
- res1 = AddNode(RootNode);
- res1->pData = i++;
- res1 = AddNode(RootNode);
- res1->pData = i++;
- res2 = AddNode(res1);
- res2->pData = i++;
- res2 = AddNode(res1);
- res2->pData = i++;
- res3 = AddNode(res2);
- res3->pData = i++;
- res3 = AddNode(res1);
- res3->pData = i++;
- res3 = AddNode(RootNode);
- res3->pData = i++;
- TRACE("*********** Nodes DUMP 1 ***********\n");
- TraceTreeLevel(RootNode);
- if (RemoveNode(res1)) res1 = 0;
- TRACE("*********** Nodes DUMP 2 ***********\n");
- TraceTreeLevel(RootNode);
- //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- MessageBox(hwndDlg,_T("Init NewRow Dialog"),_T("Notify"),MB_OK);
- break;
- }
+ {
+ NodeList * res1, *res2, *res3;
+ int i = 0;
+ RootNode = AddNode(NULL);
+ RootNode->pData = i++;
+ res1 = AddNode(RootNode);
+ res1->pData = i++;
+ res1 = AddNode(RootNode);
+ res1->pData = i++;
+ res2 = AddNode(res1);
+ res2->pData = i++;
+ res2 = AddNode(res1);
+ res2->pData = i++;
+ res3 = AddNode(res2);
+ res3->pData = i++;
+ res3 = AddNode(res1);
+ res3->pData = i++;
+ res3 = AddNode(RootNode);
+ res3->pData = i++;
+ TRACE("*********** Nodes DUMP 1 ***********\n");
+ TraceTreeLevel(RootNode);
+ if (RemoveNode(res1)) res1 = 0;
+ TRACE("*********** Nodes DUMP 2 ***********\n");
+ TraceTreeLevel(RootNode);
+ //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ MessageBox(hwndDlg, _T("Init NewRow Dialog"), _T("Notify"), MB_OK);
+ break;
+ }
case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
{
- switch (((LPNMHDR)lParam)->idFrom)
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
{
- case 0:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- return TRUE;
- }
- }
- }
+ return TRUE;
+ }
}
}
+ }
+ }
}
return 0;
};