diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-06 20:25:36 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-06 20:25:36 +0000 |
commit | e7891a7f13d94b6eae7f74f7354e0a3643d1de01 (patch) | |
tree | 27697969b8bab7310047805e124133272e04e6ca /plugins/TipperYM | |
parent | 30fa7c6549fa7fa5195f3348f7d9197fb8fe928d (diff) |
small cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@4350 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r-- | plugins/TipperYM/src/options.cpp | 496 |
1 files changed, 245 insertions, 251 deletions
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 383770067c..8436b5f632 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -27,16 +27,16 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) {
if (swzProto == NULL)
return 0;
-
+
char szSetting[64];
- if (bExtendedTip)
+ if (bExtendedTip)
strcpy(szSetting, "TrayProtocolsEx");
- else
+ else
strcpy(szSetting, "TrayProtocols");
DBVARIANT dbv;
int result = 1;
- if (!db_get_ts(NULL, MODULE, szSetting, &dbv))
+ if (!db_get_ts(NULL, MODULE, szSetting, &dbv))
{
result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
@@ -45,12 +45,12 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) return result;
}
-void CreateDefaultItems()
+void CreateDefaultItems()
{
DSListNode *ds_node;
DIListNode *di_node;
- for (int i = 0; defaultItemList[i].szName; i++)
+ for (int i = 0; defaultItemList[i].szName; i++)
{
if (defaultItemList[i].szName[0] == '-')
{
@@ -63,13 +63,13 @@ void CreateDefaultItems() di_node->next = opt.diList;
opt.diList = di_node;
opt.iDiCount++;
- }
- else
+ }
+ else
{
PRESETITEM *item = GetPresetItemByName(defaultItemList[i].szName);
if (item == NULL) continue;
- for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++)
+ for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++)
{
PRESETSUBST *subst = GetPresetSubstByName(item->szNeededSubst[j]);
if (subst == NULL) continue;
@@ -98,15 +98,14 @@ void CreateDefaultItems() }
}
-
-bool LoadDS(DISPLAYSUBST *ds, int index)
+bool LoadDS(DISPLAYSUBST *ds, int index)
{
char setting[512];
DBVARIANT dbv;
mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
ds->swzName[0] = 0;
- if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
@@ -116,10 +115,10 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
ds->type = (DisplaySubstType)db_get_b(0, MODULE_ITEMS, setting, DVT_PROTODB);
-
+
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
- if (!db_get(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv))
{
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
@@ -139,7 +138,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
// a little backward compatibility
- if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
+ if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
{
mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
@@ -148,9 +147,8 @@ bool LoadDS(DISPLAYSUBST *ds, int index) return true;
}
-
-void SaveDS(DISPLAYSUBST *ds, int index)
-{
+void SaveDS(DISPLAYSUBST *ds, int index)
+{
char setting[512];
mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
@@ -165,25 +163,24 @@ void SaveDS(DISPLAYSUBST *ds, int index) db_set_dw(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
}
-
-bool LoadDI(DISPLAYITEM *di, int index)
+bool LoadDI(DISPLAYITEM *di, int index)
{
char setting[512];
DBVARIANT dbv;
mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
di->swzLabel[0] = 0;
- if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy( di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
db_free(&dbv);
- } else
+ } else
return false;
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
- if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
@@ -202,13 +199,12 @@ bool LoadDI(DISPLAYITEM *di, int index) return true;
}
-
-void SaveDI(DISPLAYITEM *di, int index)
+void SaveDI(DISPLAYITEM *di, int index)
{
char setting[512];
mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
- if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel))
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel))
{
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
@@ -233,8 +229,7 @@ void SaveDI(DISPLAYITEM *di, int index) db_set_b(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
}
-
-void SaveOptions()
+void SaveOptions()
{
db_set_dw(0, MODULE, "MaxWidth", opt.iWinWidth);
db_set_dw(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
@@ -250,7 +245,7 @@ void SaveOptions() db_set_dw(0, MODULE, "TitleIndent", opt.iTitleIndent);
db_set_dw(0, MODULE, "ValueIndent", opt.iValueIndent);
db_set_b(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
-
+
db_set_w(0, MODULE, "TimeIn", opt.iTimeIn);
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
@@ -278,7 +273,7 @@ void SaveItems() {
int index = 0;
DSListNode *ds_node = opt.dsList;
- while (ds_node)
+ while (ds_node)
{
SaveDS(&ds_node->ds, index);
ds_node = ds_node->next;
@@ -321,7 +316,7 @@ void LoadObsoleteSkinSetting() char setting[128];
DBVARIANT dbv;
- for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
{
mir_snprintf(setting, 128, "SPaintMode%d", i);
opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
@@ -341,7 +336,7 @@ void LoadObsoleteSkinSetting() }
}
-void LoadOptions()
+void LoadOptions()
{
opt.iWinWidth = db_get_dw(0, MODULE, "MaxWidth", 420);
opt.iWinMaxHeight = db_get_dw(0, MODULE, "MaxHeight", 400);
@@ -356,9 +351,9 @@ void LoadOptions() opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
opt.iAvatarSize = db_get_dw(0, MODULE, "AVSize", 60); //tweety
- opt.iTextIndent = db_get_dw(0, MODULE, "TextIndent", 22);
- opt.iTitleIndent = db_get_dw(0, MODULE, "TitleIndent", 22);
- opt.iValueIndent = db_get_dw(0, MODULE, "ValueIndent", 10);
+ opt.iTextIndent = db_get_dw(0, MODULE, "TextIndent", 22);
+ opt.iTitleIndent = db_get_dw(0, MODULE, "TitleIndent", 22);
+ opt.iValueIndent = db_get_dw(0, MODULE, "ValueIndent", 10);
opt.iSidebarWidth = db_get_dw(0, MODULE, "SidebarWidth", 22);
opt.bShowNoFocus = (db_get_b(0, MODULE, "ShowNoFocus", 1) == 1);
@@ -367,7 +362,7 @@ void LoadOptions() DSListNode *ds_node;
opt.iDsCount = db_get_w(0, MODULE_ITEMS, "DSNumValues", 0);
- for (i = opt.iDsCount - 1; i >= 0; i--)
+ for (i = opt.iDsCount - 1; i >= 0; i--)
{
ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
if (LoadDS(&ds_node->ds, i))
@@ -375,8 +370,8 @@ void LoadOptions() ds_node->next = opt.dsList;
opt.dsList = ds_node;
real_count++;
- }
- else
+ }
+ else
{
mir_free(ds_node);
}
@@ -399,7 +394,7 @@ void LoadOptions() real_count++;
if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, _T("sys:status_msg")))
opt.bWaitForStatusMsg = true;
- }
+ }
else
{
mir_free(di_node);
@@ -426,15 +421,15 @@ void LoadOptions() // find end of list
di_node = opt.diList;
- while(di_node && di_node->next)
+ while(di_node && di_node->next)
di_node = di_node->next;
-
+
// last message item
- if (di_node)
+ if (di_node)
{
di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = di_node->next;
- }
+ }
else
{
opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -448,27 +443,27 @@ void LoadOptions() opt.iDiCount++;
}
- if (db_get_b(0, MODULE, "ShowStatusMessage", 0))
+ if (db_get_b(0, MODULE, "ShowStatusMessage", 0))
{
db_unset(0, MODULE, "ShowStatusMessage");
// find end of list
di_node = opt.diList;
- while(di_node && di_node->next)
+ while(di_node && di_node->next)
di_node = di_node->next;
-
+
// status message item
if (di_node)
{
di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = di_node->next;
- }
- else
+ }
+ else
{
opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = opt.diList;
}
-
+
_tcsncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
_tcsncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
@@ -548,10 +543,10 @@ void LoadOptions() opt.iEnableColoring = db_get_dw(0, MODULE, "EnableColoring", 0);
opt.szSkinName[0] = 0;
- if (opt.skinMode == SM_OBSOLOTE)
+ if (opt.skinMode == SM_OBSOLOTE)
{
LoadObsoleteSkinSetting();
- }
+ }
else if (opt.skinMode == SM_IMAGE)
{
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv))
@@ -570,11 +565,11 @@ void LoadOptions() }
}
-INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DISPLAYITEM *di = (DISPLAYITEM *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
@@ -591,7 +586,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int i;
for (i = 0; presetItems[i].szID; i++)
- SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateTS(presetItems[i].swzName));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateTS(presetItems[i].swzName));
variables_skin_helpbutton(hwndDlg, IDC_BTN_VARIABLE);
@@ -600,9 +595,9 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
case WM_COMMAND:
{
- if (HIWORD(wParam) == BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDOK:
{
@@ -619,7 +614,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
TCHAR buff[256]; int i;
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
- for (i = 0; presetItems[i].szID; i++)
+ for (i = 0; presetItems[i].szID; i++)
{
if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
break;
@@ -629,7 +624,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP EndDialog(hwndDlg, IDPRESETITEM + i);
else
EndDialog(hwndDlg, IDOK);
- }
+ }
else
{
EndDialog(hwndDlg, IDOK);
@@ -651,17 +646,17 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
}
}
- }
- else if (HIWORD(wParam) == CBN_SELCHANGE)
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
{
- if (LOWORD(wParam) == IDC_CMB_PRESETITEMS)
+ if (LOWORD(wParam) == IDC_CMB_PRESETITEMS)
{
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR)
{
TCHAR buff[256]; int i;
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
- for (i = 0; presetItems[i].szID; i++)
+ for (i = 0; presetItems[i].szID; i++)
{
if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
break;
@@ -679,11 +674,11 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return 0;
}
-INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DISPLAYSUBST *ds = (DISPLAYSUBST *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
@@ -693,7 +688,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName);
- switch(ds->type)
+ switch(ds->type)
{
case DVT_PROTODB:
CheckDlgButton(hwndDlg, IDC_CHK_PROTOMOD, TRUE);
@@ -712,7 +707,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETITEMDATA, index, (LPARAM)translations[i].id);
}
- for (i = 0; i < iTransFuncsCount; i++)
+ for (i = 0; i < iTransFuncsCount; i++)
{
id = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, i, 0);
if (id == ds->iTranslateFuncId)
@@ -735,9 +730,9 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
case WM_COMMAND:
{
- if (HIWORD(wParam) == BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_CHK_PROTOMOD:
{
@@ -747,7 +742,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDOK:
{
GetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName, LABEL_LEN);
- if (ds->swzName[0] == 0)
+ if (ds->swzName[0] == 0)
{
MessageBox(hwndDlg, TranslateT("You must enter a label"), TranslateT("Invalid Substitution"), MB_OK | MB_ICONWARNING);
return TRUE;
@@ -757,7 +752,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
ds->type = DVT_PROTODB;
}
- else
+ else
{
ds->type = DVT_DB;
GetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName, MODULE_NAME_LEN);
@@ -777,11 +772,11 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return TRUE;
}
}
- }
- else if (HIWORD(wParam) == CBN_SELCHANGE)
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
{
return TRUE;
- }
+ }
break;
}
@@ -798,14 +793,13 @@ static void SetTreeItemText(DIListNode *node, TCHAR **pszText) *pszText = _T("--------------------------------------");
else
*pszText = TranslateT("<No Label>");
- }
+ }
else
{
*pszText = node->di.swzLabel;
}
}
-
static OPTBUTTON btns[9] =
{
IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
@@ -819,15 +813,15 @@ static OPTBUTTON btns[9] = IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
};
-INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- for (int i = 0; i < SIZEOF(btns); i++)
+ for (int i = 0; i < SIZEOF(btns); i++)
{
SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(btns[i].swzTooltip), BATF_TCHAR);
@@ -835,7 +829,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(btns[i].uintCoreIconId));
}
- else
+ else
{
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(btns[i].uintResIconId));
SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
@@ -855,7 +849,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.item.stateMask = TVIS_STATEIMAGEMASK;
DIListNode *di_node = opt.diList, *di_value;
- while (di_node)
+ while (di_node)
{
di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
*di_value = *di_node;
@@ -867,7 +861,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
DSListNode *ds_node = opt.dsList, *ds_value;
- while (ds_node)
+ while (ds_node)
{
ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
*ds_value = *ds_node;
@@ -882,14 +876,14 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WMU_ENABLE_LIST_BUTTONS:
{
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (hItem)
+ if (hItem)
{
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_EDIT), TRUE);
- }
- else
+ }
+ else
{
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), FALSE);
@@ -904,37 +898,37 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
EnableWindow(hw, FALSE);
- }
- else
+ }
+ else
{
HWND hw = GetDlgItem(hwndDlg, IDC_BTN_REMOVE2);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
EnableWindow(hw, TRUE);
}
- return TRUE;
+ return TRUE;
}
case WM_COMMAND:
{
- if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_SUBST)
+ if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_SUBST)
{
SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- }
- else if (HIWORD(wParam) == CBN_SELCHANGE)
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ }
+ else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ }
else if (HIWORD(wParam) == LBN_DBLCLK && LOWORD(wParam) == IDC_LST_SUBST)
{
int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != CB_ERR)
+ if (sel != CB_ERR)
{
DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
{
SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
@@ -946,7 +940,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
- }
+ }
else if (HIWORD(wParam) == BN_CLICKED)
{
switch(LOWORD(wParam))
@@ -958,7 +952,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA di_value->di.bIsVisible = true;
int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di);
- if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100)))
+ if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100)))
{
TVINSERTSTRUCT tvi = {0};
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
@@ -966,26 +960,26 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.item.lParam = (LPARAM)di_value;
tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
SetTreeItemText(di_value, &tvi.item.pszText);
-
+
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
if (hItem) tvi.hInsertAfter = hItem;
else tvi.hInsertAfter = TVI_LAST;
- TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
- if (hItem)
+ if (hItem)
{
HTREEITEM hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
if (hNewItem) TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
}
- if (result >= IDPRESETITEM)
+ if (result >= IDPRESETITEM)
{
- for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++)
+ for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++)
{
-
+
PRESETSUBST *subst = GetPresetSubstByName(presetItems[result - IDPRESETITEM].szNeededSubst[i]);
if (subst == NULL) break;
- if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR)
+ if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR)
{
DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
memset(ds_value, 0, sizeof(DSListNode));
@@ -993,12 +987,12 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ds_value->ds.type = subst->type;
_tcscpy(ds_value->ds.swzName, subst->swzName);
- if (ds_value->ds.type == DVT_DB && subst->szModuleName)
+ if (ds_value->ds.type == DVT_DB && subst->szModuleName)
strcpy(ds_value->ds.szModuleName, subst->szModuleName);
if (subst->szSettingName)
strcpy(ds_value->ds.szSettingName, subst->szSettingName);
-
+
ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
@@ -1011,9 +1005,9 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
-
+
return TRUE;
- }
+ }
case IDC_BTN_SEPARATOR:
{
DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -1027,11 +1021,11 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.item.lParam = (LPARAM)di_value;
tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
tvi.item.pszText = _T("---------------------------------");
-
+
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
if (hItem) tvi.hInsertAfter = hItem;
else tvi.hInsertAfter = TVI_LAST;
- TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1042,9 +1036,9 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM item = {0};
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (item.hItem)
+ if (item.hItem)
{
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
{
DIListNode *di_value = (DIListNode *)item.lParam;
mir_free(di_value);
@@ -1059,7 +1053,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_DOWN:
{
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (hItem)
+ if (hItem)
{
HTREEITEM hNewItem;
if (LOWORD(wParam) == IDC_BTN_UP)
@@ -1067,10 +1061,10 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else
hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
- if (hNewItem)
+ if (hNewItem)
{
TCHAR buff[512], buff2[512];
- LPARAM tmpParam;
+ LPARAM tmpParam;
UINT tmpState;
TVITEM item = {0};
@@ -1085,7 +1079,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tmpState = item.state;
item.hItem = hNewItem;
item.pszText = buff2;
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
{
item.hItem = hItem;
TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
@@ -1110,12 +1104,12 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM item = {0};
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (item.hItem )
+ if (item.hItem )
{
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
{
DIListNode *di_value = (DIListNode *)item.lParam;
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
{
item.mask = TVIF_TEXT;
SetTreeItemText(di_value, &item.pszText);
@@ -1146,7 +1140,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_REMOVE2:
{
int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != LB_ERR)
+ if (sel != LB_ERR)
{
DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
mir_free(ds_value);
@@ -1157,14 +1151,14 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
return TRUE;
- }
+ }
case IDC_BTN_EDIT2:
{
int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != LB_ERR)
+ if (sel != LB_ERR)
{
DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
{
SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
@@ -1190,12 +1184,12 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->code)
+ switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
{
DIListNode *di_node;
- while (opt.diList)
+ while (opt.diList)
{
di_node = opt.diList;
opt.diList = opt.diList->next;
@@ -1208,9 +1202,9 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM item = {0};
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetLastVisible(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
{
di_node = (DIListNode *)item.lParam;
di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -1222,7 +1216,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
DSListNode *ds_node;
- while (opt.dsList)
+ while (opt.dsList)
{
ds_node = opt.dsList;
opt.dsList = opt.dsList->next;
@@ -1231,7 +1225,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DSListNode *ds_value;
opt.iDsCount = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
- for (int i = opt.iDsCount - 1; i >= 0; i--)
+ for (int i = opt.iDsCount - 1; i >= 0; i--)
{
ds_node = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
@@ -1243,7 +1237,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SaveItems();
return TRUE;
}
- case NM_DBLCLK:
+ case NM_DBLCLK:
{
TVITEM item = {0};
item.mask = TVIF_PARAM;
@@ -1253,7 +1247,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
{
DIListNode *di_value = (DIListNode *)item.lParam;
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
{
item.mask = TVIF_TEXT;
SetTreeItemText(di_value, &item.pszText);
@@ -1273,7 +1267,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
{
- if (hti.flags & TVHT_ONITEMSTATEICON)
+ if (hti.flags & TVHT_ONITEMSTATEICON)
{
TVITEMA item = {0};
item.hItem = hti.hItem;
@@ -1281,11 +1275,11 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.stateMask = TVIS_STATEIMAGEMASK;
TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
{
item.state = INDEXTOSTATEIMAGEMASK(2);
((DIListNode *)item.lParam)->di.bIsVisible = true;
- }
+ }
else
{
item.state = INDEXTOSTATEIMAGEMASK(1);
@@ -1314,10 +1308,10 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.mask = TVIF_PARAM;
HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- while (hItem != NULL)
+ while (hItem != NULL)
{
tvi.hItem = hItem;
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi))
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi))
{
di_value = (DIListNode *)tvi.lParam;
mir_free(di_value);
@@ -1327,7 +1321,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DSListNode *ds_value;
int count = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
mir_free(ds_value);
@@ -1335,15 +1329,15 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), TVSIL_STATE));
break;
- }
+ }
}
return 0;
}
-INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
@@ -1367,31 +1361,31 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Centre"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
- switch (opt.iLabelValign)
+ switch (opt.iLabelValign)
{
case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 0, 0); break;
case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 1, 0); break;
case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 2, 0); break;
}
-
+
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Centre"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
- switch (opt.iValueValign)
+ switch (opt.iValueValign)
{
case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 0, 0); break;
case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 1, 0); break;
case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 2, 0); break;
}
-
+
SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
- switch (opt.iLabelHalign)
+ switch (opt.iLabelHalign)
{
case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 0, 0); break;
case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 1, 0); break;
}
-
+
SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
switch (opt.iValueHalign)
@@ -1401,12 +1395,12 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("No avatar"));
- if (ServiceExists(MS_AV_DRAWAVATAR))
+ if (ServiceExists(MS_AV_DRAWAVATAR))
{
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left avatar"));
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right avatar"));
- }
- else
+ }
+ else
{
HWND hw = GetDlgItem(hwndDlg, IDC_CMB_AV);
EnableWindow(hw, FALSE);
@@ -1458,7 +1452,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case WM_COMMAND:
{
- if (LOWORD(wParam) == IDC_CHK_ORIGINALAVSIZE)
+ if (LOWORD(wParam) == IDC_CHK_ORIGINALAVSIZE)
{
if (IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE))
SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, TranslateT("Max avatar size:"));
@@ -1466,7 +1460,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, TranslateT("Avatar size:"));
}
- if (HIWORD(wParam) == CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1512,23 +1506,23 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP opt.titleLayout = (PopupTitleLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_GETCURSEL, 0, 0);
opt.avatarLayout = (PopupAvLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_GETCURSEL, 0, 0);
- opt.pos = (PopupPosition)SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_GETCURSEL, 0, 0);
-
+ opt.pos = (PopupPosition)SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_GETCURSEL, 0, 0);
+
opt.bAvatarBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_AVBORDER) ? true : false;
- opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
+ opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
opt.bOriginalAvatarSize = IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE) ? true : false;
-
+
opt.bShowNoFocus = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOFOCUS) ? true : false;
opt.bStatusBarTips = IsDlgButtonChecked(hwndDlg, IDC_CHK_SBAR) ? true : false;
- switch(SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_GETCURSEL, 0, 0))
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_GETCURSEL, 0, 0))
{
case 0: opt.iLabelValign = DT_TOP; break;
case 1: opt.iLabelValign = DT_VCENTER; break;
case 2: opt.iLabelValign = DT_BOTTOM; break;
}
- switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_GETCURSEL, 0, 0))
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_GETCURSEL, 0, 0))
{
case 0: opt.iValueValign = DT_TOP; break;
case 1: opt.iValueValign = DT_VCENTER; break;
@@ -1541,7 +1535,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP case 1: opt.iLabelHalign = DT_RIGHT; break;
}
- switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_GETCURSEL, 0, 0))
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_GETCURSEL, 0, 0))
{
case 0: opt.iValueHalign = DT_LEFT; break;
case 1: opt.iValueHalign = DT_RIGHT; break;
@@ -1557,15 +1551,15 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP return 0;
}
-INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
EXTRAICONDATA *dat;
dat = (EXTRAICONDATA *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
- {
+ {
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_CHK_WAITFORCONTENT, opt.bWaitForContent);
@@ -1612,7 +1606,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
- for (i = 0; i < SIZEOF(extraIconName); i++ )
+ for (i = 0; i < SIZEOF(extraIconName); i++ )
{
tvi.item.lParam = (LPARAM)(&exIcons[i]);
tvi.item.pszText = TranslateTS(extraIconName[exIcons[i].order]);
@@ -1624,7 +1618,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case WM_COMMAND:
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_CHK_ENABLESMILEYS:
{
@@ -1646,7 +1640,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG));
break;
}
- }
+ }
if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1655,11 +1649,11 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->idFrom)
+ switch (((LPNMHDR)lParam)->idFrom)
{
case 0:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
{
TVITEM item = {0};
int i = 0;
@@ -1671,7 +1665,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM cws.value.pbVal = opt.exIconsOrder;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS));
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
item.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
@@ -1688,7 +1682,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM cws.value.pbVal = opt.exIconsVis;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_EXTRAICONS));
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
item.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
@@ -1735,7 +1729,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
break;
}
- case NM_CLICK:
+ case NM_CLICK:
{
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
@@ -1743,7 +1737,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
{
- if (hti.flags & TVHT_ONITEMSTATEICON)
+ if (hti.flags & TVHT_ONITEMSTATEICON)
{
TVITEMA item;
item.mask = TVIF_HANDLE | TVIF_STATE;
@@ -1754,8 +1748,8 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
item.state = INDEXTOSTATEIMAGEMASK(2);
((ICONSTATE *)item.lParam)->vis = 1;
- }
- else
+ }
+ else
{
item.state = INDEXTOSTATEIMAGEMASK(1);
((ICONSTATE *)item.lParam)->vis = 0;
@@ -1775,7 +1769,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case WM_MOUSEMOVE:
{
- if (!dat->bDragging)
+ if (!dat->bDragging)
break;
TVHITTESTINFO hti;
@@ -1791,14 +1785,14 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
if (!(hti.flags & TVHT_ABOVE))
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), hti.hItem, 1);
- else
+ else
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), hItem, 0);
}
- else
+ else
{
- if (hti.flags & TVHT_ABOVE)
+ if (hti.flags & TVHT_ABOVE)
SendDlgItemMessage(hwndDlg, IDC_TREE_EXTRAICONS, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
- if (hti.flags & TVHT_BELOW)
+ if (hti.flags & TVHT_BELOW)
SendDlgItemMessage(hwndDlg, IDC_TREE_EXTRAICONS, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), 0, 0);
@@ -1807,7 +1801,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case WM_LBUTTONUP:
{
- if (!dat->bDragging)
+ if (!dat->bDragging)
break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), 0, 0);
@@ -1821,10 +1815,10 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ScreenToClient(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti.pt);
hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS)) / 2;
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
- if (dat->hDragItem == hti.hItem)
+ if (dat->hDragItem == hti.hItem)
break;
- if (hti.flags & TVHT_ABOVE)
+ if (hti.flags & TVHT_ABOVE)
hti.hItem = TVI_FIRST;
TVITEM item;
@@ -1839,9 +1833,9 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.pszText = swzName;
tvis.item.cchTextMax = 256;
- tvis.item.hItem = dat->hDragItem;
+ tvis.item.hItem = dat->hDragItem;
tvis.item.state = INDEXTOSTATEIMAGEMASK(((ICONSTATE *)item.lParam)->vis ? 2 : 1);
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis.item);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis.item);
TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
tvis.hParent = NULL;
tvis.hInsertAfter = hti.hItem;
@@ -1863,8 +1857,8 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM void EnableControls(HWND hwndDlg, BOOL bEnableSkin)
{
- ShowWindow(GetDlgItem(hwndDlg, IDC_ST_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_HIDE : SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ST_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_HIDE : SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SHADOW), !bEnableSkin);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_BORDER), !bEnableSkin);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERS), !bEnableSkin);
@@ -1874,9 +1868,9 @@ void EnableControls(HWND hwndDlg, BOOL bEnableSkin) }
int iLastSel;
-INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
case WM_INITDIALOG:
{
@@ -1906,13 +1900,13 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_CHK_BORDER, opt.bBorder);
CheckDlgButton(hwndDlg, IDC_CHK_ROUNDCORNERS, opt.bRound);
CheckDlgButton(hwndDlg, IDC_CHK_SHADOW, opt.bDropShadow);
- CheckDlgButton(hwndDlg, IDC_CHK_AEROGLASS, opt.bAeroGlass);
+ CheckDlgButton(hwndDlg, IDC_CHK_AEROGLASS, opt.bAeroGlass);
CheckDlgButton(hwndDlg, IDC_CHK_LOADFONTS, opt.bLoadFonts);
CheckDlgButton(hwndDlg, IDC_CHK_LOADPROPORTIONS, opt.bLoadProportions);
if (opt.iEnableColoring != -1)
CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, opt.iEnableColoring ? 1 : 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_AEROGLASS), MyDwmEnableBlurBehindWindow != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_AEROGLASS), MyDwmEnableBlurBehindWindow != 0);
SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("None"));
SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Animation"));
@@ -1927,17 +1921,17 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
case WM_DRAWITEM:
{
- if (wParam == IDC_PIC_PREVIEW)
+ if (wParam == IDC_PIC_PREVIEW)
{
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
HBRUSH hbr = GetSysColorBrush(COLOR_BTNFACE);
FillRect(dis->hDC, &dis->rcItem, hbr);
- if (opt.szPreviewFile[0])
+ if (opt.szPreviewFile[0])
{
HDC hdcMem = CreateCompatibleDC(dis->hDC);
HBITMAP hbmpPreview = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)opt.szPreviewFile, IMGL_TCHAR);
- if (hbmpPreview)
+ if (hbmpPreview)
{
int iWidth = dis->rcItem.right - dis->rcItem.left;
int iHeight = dis->rcItem.bottom - dis->rcItem.top;
@@ -1949,7 +1943,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l rb.max_height = iHeight;
rb.fit = RESIZEBITMAP_KEEP_PROPORTIONS;
HBITMAP hbmpRes = (HBITMAP)CallService(MS_IMG_RESIZE, (WPARAM)&rb, 0);
- if (hbmpRes)
+ if (hbmpRes)
{
BITMAP bmp;
GetObject(hbmpRes, sizeof(bmp), &bmp);
@@ -1958,33 +1952,33 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (hbmpPreview != hbmpRes)
DeleteBitmap(hbmpRes);
}
-
+
DeleteBitmap(hbmpPreview);
}
DeleteDC(hdcMem);
- }
+ }
}
break;
}
case WM_COMMAND:
{
- switch (HIWORD(wParam))
+ switch (HIWORD(wParam))
{
- case LBN_SELCHANGE:
+ case LBN_SELCHANGE:
{
- if (LOWORD(wParam) == IDC_LB_SKINS)
+ if (LOWORD(wParam) == IDC_LB_SKINS)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LB_SKINS);
int iSel = ListBox_GetCurSel(hwndList);
- if (iSel != iLastSel)
+ if (iSel != iLastSel)
{
if (iSel == 0)
{
opt.szPreviewFile[0] = 0;
EnableControls(hwndDlg, FALSE);
- }
- else if (iSel != LB_ERR)
+ }
+ else if (iSel != LB_ERR)
{
TCHAR swzSkinName[256];
if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
@@ -1997,27 +1991,27 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l InvalidateRect(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), 0, FALSE);
iLastSel = iSel;
}
- }
+ }
else if (LOWORD(wParam) == IDC_CMB_EFFECT)
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
- }
- case BN_CLICKED:
+ }
+ case BN_CLICKED:
{
- if (LOWORD(wParam) == IDC_BTN_APPLYSKIN)
+ if (LOWORD(wParam) == IDC_BTN_APPLYSKIN)
{
int iSel = ListBox_GetCurSel(GetDlgItem(hwndDlg, IDC_LB_SKINS));
- if (iSel == 0)
+ if (iSel == 0)
{
opt.skinMode = SM_COLORFILL;
opt.szSkinName[0] = 0;
- }
- else if (iSel != LB_ERR)
+ }
+ else if (iSel != LB_ERR)
{
- if (ListBox_GetText(GetDlgItem(hwndDlg, IDC_LB_SKINS), iSel, opt.szSkinName) > 0)
+ if (ListBox_GetText(GetDlgItem(hwndDlg, IDC_LB_SKINS), iSel, opt.szSkinName) > 0)
{
opt.skinMode = SM_IMAGE;
ParseSkinFile(opt.szSkinName, false, false);
@@ -2031,12 +2025,12 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
- }
+ }
else if (LOWORD(wParam) == IDC_BTN_RELOADLIST)
iLastSel = RefreshSkinList(hwndDlg);
else if (LOWORD(wParam) == IDC_CHK_LOADFONTS)
opt.bLoadFonts = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADFONTS) ? true : false;
- else if (LOWORD(wParam) == IDC_CHK_LOADPROPORTIONS)
+ else if (LOWORD(wParam) == IDC_CHK_LOADPROPORTIONS)
opt.bLoadProportions = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADPROPORTIONS) ? true : false;
else if (LOWORD(wParam) == IDC_BTN_GETSKINS)
CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://www.miranda-easy.net/tipper");
@@ -2052,7 +2046,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
case WM_NOTIFY:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY )
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY )
{
opt.iOpacity = GetDlgItemInt(hwndDlg, IDC_ED_TRANS, 0, 0);
opt.bDropShadow = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHADOW) ? true : false;
@@ -2072,15 +2066,15 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
}
-
+
return FALSE;
}
-INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -2095,7 +2089,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, HANDLE hContact, hItem;
hContact = db_find_first();
- while (hContact)
+ while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && db_get_b(hContact, MODULE, "FavouriteContact", 0))
@@ -2120,7 +2114,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, int count = 0;
hContact = db_find_first();
- while (hContact)
+ while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
@@ -2158,11 +2152,11 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, return FALSE;
}
-INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -2172,13 +2166,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CheckDlgButton(hwndDlg, IDC_CHK_HIDEOFFLINE, opt.bHideOffline);
SendDlgItemMessage(hwndDlg, IDC_SPIN_EXPANDTIME, UDM_SETRANGE, 0, (LPARAM)MAKELONG(5000, 10));
SetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, opt.iExpandTime, FALSE);
- SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_CHK_ENABLETRAYTIP, 0), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_CHK_ENABLETRAYTIP, 0), 0);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), GWL_STYLE) | TVS_NOHSCROLL);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), GWL_STYLE) | TVS_NOHSCROLL);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_NOHSCROLL);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE) | TVS_NOHSCROLL);
-
+
HIMAGELIST himlCheckBoxes;
himlCheckBoxes = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, 3, 0);
ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
@@ -2199,9 +2193,9 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA PROTOACCOUNT **accs;
ProtoEnumAccounts(&count, &accs);
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
- if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0)
+ if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0)
{
tvi.item.pszText = accs[i]->tszAccountName;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
@@ -2212,7 +2206,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
- for (i = 0; i < SIZEOF(trayTipItems); i++)
+ for (i = 0; i < SIZEOF(trayTipItems); i++)
{
tvi.item.pszText = TranslateTS(trayTipItems[i]);
tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iFirstItems & (1 << i) ? 2 : 1);
@@ -2225,15 +2219,15 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
case WM_COMMAND:
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
UINT state;
- case IDC_CHK_ENABLETRAYTIP:
+ case IDC_CHK_ENABLETRAYTIP:
{
state = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HANDLEBYTIPPER), state);
} // fall through
- case IDC_CHK_HANDLEBYTIPPER:
+ case IDC_CHK_HANDLEBYTIPPER:
{
state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) &
IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
@@ -2244,7 +2238,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_FAVCONTACTS), state);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_EXPAND), state);
} // fall through
- case IDC_CHK_EXPAND:
+ case IDC_CHK_EXPAND:
{
state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) &
IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) &
@@ -2254,12 +2248,12 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_ED_EXPANDTIME), state);
break;
}
- case IDC_BTN_FAVCONTACTS:
+ case IDC_BTN_FAVCONTACTS:
{
CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), 0, DlgProcFavouriteContacts);
break;
}
- }
+ }
if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -2268,11 +2262,11 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->idFrom)
+ switch (((LPNMHDR)lParam)->idFrom)
{
case 0:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
{
TCHAR buff[256];
TCHAR swzProtos[1024] = {0};
@@ -2283,13 +2277,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.cchTextMax = 256;
item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_FIRST_PROTOS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
{
- _tcscat(swzProtos, buff);
- _tcscat(swzProtos, _T(" "));
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
}
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
@@ -2300,13 +2294,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS));
item.pszText = buff;
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS), &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
{
- _tcscat(swzProtos, buff);
- _tcscat(swzProtos, _T(" "));
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
}
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
@@ -2319,12 +2313,12 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_FIRST_ITEMS));
item.mask = TVIF_HANDLE | TVIF_STATE;
item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL)
+ while (item.hItem != NULL)
{
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_FIRST_ITEMS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
opt.iFirstItems |= (1 << count);
-
+
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
count++;
}
@@ -2337,7 +2331,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_SECOND_ITEMS), &item);
if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
opt.iSecondItems |= (1 << count);
-
+
item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), item.hItem);
count++;
}
@@ -2365,7 +2359,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TREE_SECOND_ITEMS:
{
if (((LPNMHDR)lParam)->code == NM_CLICK)
- {
+ {
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
@@ -2405,7 +2399,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
}
-int OptInit(WPARAM wParam, LPARAM lParam)
+int OptInit(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp = {0};
odp.cbSize = sizeof(odp);
@@ -2452,17 +2446,17 @@ int OptInit(WPARAM wParam, LPARAM lParam) HANDLE hEventOptInit;
-void InitOptions()
+void InitOptions()
{
hEventOptInit = HookEvent(ME_OPT_INITIALISE, OptInit);
}
-void DeinitOptions()
+void DeinitOptions()
{
UnhookEvent(hEventOptInit);
DIListNode *di_node = opt.diList;
- while(opt.diList)
+ while(opt.diList)
{
di_node = opt.diList;
opt.diList = opt.diList->next;
@@ -2470,16 +2464,16 @@ void DeinitOptions() }
DSListNode *ds_node = opt.dsList;
- while(opt.dsList)
+ while(opt.dsList)
{
ds_node = opt.dsList;
opt.dsList = opt.dsList->next;
mir_free(ds_node);
}
- for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
{
- if (opt.szImgFile[i])
+ if (opt.szImgFile[i])
mir_free(opt.szImgFile[i]);
}
}
|