summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/opt_gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src/opt_gen.cpp')
-rw-r--r--plugins/Popup/src/opt_gen.cpp201
1 files changed, 98 insertions, 103 deletions
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 90103fb7b8..b5e471b5bf 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -42,12 +42,12 @@ static int CountStatusModes(DWORD flags)
return res;
}
-int AddStatusMode (OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
+int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
{
if (!flag) return pos;
options[pos].dwFlag = flag;
options[pos].groupId = OPTTREE_CHECK;
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*lstrlen(prefix)+32);
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * lstrlen(prefix) + 32);
options[pos].pszSettingName = mir_tstrdup(prefix);
options[pos].iconIndex = 0;
@@ -55,32 +55,32 @@ int AddStatusMode (OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
lstrcat(options[pos].pszOptionName, _T("/"));
switch (flag)
{
- case PF2_IDLE: lstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
- case PF2_ONLINE: lstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
- case PF2_INVISIBLE: lstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
- case PF2_SHORTAWAY: lstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
- case PF2_LONGAWAY: lstrcat(options[pos].pszOptionName, LPGENT("NA")); break;
- case PF2_LIGHTDND: lstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
- case PF2_HEAVYDND: lstrcat(options[pos].pszOptionName, LPGENT("DND")); break;
- case PF2_FREECHAT: lstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
- case PF2_OUTTOLUNCH:lstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
- case PF2_ONTHEPHONE:lstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
+ case PF2_IDLE: lstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
+ case PF2_ONLINE: lstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
+ case PF2_INVISIBLE: lstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
+ case PF2_SHORTAWAY: lstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
+ case PF2_LONGAWAY: lstrcat(options[pos].pszOptionName, LPGENT("NA")); break;
+ case PF2_LIGHTDND: lstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
+ case PF2_HEAVYDND: lstrcat(options[pos].pszOptionName, LPGENT("DND")); break;
+ case PF2_FREECHAT: lstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
+ case PF2_OUTTOLUNCH: lstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
+ case PF2_ONTHEPHONE: lstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
}
- return pos+1;
+ return pos + 1;
}
int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flags)
{
pos = AddStatusMode(options, pos, prefix, PF2_IDLE);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_ONLINE);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_INVISIBLE);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_SHORTAWAY);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_LONGAWAY);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_LIGHTDND);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_HEAVYDND);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_FREECHAT);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_OUTTOLUNCH);
- pos = AddStatusMode(options, pos, prefix, flags&PF2_ONTHEPHONE);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_ONLINE);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_INVISIBLE);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_SHORTAWAY);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_LONGAWAY);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_LIGHTDND);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_HEAVYDND);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_FREECHAT);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_OUTTOLUNCH);
+ pos = AddStatusMode(options, pos, prefix, flags & PF2_ONTHEPHONE);
return pos;
}
@@ -102,8 +102,8 @@ void LoadOption_General()
PopupOptions.MaximumWidth = db_get_w(NULL, MODULNAME, "MaximumWidth", 300);
//Position
- PopupOptions.Position
- = DBGetContactSettingRangedByte(NULL, MODULNAME, "Position", POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
+ PopupOptions.Position =
+ DBGetContactSettingRangedByte(NULL, MODULNAME, "Position", POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
//Configure popup area
PopupOptions.gapTop = db_get_w(NULL, MODULNAME, "gapTop", 5);
@@ -113,8 +113,8 @@ void LoadOption_General()
PopupOptions.spacing = db_get_w(NULL, MODULNAME, "spacing", 5);
//Spreading
- PopupOptions.Spreading
- = DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
+ PopupOptions.Spreading =
+ DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
//miscellaneous
PopupOptions.ReorderPopups = db_get_b(NULL, MODULNAME, "ReorderPopups", TRUE);
@@ -151,58 +151,54 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
//Dynamic Resize
CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize);
- SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width"): LPGENT("Width"));
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width") : LPGENT("Width"));
//Minimum Width
CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth);
- SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(
- SETTING_MAXIMUMWIDTH_MAX,
- SETTING_MINIMUMWIDTH_MIN));
+ SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopupOptions.MinimumWidth, FALSE);
//Maximum Width
PopupOptions.UseMaximumWidth = PopupOptions.DynamicResize ? PopupOptions.UseMaximumWidth : TRUE;
CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.UseMaximumWidth);
- SendDlgItemMessage(hwnd, IDC_MAXIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(
- SETTING_MAXIMUMWIDTH_MAX,
- SETTING_MINIMUMWIDTH_MIN));
+ SendDlgItemMessage(hwnd, IDC_MAXIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopupOptions.MaximumWidth, FALSE);
//And finally let's enable/disable them.
- EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize);
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth);
//Position combobox.
{
HWND hCtrl = GetDlgItem(hwnd, IDC_WHERE);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("upper left corner")) ,POS_UPPERLEFT);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("lower left corner")) ,POS_LOWERLEFT);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("lower right corner")) ,POS_LOWERRIGHT);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("upper right corner")) ,POS_UPPERRIGHT);
- SendDlgItemMessage(hwnd, IDC_WHERE, CB_SETCURSEL, (PopupOptions.Position) , 0);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Upper left corner")), POS_UPPERLEFT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Lower left corner")), POS_LOWERLEFT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Lower right corner")), POS_LOWERRIGHT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Upper right corner")), POS_UPPERRIGHT);
+ SendDlgItemMessage(hwnd, IDC_WHERE, CB_SETCURSEL, PopupOptions.Position, 0);
}
//Configure popup area
{
HWND hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
- SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)_T("Popup Area"), BATF_TCHAR);
- SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RESIZE,0));
+ SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)_T("Popup area"), BATF_TCHAR);
+ SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RESIZE, 0));
}
//Spreading combobox
{
HWND hCtrl = GetDlgItem(hwnd, IDC_LAYOUT);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("horizontal")) ,SPREADING_HORIZONTAL);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("vertical")) ,SPREADING_VERTICAL);
- SendDlgItemMessage(hwnd, IDC_LAYOUT, CB_SETCURSEL, (PopupOptions.Spreading), 0);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Horizontal")), SPREADING_HORIZONTAL);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Vertical")), SPREADING_VERTICAL);
+ SendDlgItemMessage(hwnd, IDC_LAYOUT, CB_SETCURSEL, PopupOptions.Spreading, 0);
}
//miscellaneous
CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups);
//Popup enabled
- CheckDlgButton(hwnd, IDC_POPUPENABLED, PopupOptions.ModuleIsEnabled?BST_UNCHECKED:BST_CHECKED);
- CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen);
- EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
- EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
+ CheckDlgButton(hwnd, IDC_POPUPENABLED, PopupOptions.ModuleIsEnabled ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
//new status options
{
@@ -226,7 +222,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
continue;
TCHAR prefix[128];
- mir_sntprintf(prefix,SIZEOF(prefix), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(prefix, SIZEOF(prefix), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
@@ -254,14 +250,14 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_COMMAND:
switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
- switch( LOWORD(wParam)) {
+ case BN_CLICKED: //Button controls
+ switch (LOWORD(wParam)) {
case IDC_INFINITEDELAY:
PopupOptions.InfiniteDelay = !PopupOptions.InfiniteDelay;
- EnableWindow(GetDlgItem(hwnd, IDC_SECONDS),!PopupOptions.InfiniteDelay);
- EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.InfiniteDelay);
- EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.InfiniteDelay);
- EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.InfiniteDelay);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -271,36 +267,36 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_DYNAMICRESIZE:
- PopupOptions.DynamicResize=!PopupOptions.DynamicResize;
- EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize);
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
- SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? TranslateT("Maximum width"): TranslateT("Width"));
+ PopupOptions.DynamicResize = !PopupOptions.DynamicResize;
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? TranslateT("Maximum width") : TranslateT("Width"));
if (!PopupOptions.DynamicResize) {
PopupOptions.UseMaximumWidth = TRUE;
CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, BST_CHECKED);
- EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), TRUE);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), TRUE);
}
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_USEMINIMUMWIDTH:
- PopupOptions.UseMinimumWidth= !PopupOptions.UseMinimumWidth;
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.UseMinimumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.UseMinimumWidth);
+ PopupOptions.UseMinimumWidth = !PopupOptions.UseMinimumWidth;
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.UseMinimumWidth);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_USEMAXIMUMWIDTH:
- PopupOptions.UseMaximumWidth= Button_GetCheck((HWND)lParam);
+ PopupOptions.UseMaximumWidth = Button_GetCheck((HWND)lParam);
if (!PopupOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
CheckDlgButton(hwnd, LOWORD(wParam), BST_CHECKED);
PopupOptions.UseMaximumWidth = TRUE;
}
EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -311,21 +307,21 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
GetWindowRect((HWND)lParam, &rcButton);
GetWindowRect(hwndBox, &rcBox);
MoveWindow(hwndBox,
- rcButton.right-(rcBox.right-rcBox.left) + 15,
+ rcButton.right - (rcBox.right - rcBox.left) + 15,
rcButton.bottom + 3,
- rcBox.right-rcBox.left,
- rcBox.bottom-rcBox.top,
+ rcBox.right - rcBox.left,
+ rcBox.bottom - rcBox.top,
FALSE);
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)|WS_EX_LAYERED);
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(hwndBox, NULL, 0, LWA_ALPHA);
ShowWindow(hwndBox, SW_SHOW);
- for (int i=0; i <= 255; i += 15) {
+ for (int i = 0; i <= 255; i += 15) {
SetLayeredWindowAttributes(hwndBox, NULL, i, LWA_ALPHA);
UpdateWindow(hwndBox);
Sleep(1);
}
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)&~WS_EX_LAYERED);
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
ShowWindow(hwndBox, SW_SHOW);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -335,8 +331,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_REORDERPOPUPS:
{
PopupOptions.ReorderPopups = !PopupOptions.ReorderPopups;
- PopupOptions.ReorderPopupsWarning = PopupOptions.ReorderPopups ?
- db_get_b(NULL, MODULNAME, "ReorderPopupsWarning", TRUE) : TRUE;
+ PopupOptions.ReorderPopupsWarning = PopupOptions.ReorderPopups ? db_get_b(NULL, MODULNAME, "ReorderPopupsWarning", TRUE) : TRUE;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
break;
@@ -344,10 +339,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_POPUPENABLED:
{
int chk = IsDlgButtonChecked(hwnd, IDC_POPUPENABLED);
- if (PopupOptions.ModuleIsEnabled&&chk || !PopupOptions.ModuleIsEnabled&&!chk)
- svcEnableDisableMenuCommand(0,0);
- EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
- EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
+ if (PopupOptions.ModuleIsEnabled&&chk || !PopupOptions.ModuleIsEnabled && !chk)
+ svcEnableDisableMenuCommand(0, 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
}
break;
@@ -363,7 +358,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case CBN_SELCHANGE: //ComboBox controls
- switch( LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
//lParam = Handle to the control
case IDC_WHERE:
PopupOptions.Position = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
@@ -378,12 +373,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case EN_CHANGE: //Edit controls change
if (!bDlgInit) break;
- switch( LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
//lParam = Handle to the control
case IDC_SECONDS:
{
int seconds = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
- if ( seconds >= SETTING_LIFETIME_MIN &&
+ if (seconds >= SETTING_LIFETIME_MIN &&
seconds <= SETTING_LIFETIME_MAX &&
seconds != PopupOptions.Seconds) {
PopupOptions.Seconds = seconds;
@@ -394,7 +389,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_MINIMUMWIDTH:
{
int temp = GetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, NULL, FALSE);
- if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ if (temp >= SETTING_MINIMUMWIDTH_MIN &&
temp <= SETTING_MAXIMUMWIDTH_MAX &&
temp != PopupOptions.MinimumWidth) {
PopupOptions.MinimumWidth = temp;
@@ -405,7 +400,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_MAXIMUMWIDTH:
{
int temp = GetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, NULL, FALSE);
- if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ if (temp >= SETTING_MINIMUMWIDTH_MIN &&
temp <= SETTING_MAXIMUMWIDTH_MAX &&
temp != PopupOptions.MaximumWidth) {
PopupOptions.MaximumWidth = temp;
@@ -417,7 +412,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case EN_KILLFOCUS: //Edit controls lost fokus
- switch( LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
//lParam = Handle to the control
case IDC_SECONDS:
{
@@ -477,7 +472,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_RESET:
@@ -501,11 +496,11 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
db_set_b(NULL, MODULNAME, "Position", (BYTE)PopupOptions.Position);
//Configure popup area
- db_set_w(NULL, MODULNAME, "gapTop", (WORD)PopupOptions.gapTop);
- db_set_w(NULL, MODULNAME, "gapBottom", (WORD)PopupOptions.gapBottom);
- db_set_w(NULL, MODULNAME, "gapLeft", (WORD)PopupOptions.gapLeft);
- db_set_w(NULL, MODULNAME, "gapRight", (WORD)PopupOptions.gapRight);
- db_set_w(NULL, MODULNAME, "spacing", (WORD)PopupOptions.spacing);
+ db_set_w(NULL, MODULNAME, "gapTop", (WORD)PopupOptions.gapTop);
+ db_set_w(NULL, MODULNAME, "gapBottom", (WORD)PopupOptions.gapBottom);
+ db_set_w(NULL, MODULNAME, "gapLeft", (WORD)PopupOptions.gapLeft);
+ db_set_w(NULL, MODULNAME, "gapRight", (WORD)PopupOptions.gapRight);
+ db_set_w(NULL, MODULNAME, "spacing", (WORD)PopupOptions.spacing);
//Spreading
db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopupOptions.Spreading);
@@ -522,7 +517,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
PROTOACCOUNT **protocols;
ProtoEnumAccounts(&protocolCount, &protocols);
- for (int i=0; i < protocolCount; ++i) {
+ for (int i = 0; i < protocolCount; ++i) {
char prefix[128];
mir_snprintf(prefix, SIZEOF(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
@@ -538,7 +533,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_MINIMUMWIDTH_SPIN:
{
- LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
int temp = lpnmud->iPos + lpnmud->iDelta;
if (temp > PopupOptions.MaximumWidth) {
PopupOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
@@ -549,7 +544,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_MAXIMUMWIDTH_SPIN:
{
- LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
int temp = lpnmud->iPos + lpnmud->iDelta;
if (temp < PopupOptions.MinimumWidth) {
PopupOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
@@ -561,7 +556,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_DESTROY:
if (statusOptions) {
- for (int i=0; i < statusOptionsCount; ++i) {
+ for (int i = 0; i < statusOptionsCount; ++i) {
mir_free(statusOptions[i].pszOptionName);
mir_free(statusOptions[i].pszSettingName);
}
@@ -585,7 +580,7 @@ void ErrorMSG(int minValue, int maxValue)
void Check_ReorderPopups(HWND hwnd) {
if (!PopupOptions.ReorderPopups && PopupOptions.ReorderPopupsWarning) {
int res = MessageBox(hwnd,
- TranslateT("'Reorder Popups' option is currently diabled.\r\nThis may cause misaligned popups when used with\r\navatars and text replacement (mainly NewXstatusNotify).\r\n\r\nDo you want to enable popup reordering now?\r\n"),
+ TranslateT("'Reorder popups' option is currently disabled.\r\nThis may cause misaligned popups when used with\r\navatars and text replacement (mainly NewXstatusNotify).\r\n\r\nDo you want to enable popup reordering now?\r\n"),
TranslateT("Popup Plus Warning"), MB_ICONEXCLAMATION | MB_YESNOCANCEL);
switch (res) {
@@ -624,11 +619,11 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONADDTOOLTIP, (WPARAM)_T("OK"), BATF_TCHAR);
- SendMessage(GetDlgItem(hwndDlg, IDOK), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_OK,0));
+ SendMessage(GetDlgItem(hwndDlg, IDOK), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_OK, 0));
SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONADDTOOLTIP, (WPARAM)_T("Cancel"), BATF_TCHAR);
- SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_CANCEL,0));
+ SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_CANCEL, 0));
SetDlgItemInt(hwndDlg, IDC_TXT_TOP, PopupOptions.gapTop, FALSE);
SetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, PopupOptions.gapBottom, FALSE);