diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 21:30:16 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 21:30:16 +0000 |
commit | c730f12da81f636ecf65aa656a46b9337daaa37a (patch) | |
tree | 0b069d59b6366447e0a0d40982ac610fbe86d9a7 /plugins/Clist_modern/src/modern_rowtemplateopt.cpp | |
parent | 91867c03b57bbf85eae500475683c16da4ec3a9c (diff) |
Clist_modern: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_rowtemplateopt.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_rowtemplateopt.cpp | 361 |
1 files changed, 180 insertions, 181 deletions
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 816d58bcb8..bfb0fd386f 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -27,24 +27,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_commonprototypes.h"
#include "hdr/modern_row.h"
-void RefreshTree(HWND hwndDlg,HTREEITEM hti);
+void RefreshTree(HWND hwndDlg, HTREEITEM hti);
static char* rowOptTmplStr;
static ROWCELL* rowOptTmplRoot;
static ROWCELL* rowOptTA[100];
TCHAR *types[] = {
- _T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
- _T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
+ _T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
+ _T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
_T("extra4"), _T("extra5"), _T("extra6"), _T("extra7"), _T("extra8"),
- _T("extra9"), _T("time"), _T("space"), _T("fspace")
+ _T("extra9"), _T("time"), _T("space"), _T("fspace")
};
-RECT da = {205,58,440, 130}; // Draw area
+RECT da = { 205, 58, 440, 130 }; // Draw area
void rowOptBuildTA(pROWCELL cell, pROWCELL* TA, int* i)
{
if (!cell) return;
TA[(*i)++] = cell;
- rowOptBuildTA(cell->child,TA, i);
+ rowOptBuildTA(cell->child, TA, i);
rowOptBuildTA(cell->next, TA, i);
}
@@ -56,45 +56,45 @@ void rowOptShowSettings(HWND hwnd) int param;
tvi.hItem = node;
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
TreeView_GetItem(GetDlgItem(hwnd, IDC_ROWTREE), &tvi);
cell = (pROWCELL)tvi.lParam;
if (!tvi.hItem) {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),0);
- EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, 0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTTYPE), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_VALIGN), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_HALIGN), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTLAYER), 0);
return;
}
- EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),1);
- EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTTYPE), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_VALIGN), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_HALIGN), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTLAYER), 1);
if (cell->type != TC_SPACE && cell->type != TC_FIXED) {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, 0);
}
else {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),1);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, MAKELONG(cell->w,0));
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, MAKELONG(cell->h,0));
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 1);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, MAKELONG(cell->w, 0));
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, MAKELONG(cell->h, 0));
}
SendDlgItemMessage(hwnd, IDC_CONTTYPE, CB_SETCURSEL, cell->type, 0);
@@ -123,7 +123,7 @@ void rowOptShowSettings(HWND hwnd) }
SendDlgItemMessage(hwnd, IDC_HALIGN, CB_SETCURSEL, param, 0);
- CheckDlgButton(hwnd,IDC_CONTLAYER,cell->layer ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_CONTLAYER, cell->layer ? BST_CHECKED : BST_UNCHECKED);
}
void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd)
@@ -133,7 +133,7 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) TVINSERTSTRUCT tvis;
tvis.hParent = node;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.lParam = (LPARAM)cell;
@@ -145,12 +145,12 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) tvis.item.pszText = _T("Column");
}
- tvis.item.iImage = cell->child?1:2;
- tvis.item.iSelectedImage = cell->child?0:2;
+ tvis.item.iImage = cell->child ? 1 : 2;
+ tvis.item.iSelectedImage = cell->child ? 0 : 2;
- HTREEITEM pnode = TreeView_InsertItem(hwnd,&tvis);
+ HTREEITEM pnode = TreeView_InsertItem(hwnd, &tvis);
rowOptGenerateTreeView(cell->child, pnode, hwnd);
- rowOptGenerateTreeView(cell->next, node, hwnd);
+ rowOptGenerateTreeView(cell->next, node, hwnd);
}
int rowOptFillRowTree(HWND hwnd)
@@ -181,7 +181,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) else {
// Get parent item
tviparent.hItem = hti;
- tviparent.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tviparent.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tviparent);
cell = (pROWCELL)tviparent.lParam;
@@ -196,11 +196,11 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) while (cell->next)
cell = cell->next;
- rowAddCell(cell->next, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
+ rowAddCell(cell->next, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW ? TC_COL : TC_ROW);
cell = cell->next;
}
else {
- rowAddCell(cell->child, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
+ rowAddCell(cell->child, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW ? TC_COL : TC_ROW);
cell = cell->child;
}
@@ -210,12 +210,12 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) tvis.item.lParam = (LPARAM)cell;
tvis.hParent = hti;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.iImage = 2;
tvis.item.iSelectedImage = 2;
- TreeView_InsertItem(htree,&tvis);
+ TreeView_InsertItem(htree, &tvis);
TreeView_Expand(htree, hti, TVM_EXPAND);
@@ -224,7 +224,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) tviparent.iSelectedImage = 0;
TreeView_SetItem(htree, &tviparent);
- int i=0;
+ int i = 0;
memset(rowOptTA, 0, sizeof(rowOptTA));
rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &i);
}
@@ -239,10 +239,10 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) // Get current tree item
tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tvi);
- tvpi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvpi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
if (prev)
{
@@ -272,9 +272,9 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) rowDeleteTree((pROWCELL)tvi.lParam);
{
- int i=0;
+ int i = 0;
memset(rowOptTA, 0, sizeof(rowOptTA));
- rowOptBuildTA((pROWCELL)tvpi.lParam, (pROWCELL*)&rowOptTA, &i );
+ rowOptBuildTA((pROWCELL)tvpi.lParam, (pROWCELL*)&rowOptTA, &i);
}
TreeView_DeleteItem(htree, hti);
@@ -283,7 +283,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) // Change icon at parent item
if (!prnt || (prnt != prev)) return;
- if ( TreeView_GetChild(htree, prnt))
+ if (TreeView_GetChild(htree, prnt))
{
tvpi.iImage = 1;
tvpi.iSelectedImage = 0;
@@ -297,11 +297,11 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) }
-void RefreshTree(HWND hwndDlg,HTREEITEM hti)
+void RefreshTree(HWND hwndDlg, HTREEITEM hti)
{
HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
pROWCELL cell;
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
if (hti == NULL) hti = TreeView_GetRoot(htree);
while (hti)
{
@@ -311,7 +311,7 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) cell = (pROWCELL)tvi.lParam;
if (cell)
{
- TCHAR buf[200] = {0};
+ TCHAR buf[200] = { 0 };
if (!cell->child)
{
if (cell->type == 0)
@@ -324,159 +324,158 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) if (cell->type == 0)
_tcsncpy_s(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _TRUNCATE);
else
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]),cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines"));
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
}
- if (cell->layer) _tcsncat(buf,TranslateT(" layered"),SIZEOF(buf));
- tvi.mask = TVIF_HANDLE|TVIF_TEXT;
+ if (cell->layer) _tcsncat(buf, TranslateT(" layered"), SIZEOF(buf));
+ tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.pszText = buf;
- TreeView_SetItem(htree,&tvi);
+ TreeView_SetItem(htree, &tvi);
}
{
- HTREEITEM child_hti = TreeView_GetChild(htree,hti);
- if (child_hti) RefreshTree(hwndDlg,child_hti);
+ HTREEITEM child_hti = TreeView_GetChild(htree, hti);
+ if (child_hti) RefreshTree(hwndDlg, child_hti);
}
- hti = TreeView_GetNextSibling(htree,hti);
+ hti = TreeView_GetNextSibling(htree, hti);
}
- RedrawWindow(hwndDlg,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
- {
- int hbuf = 0, seq = 0;
- HWND htree = GetDlgItem(hwndDlg,IDC_ROWTREE);
+ {
+ int hbuf = 0, seq = 0;
+ HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
- TranslateDialogDefault(hwndDlg);
- rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
- if (!rowOptTmplStr)
- rowOptTmplStr = mir_strdup("<TR />");
+ TranslateDialogDefault(hwndDlg);
+ rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
+ if (!rowOptTmplStr)
+ rowOptTmplStr = mir_strdup("<TR />");
- SendDlgItemMessage(hwndDlg,IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999,0));
- SendDlgItemMessage(hwndDlg,IDC_SPINCONTHEIGHT,UDM_SETRANGE, 0, MAKELONG(999,0));
+ SendDlgItemMessage(hwndDlg, IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPINCONTHEIGHT, UDM_SETRANGE, 0, MAKELONG(999, 0));
- int i, item;
+ int i, item;
- for (i=0; i < SIZEOF(types); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING, 0, (LPARAM)TranslateTS(types[i]));
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETCURSEL, 0, 0);
+ for (i = 0; i < SIZEOF(types); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(types[i]));
+ SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETITEMDATA, item, 0);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETCURSEL, 0, 0);
- TCHAR *h_alignment[] = {_T("left"), _T("hCenter"), _T("right")};
- for (i=0; i < SIZEOF(h_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETCURSEL, 0, 0);
+ TCHAR *h_alignment[] = { _T("left"), _T("hCenter"), _T("right") };
+ for (i = 0; i < SIZEOF(h_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
+ SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETITEMDATA, item, 0);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETCURSEL, 0, 0);
- TCHAR *v_alignment[] = {_T("top"), _T("vCenter"), _T("bottom")};
- for (i=0; i < SIZEOF(v_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETCURSEL, 0, 0);
-
- rowDeleteTree(rowOptTmplRoot);
- rowOptTmplRoot = NULL;
- rowParse(rowOptTmplRoot, rowOptTmplRoot, rowOptTmplStr, hbuf, seq, rowOptTA);
- seq = 0;
- memset(rowOptTA, 0, sizeof(rowOptTA));
- rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &seq);
-
- rowOptFillRowTree(htree);
- RefreshTree(hwndDlg,NULL);
- TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_ROWTREE), TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_ROWTREE)));
- rowOptShowSettings(hwndDlg);
+ TCHAR *v_alignment[] = { _T("top"), _T("vCenter"), _T("bottom") };
+ for (i = 0; i < SIZEOF(v_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
+ SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETITEMDATA, item, 0);
}
- return TRUE;
+ SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETCURSEL, 0, 0);
+
+ rowDeleteTree(rowOptTmplRoot);
+ rowOptTmplRoot = NULL;
+ rowParse(rowOptTmplRoot, rowOptTmplRoot, rowOptTmplStr, hbuf, seq, rowOptTA);
+ seq = 0;
+ memset(rowOptTA, 0, sizeof(rowOptTA));
+ rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &seq);
+
+ rowOptFillRowTree(htree);
+ RefreshTree(hwndDlg, NULL);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_ROWTREE), TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_ROWTREE)));
+ rowOptShowSettings(hwndDlg);
+ }
+ return TRUE;
case WM_COMMAND:
- {
- HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
- pROWCELL cell;
- TVITEM tvi = {0};
- HTREEITEM hti = TreeView_GetSelection(htree);
-
-
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- TreeView_GetItem(htree, &tvi);
- cell = (pROWCELL)tvi.lParam;
-
- switch (LOWORD(wParam)) {
- case IDC_CONTTYPE:
- if (HIWORD(wParam) == CBN_SELENDOK) {
- TVITEM tv = {0};
- int index = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_GETCURSEL, 0, 0);
- cell->type = index;
- RefreshTree(hwndDlg,NULL);
- }
+ {
+ HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
+ pROWCELL cell;
+ TVITEM tvi = { 0 };
+ HTREEITEM hti = TreeView_GetSelection(htree);
- case IDC_VALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK) {
- switch (SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_GETCURSEL, 0, 0)) {
- case 0:
- cell->valign = TC_TOP;
- break;
- case 1:
- cell->valign = TC_VCENTER;
- break;
- case 2:
- cell->valign = TC_BOTTOM;
- break;
- }
- RefreshTree(hwndDlg,NULL);
- }
- case IDC_HALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK) {
- switch (SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_GETCURSEL, 0, 0)) {
- case 0:
- cell->halign = TC_LEFT;
- break;
- case 1:
- cell->halign = TC_HCENTER;
- break;
- case 2:
- cell->halign = TC_RIGHT;
- break;
- }
- RefreshTree(hwndDlg,NULL);
- }
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ TreeView_GetItem(htree, &tvi);
+ cell = (pROWCELL)tvi.lParam;
+
+ switch (LOWORD(wParam)) {
+ case IDC_CONTTYPE:
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ int index = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_GETCURSEL, 0, 0);
+ cell->type = index;
+ RefreshTree(hwndDlg, NULL);
}
- if (HIWORD(wParam) == BN_CLICKED) {
- if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_ADDCONTAINER))
- // Adding new container
- {
- rowOptAddContainer(htree, hti);
- }
- else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_DELCONTAINER))
- // Deleting container
- {
- rowOptDelContainer(htree, hti);
+ case IDC_VALIGN:
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_GETCURSEL, 0, 0)) {
+ case 0:
+ cell->valign = TC_TOP;
+ break;
+ case 1:
+ cell->valign = TC_VCENTER;
+ break;
+ case 2:
+ cell->valign = TC_BOTTOM;
+ break;
}
- else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTUP))
- // Moving container to up
- {
- RedrawWindow(htree,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RefreshTree(hwndDlg, NULL);
+ }
+
+ case IDC_HALIGN:
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_GETCURSEL, 0, 0)) {
+ case 0:
+ cell->halign = TC_LEFT;
+ break;
+ case 1:
+ cell->halign = TC_HCENTER;
+ break;
+ case 2:
+ cell->halign = TC_RIGHT;
+ break;
}
- RefreshTree(hwndDlg,NULL);
- RedrawWindow(GetParent(hwndDlg),NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RefreshTree(hwndDlg, NULL);
}
- return TRUE;
}
+ if (HIWORD(wParam) == BN_CLICKED) {
+ if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_ADDCONTAINER))
+ // Adding new container
+ {
+ rowOptAddContainer(htree, hti);
+ }
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_DELCONTAINER))
+ // Deleting container
+ {
+ rowOptDelContainer(htree, hti);
+ }
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_CONTUP))
+ // Moving container to up
+ {
+ RedrawWindow(htree, &da, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ }
+ RefreshTree(hwndDlg, NULL);
+ RedrawWindow(GetParent(hwndDlg), NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ }
+ return TRUE;
+ }
+
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_ROWTREE:
- if (((LPNMHDR)lParam)->code == NM_SETCURSOR )
+ if (((LPNMHDR)lParam)->code == NM_SETCURSOR)
rowOptShowSettings(hwndDlg);
- if (((LPNMHDR)lParam)->code == NM_CLICK )
- RedrawWindow(hwndDlg,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
+ if (((LPNMHDR)lParam)->code == NM_CLICK)
+ RedrawWindow(hwndDlg, &da, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
break;
case 0: // Apply or Ok button is pressed
@@ -487,7 +486,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_PAINT:
if (rowOptTmplRoot) {
- int i=0;
+ int i = 0;
// Drawning row template at properties page
PAINTSTRUCT ps;
@@ -495,11 +494,11 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TVITEM curItem;
curItem.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_ROWTREE));
- curItem.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ curItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_ROWTREE), &curItem);
- while(rowOptTA[i]) {
- switch(rowOptTA[i]->type) {
+ while (rowOptTA[i]) {
+ switch (rowOptTA[i]->type) {
case TC_AVATAR:
rowOptTA[i]->w = 25;
rowOptTA[i]->h = 30;
@@ -541,12 +540,12 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM i++;
}
- rowSizeWithReposition(rowOptTmplRoot, da.right-da.left);
+ rowSizeWithReposition(rowOptTmplRoot, da.right - da.left);
i = -1;
while (rowOptTA[++i]) {
- switch(rowOptTA[i]->type) {
+ switch (rowOptTA[i]->type) {
case TC_SPACE:
case TC_FIXED:
case 0:
@@ -554,9 +553,9 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM continue;
}
Rectangle(hdc,
- rowOptTA[i]->r.left + da.left,
- rowOptTA[i]->r.top + da.top,
- rowOptTA[i]->r.right + da.left,
+ rowOptTA[i]->r.left + da.left,
+ rowOptTA[i]->r.top + da.top,
+ rowOptTA[i]->r.right + da.left,
rowOptTA[i]->r.bottom + da.top);
}
|