summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-19 19:25:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-19 19:25:00 +0000
commit5a5ffa5cc195669c48827e4cf9d948dfb3272e47 (patch)
treecdbad9af22211a53a3f6173514cba1345768c9a7
parent5a54097bdfc5a94ea7b1f282d12c0fc1155ec7d5 (diff)
misplaced figure brackets in Popup+ options
git-svn-id: http://svn.miranda-ng.org/main/trunk@4479 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Popup/src/opt_adv.cpp722
-rw-r--r--plugins/Popup/src/opt_contacts.cpp51
-rw-r--r--plugins/Popup/src/opt_gen.cpp903
-rw-r--r--plugins/Popup/src/opt_skins.cpp125
-rw-r--r--plugins/Popup/src/opttree.cpp21
5 files changed, 861 insertions, 961 deletions
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index 5befd5ba3a..c4c5513244 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -49,25 +49,30 @@ void LoadOption_AdvOpts()
PopUpOptions.EnableHistory = db_get_b(NULL, MODULNAME, "EnableHistory", TRUE);
PopUpOptions.HistorySize = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
PopUpOptions.UseHppHistoryLog = db_get_b(NULL, MODULNAME, "UseHppHistoryLog", TRUE);
+
//Avatars
PopUpOptions.avatarBorders = db_get_b(NULL, MODULNAME, "AvatarBorders", TRUE);
PopUpOptions.avatarPNGBorders = db_get_b(NULL, MODULNAME, "AvatarPNGBorders", FALSE);
PopUpOptions.avatarRadius = db_get_b(NULL, MODULNAME, "AvatarRadius", 2);
PopUpOptions.avatarSize = db_get_w(NULL, MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
PopUpOptions.EnableAvatarUpdates = db_get_b(NULL, MODULNAME, "EnableAvatarUpdates", FALSE);
+
//Monitor
PopUpOptions.Monitor = db_get_b(NULL, MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
+
//Transparency
PopUpOptions.Enable9xTransparency = db_get_b(NULL, MODULNAME, "EnableRegionTransparency", TRUE);
PopUpOptions.UseTransparency = db_get_b(NULL, MODULNAME, "UseTransparency", TRUE);
PopUpOptions.Alpha = db_get_b(NULL, MODULNAME, "Alpha", SETTING_ALPHA_DEFAULT);
PopUpOptions.OpaqueOnHover = db_get_b(NULL, MODULNAME, "OpaqueOnHover", TRUE);
+
//Effects
PopUpOptions.UseAnimations = db_get_b(NULL, MODULNAME, "UseAnimations", TRUE);
PopUpOptions.UseEffect = db_get_b(NULL, MODULNAME, "Fade", TRUE);
PopUpOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_TCHAR);
PopUpOptions.FadeIn = db_get_dw(NULL, MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
PopUpOptions.FadeOut = db_get_dw(NULL, MODULNAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
+
//other old stuff
PopUpOptions.MaxPopups = db_get_w(NULL, MODULNAME, "MaxPopups", 20);
}
@@ -76,13 +81,12 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
{
TCHAR tstr[64];
static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ UINT idCtrl;
switch (msg) {
- case WM_INITDIALOG: {
- HWND hCtrl = NULL;
-
- //Create preview box:
- {
+ case WM_INITDIALOG:
+ //Create preview box:
+ {
hwndBox = CreateWindowEx(
WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
_T(BOXPREVIEW_WNDCLASS), // Class name
@@ -97,14 +101,14 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hInst, // Instance
(LPVOID)0);
ShowWindow(hwndBox, SW_HIDE);
- }
- //Group: History
- {
+ }
+ //Group: History
+ {
CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopUpOptions.EnableHistory);
SetDlgItemInt (hwnd, IDC_HISTORYSIZE, PopUpOptions.HistorySize, FALSE);
CheckDlgButton(hwnd, IDC_HPPLOG, PopUpOptions.UseHppHistoryLog);
- hCtrl = GetDlgItem(hwnd, IDC_SHOWHISTORY);
+ HWND hCtrl = GetDlgItem(hwnd, IDC_SHOWHISTORY);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)Translate("Popup History"), 0);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_HISTORY,0));
@@ -114,9 +118,9 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopUpOptions.EnableHistory);
EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopUpOptions.EnableHistory);
EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopUpOptions.EnableHistory && gbHppInstalled);
- }
- //Group: Avatars
- {
+ }
+ //Group: Avatars
+ {
//Borders
CheckDlgButton(hwnd, IDC_AVT_BORDER, PopUpOptions.avatarBorders);
CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopUpOptions.avatarPNGBorders);
@@ -134,9 +138,9 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetDlgItemInt(hwnd, IDC_AVT_SIZE, PopUpOptions.avatarSize, FALSE);
//Request avatars
CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopUpOptions.EnableAvatarUpdates);
- }
- //Group: Monitor
- {
+ }
+ //Group: Monitor
+ {
BOOL bMonitor = 0;
bMonitor = GetSystemMetrics(SM_CMONITORS)>1;
@@ -147,9 +151,9 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_MULTIMONITOR_DESC), bMonitor);
EnableWindow(GetDlgItem(hwnd, IDC_MIRANDAWND), bMonitor);
EnableWindow(GetDlgItem(hwnd, IDC_ACTIVEWND), bMonitor);
- }
- //Group: Transparency
- {
+ }
+ //Group: Transparency
+ {
//9x/ME
CheckDlgButton(hwnd, IDC_TRANS_9X, PopUpOptions.Enable9xTransparency);
//EnableWindow(GetDlgItem(hwnd, IDC_TRANS_9X), !IsWinVer2000Plus());
@@ -163,19 +167,18 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopUpOptions.OpaqueOnHover);
{
-
BOOL how = TRUE;
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS) ,how);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1), how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT), how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER), how && PopUpOptions.UseTransparency);
}
ShowWindow(GetDlgItem(hwnd, IDC_TRANS), IsWinVer2000Plus() ? SW_SHOW : SW_HIDE);
- }
- //Group: Effects
- {
+ }
+ //Group: Effects
+ {
//Use Animations
CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopUpOptions.UseAnimations);
//Fade
@@ -205,7 +208,7 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_EFFECT), how);
EnableWindow(GetDlgItem(hwnd, IDC_EFFECT_TXT), how);
- hCtrl = GetDlgItem(hwnd, IDC_EFFECT);
+ HWND hCtrl = GetDlgItem(hwnd, IDC_EFFECT);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("No effect")) ,-2);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Fade in/out")) ,-1);
dwActiveItem = (DWORD)PopUpOptions.UseEffect;
@@ -217,364 +220,323 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
SendDlgItemMessage(hwnd, IDC_EFFECT, CB_SETCURSEL, dwActiveItem, 0);
}
+ }
+
+ //later check stuff
+ SetDlgItemInt(hwnd, IDC_MAXPOPUPS, PopUpOptions.MaxPopups, FALSE);
+ TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ bDlgInit = true;
+ return TRUE;
+
+ case WM_HSCROLL:
+ switch (idCtrl = GetDlgCtrlID((HWND)lParam)) {
+ case IDC_AVT_SIZE_SLIDE:
+ PopUpOptions.avatarSize = SendDlgItemMessage(hwnd,IDC_AVT_SIZE_SLIDE, TBM_GETPOS,0,0);
+ SetDlgItemInt(hwnd, IDC_AVT_SIZE ,PopUpOptions.avatarSize,FALSE);
+ SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopUpOptions.avatarSize / 2),0));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_TRANS_SLIDER:
+ PopUpOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd,IDC_TRANS_SLIDER, TBM_GETPOS, 0,0);
+ wsprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopUpOptions.Alpha));
+ SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_COMMAND:
+ idCtrl = LOWORD(wParam);
+ switch (HIWORD(wParam)) {
+ case BN_CLICKED: //Button controls
+ switch(idCtrl) {
+ case IDC_ENABLE_HISTORY:
+ PopUpOptions.EnableHistory = !PopUpOptions.EnableHistory;
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopUpOptions.EnableHistory && gbHppInstalled);
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_SHOWHISTORY:
+ PopupHistoryShow();
+ break;
+
+ case IDC_HPPLOG:
+ PopUpOptions.UseHppHistoryLog = !PopUpOptions.UseHppHistoryLog;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_AVT_BORDER:
+ PopUpOptions.avatarBorders = !PopUpOptions.avatarBorders;
+ EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopUpOptions.avatarBorders);
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_AVT_PNGBORDER:
+ PopUpOptions.avatarPNGBorders = !PopUpOptions.avatarPNGBorders;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_AVT_REQUEST:
+ PopUpOptions.EnableAvatarUpdates = !PopUpOptions.EnableAvatarUpdates;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_MIRANDAWND:
+ PopUpOptions.Monitor = MN_MIRANDA;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_ACTIVEWND:
+ PopUpOptions.Monitor = MN_ACTIVE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_TRANS_9X:
+ PopUpOptions.Enable9xTransparency = !PopUpOptions.Enable9xTransparency;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+
+ case IDC_TRANS:
+ PopUpOptions.UseTransparency = !PopUpOptions.UseTransparency;
+ {
+ BOOL how = TRUE;
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER) ,how && PopUpOptions.UseTransparency);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+
+ case IDC_TRANS_OPAQUEONHOVER:
+ PopUpOptions.OpaqueOnHover = !PopUpOptions.OpaqueOnHover;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_USEANIMATIONS:
+ PopUpOptions.UseAnimations = !PopUpOptions.UseAnimations;
+ {
+ BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+
+ case IDC_PREVIEW:
+ PopUpPreview();
+ break;
}
+ break;
- //later check stuff
- {
- SetDlgItemInt(hwnd, IDC_MAXPOPUPS, PopUpOptions.MaxPopups, FALSE);
+ case CBN_SELCHANGE:
+ //lParam = Handle to the control
+ switch(idCtrl) {
+ case IDC_EFFECT:
+ {
+ int iEffect = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ PopUpOptions.UseEffect = (iEffect != -2) ? TRUE : FALSE;
+ mir_free(PopUpOptions.Effect);
+ PopUpOptions.Effect = mir_tstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : _T(""));
+
+ BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
}
+ break;
- TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
- bDlgInit = true;
- }//end WM_INITDIALOG
- return TRUE;
- case WM_HSCROLL: {
- UINT idCtrl = GetDlgCtrlID((HWND)lParam);
- switch (idCtrl) {
- case IDC_AVT_SIZE_SLIDE:
- {
- PopUpOptions.avatarSize = SendDlgItemMessage(hwnd,IDC_AVT_SIZE_SLIDE, TBM_GETPOS,0,0);
- SetDlgItemInt(hwnd, IDC_AVT_SIZE ,PopUpOptions.avatarSize,FALSE);
- SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopUpOptions.avatarSize / 2),0));
+ case EN_CHANGE: //Edit controls change
+ if (!bDlgInit) break;
+ //lParam = Handle to the control
+ switch(idCtrl) {
+ case IDC_MAXPOPUPS:
+ {
+ int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (maxPop > 0){
+ PopUpOptions.MaxPopups = maxPop;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_TRANS_SLIDER:
- {
- PopUpOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd,IDC_TRANS_SLIDER, TBM_GETPOS, 0,0);
- wsprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopUpOptions.Alpha));
- SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
+ }
+ }
+ break;
+ case IDC_HISTORYSIZE:
+ {
+ int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if ( histSize > 0 &&
+ histSize <= SETTING_HISTORYSIZE_MAX){
+ PopUpOptions.HistorySize = histSize;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_AVT_RADIUS:
+ {
+ int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if ( avtRadius <= SETTING_AVTSIZE_MAX / 2 ) {
+ PopUpOptions.avatarRadius = avtRadius;
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- default:
- break;
- }// end switch idCtrl
- }//end WM_HSCROLL
- break;
- case WM_COMMAND: {
- UINT idCtrl = LOWORD(wParam);
- switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
- switch(idCtrl) {
- case IDC_ENABLE_HISTORY:
- {
- PopUpOptions.EnableHistory = !PopUpOptions.EnableHistory;
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopUpOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopUpOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopUpOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopUpOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopUpOptions.EnableHistory && gbHppInstalled);
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_SHOWHISTORY:
- {
- PopupHistoryShow();
- }
- break;
- case IDC_HPPLOG:
- {
- PopUpOptions.UseHppHistoryLog = !PopUpOptions.UseHppHistoryLog;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_AVT_BORDER:
- {
- PopUpOptions.avatarBorders = !PopUpOptions.avatarBorders;
- EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopUpOptions.avatarBorders);
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_AVT_PNGBORDER:
- {
- PopUpOptions.avatarPNGBorders = !PopUpOptions.avatarPNGBorders;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_AVT_REQUEST:
- {
- PopUpOptions.EnableAvatarUpdates = !PopUpOptions.EnableAvatarUpdates;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_MIRANDAWND:
- {
- PopUpOptions.Monitor = MN_MIRANDA;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_ACTIVEWND:
- {
- PopUpOptions.Monitor = MN_ACTIVE;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_TRANS_9X:
- {
- PopUpOptions.Enable9xTransparency = !PopUpOptions.Enable9xTransparency;
- SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
- }
- break;
- case IDC_TRANS:
- {
- PopUpOptions.UseTransparency = !PopUpOptions.UseTransparency;
-
- BOOL how = TRUE;
-
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT) ,how && PopUpOptions.UseTransparency);
- EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER) ,how && PopUpOptions.UseTransparency);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_TRANS_OPAQUEONHOVER:
- {
- PopUpOptions.OpaqueOnHover = !PopUpOptions.OpaqueOnHover;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_USEANIMATIONS:
- {
- PopUpOptions.UseAnimations = !PopUpOptions.UseAnimations;
- BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_PREVIEW:
- {
- PopUpPreview();
- }
- break;
- default:
- break;
- }
- break;
- case CBN_SELCHANGE: //ComboBox controls
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_EFFECT:
- {
- int iEffect = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
- PopUpOptions.UseEffect = (iEffect != -2) ? TRUE : FALSE;
- mir_free(PopUpOptions.Effect);
- PopUpOptions.Effect = mir_tstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : _T(""));
-
- BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- default:
- break;
- }
- break;
- case EN_CHANGE: //Edit controls change
- if (!bDlgInit) break;
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_MAXPOPUPS:
- {
- int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (maxPop > 0){
- PopUpOptions.MaxPopups = maxPop;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_HISTORYSIZE:
- {
- int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if ( histSize > 0 &&
- histSize <= SETTING_HISTORYSIZE_MAX){
- PopUpOptions.HistorySize = histSize;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_AVT_RADIUS:
- {
- int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if ( avtRadius <= SETTING_AVTSIZE_MAX / 2 ) {
- PopUpOptions.avatarRadius = avtRadius;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_FADEIN:
- {
- int fadeIn = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if ( fadeIn >= SETTING_FADEINTIME_MIN &&
- fadeIn <= SETTING_FADEINTIME_MAX ) {
- PopUpOptions.FadeIn = fadeIn;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_FADEOUT:
- {
- int fadeOut = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if ( fadeOut >= SETTING_FADEOUTTIME_MIN &&
- fadeOut <= SETTING_FADEOUTTIME_MAX){
- PopUpOptions.FadeOut = fadeOut;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- default:
- break;
- }//end switch(idCtrl)
- break;
- case EN_KILLFOCUS: //Edit controls lost fokus
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_MAXPOPUPS:
- {
- int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (maxPop <= 0)
- PopUpOptions.MaxPopups = 20;
- if (maxPop != PopUpOptions.MaxPopups) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MaxPopups, FALSE);
- //ErrorMSG(1);
- SetFocus((HWND)lParam);
- }
- }
- break;
- case IDC_HISTORYSIZE:
- {
- int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (histSize <= 0)
- PopUpOptions.HistorySize = SETTING_HISTORYSIZE_DEFAULT;
- else if (histSize > SETTING_HISTORYSIZE_MAX)
- PopUpOptions.HistorySize = SETTING_HISTORYSIZE_MAX;
- if (histSize != PopUpOptions.HistorySize) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.HistorySize, FALSE);
- ErrorMSG(1, SETTING_HISTORYSIZE_MAX);
- SetFocus((HWND)lParam);
- }
- }
- break;
- case IDC_AVT_RADIUS:
- {
- int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (avtRadius > SETTING_AVTSIZE_MAX / 2)
- PopUpOptions.avatarRadius = SETTING_AVTSIZE_MAX / 2;
- if (avtRadius != PopUpOptions.avatarRadius) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.avatarRadius, FALSE);
- ErrorMSG(0, SETTING_AVTSIZE_MAX / 2);
- SetFocus((HWND)lParam);
- }
- }
- break;
- case IDC_FADEIN:
- {
- int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (fade < SETTING_FADEINTIME_MIN)
- PopUpOptions.FadeIn = SETTING_FADEINTIME_MIN;
- else if (fade > SETTING_FADEINTIME_MAX)
- PopUpOptions.FadeIn = SETTING_FADEINTIME_MAX;
- if (fade != PopUpOptions.FadeIn) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeIn, FALSE);
- ErrorMSG(SETTING_FADEINTIME_MIN, SETTING_FADEINTIME_MAX);
- SetFocus((HWND)lParam);
- }
- }
- break;
- case IDC_FADEOUT:
- {
- int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (fade < SETTING_FADEOUTTIME_MIN)
- PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MIN;
- else if (fade > SETTING_FADEOUTTIME_MAX)
- PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MAX;
- if (fade != PopUpOptions.FadeOut) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeOut, FALSE);
- ErrorMSG(SETTING_FADEOUTTIME_MIN, SETTING_FADEOUTTIME_MAX);
- SetFocus((HWND)lParam);
- }
- }
- break;
- default:
- break;
- }//end switch(idCtrl)
- break;
- default:
- break;
- }// end switch (HIWORD(wParam))
- }//end WM_COMMAND
- break;
- case WM_NOTIFY: {
- switch(((LPNMHDR)lParam)->idFrom) {
- case 0: {
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET:
- LoadOption_AdvOpts();
- return TRUE;
- case PSN_APPLY:
- {
- //History
- db_set_b(NULL, MODULNAME, "EnableHistory", (BYTE)PopUpOptions.EnableHistory);
- db_set_w(NULL, MODULNAME, "HistorySize", PopUpOptions.HistorySize);
- PopupHistoryResize();
- db_set_b(NULL, MODULNAME, "UseHppHistoryLog", PopUpOptions.UseHppHistoryLog);
- //Avatars
- db_set_b(NULL, MODULNAME, "AvatarBorders", PopUpOptions.avatarBorders);
- db_set_b(NULL, MODULNAME, "AvatarPNGBorders", PopUpOptions.avatarPNGBorders);
- db_set_b(NULL, MODULNAME, "AvatarRadius", PopUpOptions.avatarRadius);
- db_set_w(NULL, MODULNAME, "AvatarSize", PopUpOptions.avatarSize);
- db_set_b(NULL, MODULNAME, "EnableAvatarUpdates", PopUpOptions.EnableAvatarUpdates);
- //Monitor
- db_set_b(NULL, MODULNAME, "Monitor", PopUpOptions.Monitor);
- //Transparency
- db_set_b(NULL, MODULNAME, "EnableRegionTransparency", PopUpOptions.Enable9xTransparency);
- db_set_b(NULL, MODULNAME, "UseTransparency", PopUpOptions.UseTransparency);
- db_set_b(NULL, MODULNAME, "Alpha", PopUpOptions.Alpha);
- db_set_b(NULL, MODULNAME, "OpaqueOnHover", PopUpOptions.OpaqueOnHover);
-
- //Effects
- db_set_b(NULL, MODULNAME, "UseAnimations", PopUpOptions.UseAnimations);
- db_set_b(NULL, MODULNAME, "Fade", PopUpOptions.UseEffect);
- db_set_ts(NULL, MODULNAME, "Effect", PopUpOptions.Effect);
- db_set_dw(NULL, MODULNAME, "FadeInTime", PopUpOptions.FadeIn);
- db_set_dw(NULL, MODULNAME, "FadeOutTime", PopUpOptions.FadeOut);
- //other old stuff
- db_set_w(NULL, MODULNAME, "MaxPopups", (BYTE)PopUpOptions.MaxPopups);
- }
- return TRUE;
- default:
- break;
}
+ }
+ break;
+ case IDC_FADEIN:
+ {
+ int fadeIn = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if ( fadeIn >= SETTING_FADEINTIME_MIN &&
+ fadeIn <= SETTING_FADEINTIME_MAX ) {
+ PopUpOptions.FadeIn = fadeIn;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_FADEOUT:
+ {
+ int fadeOut = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if ( fadeOut >= SETTING_FADEOUTTIME_MIN &&
+ fadeOut <= SETTING_FADEOUTTIME_MAX){
+ PopUpOptions.FadeOut = fadeOut;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
- break;
- default:
- break;
+ }
+ break;
}
- }//end WM_NOTIFY
- break;
- case WM_DESTROY:
- {
- bDlgInit = false;
- }//end WM_DESTROY
break;
- default:
- return FALSE;
- }//end switch (msg)
+
+ case EN_KILLFOCUS: //Edit controls lost fokus
+ //lParam = Handle to the control
+ switch(idCtrl) {
+ case IDC_MAXPOPUPS:
+ {
+ int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (maxPop <= 0)
+ PopUpOptions.MaxPopups = 20;
+ if (maxPop != PopUpOptions.MaxPopups) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MaxPopups, FALSE);
+ //ErrorMSG(1);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_HISTORYSIZE:
+ {
+ int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (histSize <= 0)
+ PopUpOptions.HistorySize = SETTING_HISTORYSIZE_DEFAULT;
+ else if (histSize > SETTING_HISTORYSIZE_MAX)
+ PopUpOptions.HistorySize = SETTING_HISTORYSIZE_MAX;
+ if (histSize != PopUpOptions.HistorySize) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.HistorySize, FALSE);
+ ErrorMSG(1, SETTING_HISTORYSIZE_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_AVT_RADIUS:
+ {
+ int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (avtRadius > SETTING_AVTSIZE_MAX / 2)
+ PopUpOptions.avatarRadius = SETTING_AVTSIZE_MAX / 2;
+ if (avtRadius != PopUpOptions.avatarRadius) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.avatarRadius, FALSE);
+ ErrorMSG(0, SETTING_AVTSIZE_MAX / 2);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_FADEIN:
+ {
+ int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (fade < SETTING_FADEINTIME_MIN)
+ PopUpOptions.FadeIn = SETTING_FADEINTIME_MIN;
+ else if (fade > SETTING_FADEINTIME_MAX)
+ PopUpOptions.FadeIn = SETTING_FADEINTIME_MAX;
+ if (fade != PopUpOptions.FadeIn) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeIn, FALSE);
+ ErrorMSG(SETTING_FADEINTIME_MIN, SETTING_FADEINTIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_FADEOUT:
+ {
+ int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (fade < SETTING_FADEOUTTIME_MIN)
+ PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MIN;
+ else if (fade > SETTING_FADEOUTTIME_MAX)
+ PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MAX;
+ if (fade != PopUpOptions.FadeOut) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeOut, FALSE);
+ ErrorMSG(SETTING_FADEOUTTIME_MIN, SETTING_FADEOUTTIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_AdvOpts();
+ return TRUE;
+
+ case PSN_APPLY:
+ //History
+ db_set_b(NULL, MODULNAME, "EnableHistory", (BYTE)PopUpOptions.EnableHistory);
+ db_set_w(NULL, MODULNAME, "HistorySize", PopUpOptions.HistorySize);
+ PopupHistoryResize();
+ db_set_b(NULL, MODULNAME, "UseHppHistoryLog", PopUpOptions.UseHppHistoryLog);
+ //Avatars
+ db_set_b(NULL, MODULNAME, "AvatarBorders", PopUpOptions.avatarBorders);
+ db_set_b(NULL, MODULNAME, "AvatarPNGBorders", PopUpOptions.avatarPNGBorders);
+ db_set_b(NULL, MODULNAME, "AvatarRadius", PopUpOptions.avatarRadius);
+ db_set_w(NULL, MODULNAME, "AvatarSize", PopUpOptions.avatarSize);
+ db_set_b(NULL, MODULNAME, "EnableAvatarUpdates", PopUpOptions.EnableAvatarUpdates);
+ //Monitor
+ db_set_b(NULL, MODULNAME, "Monitor", PopUpOptions.Monitor);
+ //Transparency
+ db_set_b(NULL, MODULNAME, "EnableRegionTransparency", PopUpOptions.Enable9xTransparency);
+ db_set_b(NULL, MODULNAME, "UseTransparency", PopUpOptions.UseTransparency);
+ db_set_b(NULL, MODULNAME, "Alpha", PopUpOptions.Alpha);
+ db_set_b(NULL, MODULNAME, "OpaqueOnHover", PopUpOptions.OpaqueOnHover);
+
+ //Effects
+ db_set_b(NULL, MODULNAME, "UseAnimations", PopUpOptions.UseAnimations);
+ db_set_b(NULL, MODULNAME, "Fade", PopUpOptions.UseEffect);
+ db_set_ts(NULL, MODULNAME, "Effect", PopUpOptions.Effect);
+ db_set_dw(NULL, MODULNAME, "FadeInTime", PopUpOptions.FadeIn);
+ db_set_dw(NULL, MODULNAME, "FadeOutTime", PopUpOptions.FadeOut);
+ //other old stuff
+ db_set_w(NULL, MODULNAME, "MaxPopups", (BYTE)PopUpOptions.MaxPopups);
+ }
+ return TRUE;
+ }
+ break;
+
+ case WM_DESTROY:
+ bDlgInit = false;
+ break;
+ }
return FALSE;
}
@@ -602,9 +564,9 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
if (oldVal != newVal) {
- if (oldVal < 0) {
+ if (oldVal < 0)
SetWindowLongPtr(hwndBox, GWLP_USERDATA, 0);
- }
+
RECT rc; GetWindowRect(hwnd, &rc);
SetWindowPos(hwndBox, NULL,
(rc.left+rc.right-newVal)/2, rc.bottom+2, newVal, newVal,
@@ -617,6 +579,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
}
}
break;
+
case WM_MOUSELEAVE:
SetWindowRgn(hwndBox, NULL, TRUE);
ShowWindow(hwndBox, SW_HIDE);
@@ -666,8 +629,9 @@ LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
oldVal = newVal;
}
- break;
}
+ break;
+
case WM_MOUSELEAVE:
SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
SetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp
index b19ee39359..3d7f976c1e 100644
--- a/plugins/Popup/src/opt_contacts.cpp
+++ b/plugins/Popup/src/opt_contacts.cpp
@@ -30,14 +30,13 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
{
switch (msg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwnd);
-
- SendMessage(GetDlgItem(hwnd, IDC_ICO_AUTO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0);
- SendMessage(GetDlgItem(hwnd, IDC_ICO_FAVORITE), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0);
- SendMessage(GetDlgItem(hwnd, IDC_ICO_FULLSCREEN), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0);
- SendMessage(GetDlgItem(hwnd, IDC_ICO_BLOCK), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0);
+ TranslateDialogDefault(hwnd);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_AUTO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_FAVORITE), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_FULLSCREEN), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_BLOCK), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0);
+ {
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
(IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,5,5);
ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
@@ -49,9 +48,8 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*SIZEOF(sttIcons)*/, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
sttSetAllContactIcons(GetDlgItem(hwnd, IDC_LIST));
-
- break;
}
+ break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
@@ -65,27 +63,22 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
sttResetListOptions(GetDlgItem(hwnd,IDC_LIST));
break;
case NM_CLICK:
- {
- HANDLE hItem;
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
- DWORD hitFlags;
- int iImage;
-
- if (nm->iColumn==-1) break;
- hItem=(HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
- if (hItem==NULL) break;
- if (!(hitFlags&CLCHT_ONITEMEXTRA)) break;
-
- iImage = SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
- if (iImage != EMPTY_EXTRA_ICON) {
- for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
- //hIml element [0] = SKINICON_OTHER_SMALLDOT
- //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
- SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (i==nm->iColumn)?i+1:0));
- }
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
+ NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
+ if (nm->iColumn==-1) break;
+
+ DWORD hitFlags;
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ if (hItem==NULL) break;
+ if (!(hitFlags&CLCHT_ONITEMEXTRA)) break;
+
+ int iImage = SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ if (iImage != EMPTY_EXTRA_ICON) {
+ for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
+ //hIml element [0] = SKINICON_OTHER_SMALLDOT
+ //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
+ SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (i==nm->iColumn)?i+1:0));
}
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
break;
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 21716c3d33..648df83f46 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -85,41 +85,47 @@ int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flags)
//Main Dialog Proc
-void LoadOption_General() {
+void LoadOption_General()
+{
//Seconds
- PopUpOptions.InfiniteDelay = db_get_b(NULL, MODULNAME, "InfiniteDelay", FALSE);
- PopUpOptions.Seconds = DBGetContactSettingRangedWord(NULL, MODULNAME, "Seconds",
- SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- PopUpOptions.LeaveHovered = db_get_b(NULL, MODULNAME, "LeaveHovered", TRUE);
+ PopUpOptions.InfiniteDelay = db_get_b(NULL, MODULNAME, "InfiniteDelay", FALSE);
+ PopUpOptions.Seconds =
+ DBGetContactSettingRangedWord(NULL, MODULNAME, "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
+ PopUpOptions.LeaveHovered = db_get_b(NULL, MODULNAME, "LeaveHovered", TRUE);
+
//Dynamic Resize
- PopUpOptions.DynamicResize = db_get_b(NULL, MODULNAME, "DynamicResize", FALSE);
- PopUpOptions.UseMinimumWidth = db_get_b(NULL, MODULNAME, "UseMinimumWidth", TRUE);
- PopUpOptions.MinimumWidth = db_get_w(NULL, MODULNAME, "MinimumWidth", 160);
- PopUpOptions.UseMaximumWidth = db_get_b(NULL, MODULNAME, "UseMaximumWidth", TRUE);
- PopUpOptions.MaximumWidth = db_get_w(NULL, MODULNAME, "MaximumWidth", 300);
+ PopUpOptions.DynamicResize = db_get_b(NULL, MODULNAME, "DynamicResize", FALSE);
+ PopUpOptions.UseMinimumWidth = db_get_b(NULL, MODULNAME, "UseMinimumWidth", TRUE);
+ PopUpOptions.MinimumWidth = db_get_w(NULL, MODULNAME, "MinimumWidth", 160);
+ PopUpOptions.UseMaximumWidth = db_get_b(NULL, MODULNAME, "UseMaximumWidth", TRUE);
+ 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);
- PopUpOptions.gapBottom = db_get_w(NULL, MODULNAME, "gapBottom", 5);
- PopUpOptions.gapLeft = db_get_w(NULL, MODULNAME, "gapLeft", 5);
- PopUpOptions.gapRight = db_get_w(NULL, MODULNAME, "gapRight", 5);
- PopUpOptions.spacing = db_get_w(NULL, MODULNAME, "spacing", 5);
+ PopUpOptions.gapTop = db_get_w(NULL, MODULNAME, "gapTop", 5);
+ PopUpOptions.gapBottom = db_get_w(NULL, MODULNAME, "gapBottom", 5);
+ PopUpOptions.gapLeft = db_get_w(NULL, MODULNAME, "gapLeft", 5);
+ PopUpOptions.gapRight = db_get_w(NULL, MODULNAME, "gapRight", 5);
+ 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);
- PopUpOptions.ReorderPopUpsWarning = db_get_b(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE);
+ PopUpOptions.ReorderPopUps = db_get_b(NULL, MODULNAME, "ReorderPopUps", TRUE);
+ PopUpOptions.ReorderPopUpsWarning = db_get_b(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE);
+
//disable When
- PopUpOptions.ModuleIsEnabled = db_get_b(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
- PopUpOptions.DisableWhenFullscreen = db_get_b(NULL, MODULNAME, "DisableWhenFullscreen", TRUE);
- //new status options (done inside WM_INITDIALOG)
- //Debug (done inside LoadOptions())
+ PopUpOptions.ModuleIsEnabled = db_get_b(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
+ PopUpOptions.DisableWhenFullscreen = db_get_b(NULL, MODULNAME, "DisableWhenFullscreen", TRUE);
}
-INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
static OPTTREE_OPTION *statusOptions = NULL;
@@ -131,81 +137,74 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
switch (msg) {
- case WM_INITDIALOG: {
- HWND hCtrl = NULL;
-
- //Seconds of delay
- {
- CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopUpOptions.InfiniteDelay);
- CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopUpOptions.LeaveHovered);
- 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);
- SetDlgItemInt(hwnd, IDC_SECONDS, PopUpOptions.Seconds, FALSE);
- SendDlgItemMessage(hwnd, IDC_SECONDS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_MIN));
- }
-
- //Dynamic Resize
- {
- CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopUpOptions.DynamicResize);
- 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));
- 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));
- 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);
- }
- //Position combobox.
- {
- hCtrl = GetDlgItem(hwnd, IDC_WHERE);
+ case WM_INITDIALOG:
+ //Seconds of delay
+ CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopUpOptions.InfiniteDelay);
+ CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopUpOptions.LeaveHovered);
+ 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);
+ SetDlgItemInt(hwnd, IDC_SECONDS, PopUpOptions.Seconds, FALSE);
+ SendDlgItemMessage(hwnd, IDC_SECONDS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_MIN));
+
+ //Dynamic Resize
+ CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopUpOptions.DynamicResize);
+ 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));
+ 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));
+ 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);
+
+ //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);
- }
- //Configure popup area
- {
- hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
+ }
+ //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));
- }
- //Spreading combobox
- {
- hCtrl = GetDlgItem(hwnd, IDC_LAYOUT);
+ }
+ //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);
- }
- //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);
- }
- //new status options
- {
+ }
+ //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);
+
+ //new status options
+ {
int protocolCount = 0;
PROTOACCOUNT **protocols;
ProtoEnumAccounts(&protocolCount, &protocols);
@@ -219,12 +218,12 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
statusOptions = new OPTTREE_OPTION[statusOptionsCount];
- int pos = 0;
- pos = AddStatusModes(statusOptions, pos, LPGENT("Global Status"), globalFlags);
+ int pos = AddStatusModes(statusOptions, 0, LPGENT("Global Status"), globalFlags);
for (int i = 0; i < protocolCount; ++i) {
DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
if (!CountStatusModes(protoFlags))
continue;
+
TCHAR prefix[128];
mir_sntprintf(prefix,SIZEOF(prefix), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
@@ -246,394 +245,360 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENT("Global Status"));
+ }
+
+ TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ bDlgInit = true;
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (HIWORD(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);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_LEAVEHOVERED:
+ PopUpOptions.LeaveHovered = !PopUpOptions.LeaveHovered;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ 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"));
+ 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);
+ }
+ 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);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_USEMAXIMUMWIDTH:
+ 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);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_CUSTOMPOS:
+ {
+ RECT rcButton, rcBox;
+ HWND hwndBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POSITION), NULL, PositionBoxDlgProc);
+ GetWindowRect((HWND)lParam, &rcButton);
+ GetWindowRect(hwndBox, &rcBox);
+ MoveWindow(hwndBox,
+ rcButton.right-(rcBox.right-rcBox.left) + 15,
+ rcButton.bottom + 3,
+ rcBox.right-rcBox.left,
+ rcBox.bottom-rcBox.top,
+ FALSE);
+
+ 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) {
+ SetLayeredWindowAttributes(hwndBox, NULL, i, LWA_ALPHA);
+ UpdateWindow(hwndBox);
+ Sleep(1);
+ }
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)&~WS_EX_LAYERED);
+
+ ShowWindow(hwndBox, SW_SHOW);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+
+ case IDC_REORDERPOPUPS:
+ {
+ PopUpOptions.ReorderPopUps = !PopUpOptions.ReorderPopUps;
+ PopUpOptions.ReorderPopUpsWarning = PopUpOptions.ReorderPopUps ?
+ db_get_b(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE) : TRUE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+
+ 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);
+ }
+ break;
+
+ case IDC_DISABLEINFS:
+ PopUpOptions.DisableWhenFullscreen = !PopUpOptions.DisableWhenFullscreen;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_PREVIEW:
+ PopUpPreview();
+ break;
}
- //Debug
- {
- #if defined(_DEBUG)
- CheckDlgButton(hwnd, IDC_DEBUG, PopUpOptions.debug);
- ShowWindow(GetDlgItem(hwnd, IDC_DEBUG), SW_SHOW);
- #endif
+ break;
+
+ case CBN_SELCHANGE: //ComboBox controls
+ switch( LOWORD(wParam)) {
+ //lParam = Handle to the control
+ case IDC_WHERE:
+ PopUpOptions.Position = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_LAYOUT:
+ PopUpOptions.Spreading = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
}
+ break;
- TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
- bDlgInit = true;
- }//end WM_INITDIALOG
- return TRUE;
- case WM_COMMAND: {
- UINT idCtrl = LOWORD(wParam);
- switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
- switch(idCtrl) {
- 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);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_LEAVEHOVERED:
- {
- PopUpOptions.LeaveHovered = !PopUpOptions.LeaveHovered;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- 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"));
- 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);
- }
- 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);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_USEMAXIMUMWIDTH:
- {
- PopUpOptions.UseMaximumWidth= Button_GetCheck((HWND)lParam);
- if (!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
- CheckDlgButton(hwnd, idCtrl, BST_CHECKED);
- PopUpOptions.UseMaximumWidth = TRUE;
- }
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopUpOptions.UseMaximumWidth);
- EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopUpOptions.UseMaximumWidth);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_CUSTOMPOS:
- {
- RECT rcButton, rcBox;
- HWND hwndBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POSITION), NULL, PositionBoxDlgProc);
- GetWindowRect((HWND)lParam, &rcButton);
- GetWindowRect(hwndBox, &rcBox);
- MoveWindow(hwndBox,
- rcButton.right-(rcBox.right-rcBox.left) + 15,
- rcButton.bottom + 3,
- rcBox.right-rcBox.left,
- rcBox.bottom-rcBox.top,
- FALSE);
-
- 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) {
- SetLayeredWindowAttributes(hwndBox, NULL, i, LWA_ALPHA);
- UpdateWindow(hwndBox);
- Sleep(1);
- }
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)&~WS_EX_LAYERED);
-
- ShowWindow(hwndBox, SW_SHOW);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_REORDERPOPUPS:
- {
- PopUpOptions.ReorderPopUps = !PopUpOptions.ReorderPopUps;
- PopUpOptions.ReorderPopUpsWarning = PopUpOptions.ReorderPopUps ?
- db_get_b(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE) : TRUE;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- case IDC_POPUPENABLED:
- {//PopUpOptions.ModuleIsEnabled is set and store by EnableDisable menu service !!!!!!
- 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);
- }
- break;
- case IDC_DISABLEINFS:
- {
- PopUpOptions.DisableWhenFullscreen = !PopUpOptions.DisableWhenFullscreen;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
- #if defined(_DEBUG) //DEBUG
- case IDC_DEBUG:
- PopUpOptions.debug = (BYTE)Button_GetCheck((HWND)lParam);
- //The following line is dangerous, but useful for my debug purposes.
- //MySetLayeredWindowAttributes = (BOOL)!MySetLayeredWindowAttributes;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- #endif //DEBUG
- case IDC_PREVIEW:
- {
- PopUpPreview();
- }
- break;
- default:
- break;
- }
- break;
- case CBN_SELCHANGE: //ComboBox controls
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_WHERE:
- PopUpOptions.Position = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- case IDC_LAYOUT:
- PopUpOptions.Spreading = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- default:
- break;
- }
- break;
- case EN_CHANGE: //Edit controls change
- if (!bDlgInit) break;
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_SECONDS:
- {
- int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if ( seconds >= SETTING_LIFETIME_MIN &&
- seconds <= SETTING_LIFETIME_MAX &&
- seconds != PopUpOptions.Seconds) {
- PopUpOptions.Seconds = seconds;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_MINIMUMWIDTH:
- {
- int temp = GetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, NULL, FALSE);
- if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
- temp <= SETTING_MAXIMUMWIDTH_MAX &&
- temp != PopUpOptions.MinimumWidth) {
- PopUpOptions.MinimumWidth = temp;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- case IDC_MAXIMUMWIDTH:
- {
- int temp = GetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, NULL, FALSE);
- if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
- temp <= SETTING_MAXIMUMWIDTH_MAX &&
- temp != PopUpOptions.MaximumWidth) {
- PopUpOptions.MaximumWidth = temp;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
- default:
- break;
- }//end switch(idCtrl)
- break;
- case EN_KILLFOCUS: //Edit controls lost fokus
- switch(idCtrl) {
- //lParam = Handle to the control
- case IDC_SECONDS:
- {
- int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (seconds > SETTING_LIFETIME_MAX)
- PopUpOptions.Seconds = SETTING_LIFETIME_MAX;
- else if (seconds < SETTING_LIFETIME_MIN)
- PopUpOptions.Seconds = SETTING_LIFETIME_MIN;
- if (seconds != PopUpOptions.Seconds) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.Seconds, FALSE);
- ErrorMSG(SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- SetFocus((HWND)lParam);
- }
- }
- break;
- case IDC_MINIMUMWIDTH:
- {
- int temp = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (temp < SETTING_MINIMUMWIDTH_MIN)
- PopUpOptions.MinimumWidth = SETTING_MINIMUMWIDTH_MIN;
- else if (temp > SETTING_MAXIMUMWIDTH_MAX)
- PopUpOptions.MinimumWidth = SETTING_MAXIMUMWIDTH_MAX;
- if (temp != PopUpOptions.MinimumWidth) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MinimumWidth, FALSE);
- ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
- SetFocus((HWND)lParam);
- break;
- }
- if (temp > PopUpOptions.MaximumWidth) {
- PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
- SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
- }
- }
- break;
- case IDC_MAXIMUMWIDTH:
- {
- int temp = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
- if (temp >= SETTING_MAXIMUMWIDTH_MAX)
- PopUpOptions.MaximumWidth = SETTING_MAXIMUMWIDTH_MAX;
- else if (temp < SETTING_MINIMUMWIDTH_MIN)
- PopUpOptions.MaximumWidth = SETTING_MINIMUMWIDTH_MIN;
- if (temp != PopUpOptions.MaximumWidth) {
- SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MaximumWidth, FALSE);
- ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
- SetFocus((HWND)lParam);
- break;
- }
- if (temp < PopUpOptions.MinimumWidth) {
- PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
- SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
- }
- }
- break;
- default:
- break;
- }//end switch(idCtrl)
- break;
- default:
- break;
- }// end switch (HIWORD(wParam))
- }//end WM_COMMAND
+ case EN_CHANGE: //Edit controls change
+ if (!bDlgInit) break;
+ switch( LOWORD(wParam)) {
+ //lParam = Handle to the control
+ case IDC_SECONDS:
+ {
+ int seconds = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
+ if ( seconds >= SETTING_LIFETIME_MIN &&
+ seconds <= SETTING_LIFETIME_MAX &&
+ seconds != PopUpOptions.Seconds) {
+ PopUpOptions.Seconds = seconds;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_MINIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, NULL, FALSE);
+ if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ temp <= SETTING_MAXIMUMWIDTH_MAX &&
+ temp != PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = temp;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_MAXIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, NULL, FALSE);
+ if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ temp <= SETTING_MAXIMUMWIDTH_MAX &&
+ temp != PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = temp;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ }//end switch(idCtrl)
break;
- case WM_NOTIFY: {
- switch(((LPNMHDR)lParam)->idFrom) {
- case 0: {
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET:
- LoadOption_General();
- return TRUE;
- case PSN_APPLY: {
- //Seconds
- db_set_b(NULL, MODULNAME, "InfiniteDelay", PopUpOptions.InfiniteDelay);
- db_set_w(NULL, MODULNAME, "Seconds", (WORD)PopUpOptions.Seconds);
- db_set_b(NULL, MODULNAME, "LeaveHovered", PopUpOptions.LeaveHovered);
- //Dynamic Resize
- db_set_b(NULL, MODULNAME, "DynamicResize", PopUpOptions.DynamicResize);
- db_set_b(NULL, MODULNAME, "UseMinimumWidth", PopUpOptions.UseMinimumWidth);
- db_set_w(NULL, MODULNAME, "MinimumWidth", PopUpOptions.MinimumWidth);
- db_set_b(NULL, MODULNAME, "UseMaximumWidth", PopUpOptions.UseMaximumWidth);
- db_set_w(NULL, MODULNAME, "MaximumWidth", PopUpOptions.MaximumWidth);
- //Position
- 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);
- //Spreading
- db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopUpOptions.Spreading);
- //miscellaneous
- //db_set_b(NULL, MODULNAME, "ReorderPopUps", PopUpOptions.ReorderPopUps);
- Check_ReorderPopUps(hwnd); //this save also PopUpOptions.ReorderPopUps
- //disable When
- db_set_b(NULL, MODULNAME, "DisableWhenFullscreen", PopUpOptions.DisableWhenFullscreen);
- //new status options
- {
- int protocolCount;
- PROTOACCOUNT **protocols;
- ProtoEnumAccounts(&protocolCount, &protocols);
-
- char prefix[128];
- for (int i=0; i < protocolCount; ++i)
- {
- TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, SIZEOF(pszSettingName), _T("Protocol Status/%s"), protocols[i]->tszAccountName);
- db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
- }
- db_set_dw(NULL, MODULNAME, "Global Status", OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, _T("Global Status")));
- }
- //Debug
- #if defined(_DEBUG)
- db_set_b(NULL, MODULNAME, "debug", PopUpOptions.debug);
- #endif
-
- }//end PSN_APPLY:
- return TRUE;
- default:
- break;
+
+ case EN_KILLFOCUS: //Edit controls lost fokus
+ switch( LOWORD(wParam)) {
+ //lParam = Handle to the control
+ case IDC_SECONDS:
+ {
+ int seconds = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
+ if (seconds > SETTING_LIFETIME_MAX)
+ PopUpOptions.Seconds = SETTING_LIFETIME_MAX;
+ else if (seconds < SETTING_LIFETIME_MIN)
+ PopUpOptions.Seconds = SETTING_LIFETIME_MIN;
+ if (seconds != PopUpOptions.Seconds) {
+ SetDlgItemInt(hwnd, LOWORD(wParam), PopUpOptions.Seconds, FALSE);
+ ErrorMSG(SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
+ SetFocus((HWND)lParam);
}
+ }
+ break;
+ case IDC_MINIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
+ if (temp < SETTING_MINIMUMWIDTH_MIN)
+ PopUpOptions.MinimumWidth = SETTING_MINIMUMWIDTH_MIN;
+ else if (temp > SETTING_MAXIMUMWIDTH_MAX)
+ PopUpOptions.MinimumWidth = SETTING_MAXIMUMWIDTH_MAX;
+ if (temp != PopUpOptions.MinimumWidth) {
+ SetDlgItemInt(hwnd, LOWORD(wParam), PopUpOptions.MinimumWidth, FALSE);
+ ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
+ SetFocus((HWND)lParam);
+ break;
}
- break;
- case IDC_MINIMUMWIDTH_SPIN:
- {
- LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
- int temp = lpnmud->iPos + lpnmud->iDelta;
- if (temp > PopUpOptions.MaximumWidth) {
- PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
- SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
- }
+ if (temp > PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
+ SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
}
- break;
- case IDC_MAXIMUMWIDTH_SPIN:
- {
- LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
- int temp = lpnmud->iPos + lpnmud->iDelta;
- if (temp < PopUpOptions.MinimumWidth) {
- PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
- SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
- }
+ }
+ break;
+ case IDC_MAXIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
+ if (temp >= SETTING_MAXIMUMWIDTH_MAX)
+ PopUpOptions.MaximumWidth = SETTING_MAXIMUMWIDTH_MAX;
+ else if (temp < SETTING_MINIMUMWIDTH_MIN)
+ PopUpOptions.MaximumWidth = SETTING_MINIMUMWIDTH_MIN;
+ if (temp != PopUpOptions.MaximumWidth) {
+ SetDlgItemInt(hwnd, LOWORD(wParam), PopUpOptions.MaximumWidth, FALSE);
+ ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
+ SetFocus((HWND)lParam);
+ break;
}
- break;
- default:
- break;
+ if (temp < PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
+ SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
+ }
+ }
+ break;
}
- }//end WM_NOTIFY
break;
- case WM_DESTROY: {
- if (statusOptions) {
- for (int i=0; i < statusOptionsCount; ++i) {
- mir_free(statusOptions[i].pszOptionName);
- mir_free(statusOptions[i].pszSettingName);
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_General();
+ return TRUE;
+
+ case PSN_APPLY:
+ //Seconds
+ db_set_b(NULL, MODULNAME, "InfiniteDelay", PopUpOptions.InfiniteDelay);
+ db_set_w(NULL, MODULNAME, "Seconds", (WORD)PopUpOptions.Seconds);
+ db_set_b(NULL, MODULNAME, "LeaveHovered", PopUpOptions.LeaveHovered);
+
+ //Dynamic Resize
+ db_set_b(NULL, MODULNAME, "DynamicResize", PopUpOptions.DynamicResize);
+ db_set_b(NULL, MODULNAME, "UseMinimumWidth", PopUpOptions.UseMinimumWidth);
+ db_set_w(NULL, MODULNAME, "MinimumWidth", PopUpOptions.MinimumWidth);
+ db_set_b(NULL, MODULNAME, "UseMaximumWidth", PopUpOptions.UseMaximumWidth);
+ db_set_w(NULL, MODULNAME, "MaximumWidth", PopUpOptions.MaximumWidth);
+
+ //Position
+ 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);
+
+ //Spreading
+ db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopUpOptions.Spreading);
+
+ //miscellaneous
+ Check_ReorderPopUps(hwnd); //this save also PopUpOptions.ReorderPopUps
+
+ //disable When
+ db_set_b(NULL, MODULNAME, "DisableWhenFullscreen", PopUpOptions.DisableWhenFullscreen);
+
+ //new status options
+ {
+ int protocolCount;
+ PROTOACCOUNT **protocols;
+ ProtoEnumAccounts(&protocolCount, &protocols);
+
+ for (int i=0; i < protocolCount; ++i) {
+ char prefix[128];
+ mir_snprintf(prefix, SIZEOF(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+
+ TCHAR pszSettingName[256];
+ mir_sntprintf(pszSettingName, SIZEOF(pszSettingName), _T("Protocol Status/%s"), protocols[i]->tszAccountName);
+ db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
+ }
+ db_set_dw(NULL, MODULNAME, "Global Status", OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, _T("Global Status")));
}
- delete [] statusOptions;
- statusOptions = NULL;
- statusOptionsCount = 0;
- bDlgInit = false;
+ return TRUE;
}
- }//end WM_DESTROY
break;
- default:
- return FALSE;
- }//end switch (msg)
+
+ case IDC_MINIMUMWIDTH_SPIN:
+ {
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ int temp = lpnmud->iPos + lpnmud->iDelta;
+ if (temp > PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
+ SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
+ }
+ }
+ break;
+
+ case IDC_MAXIMUMWIDTH_SPIN:
+ {
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ int temp = lpnmud->iPos + lpnmud->iDelta;
+ if (temp < PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
+ SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
+ }
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ if (statusOptions) {
+ for (int i=0; i < statusOptionsCount; ++i) {
+ mir_free(statusOptions[i].pszOptionName);
+ mir_free(statusOptions[i].pszSettingName);
+ }
+ delete [] statusOptions;
+ statusOptions = NULL;
+ statusOptionsCount = 0;
+ bDlgInit = false;
+ }
+ break;
+ }
return FALSE;
}
-void ErrorMSG(int minValue, int maxValue) {
- TCHAR str[128];
- wsprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
- MSGERROR(str);
+void ErrorMSG(int minValue, int maxValue)
+{
+ TCHAR str[128];
+ wsprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
+ MSGERROR(str);
}
void Check_ReorderPopUps(HWND hwnd) {
- if (!PopUpOptions.ReorderPopUps && PopUpOptions.ReorderPopUpsWarning)
- {
+ 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 NewStatusNotify).\r\n\r\nDo you want to enable popup reordering now?\r\n"),
TranslateT("Popup Plus Warning"), MB_ICONEXCLAMATION | MB_YESNOCANCEL);
- switch (res)
- {
- case IDYES:
- PopUpOptions.ReorderPopUps = TRUE;
- //Reset warning for next option change !!!
- PopUpOptions.ReorderPopUpsWarning = TRUE;
- break;
- case IDNO:
- PopUpOptions.ReorderPopUps = FALSE;
- PopUpOptions.ReorderPopUpsWarning = FALSE;
- break;
- default:
- return;
+ switch (res) {
+ case IDYES:
+ PopUpOptions.ReorderPopUps = TRUE;
+ //Reset warning for next option change !!!
+ PopUpOptions.ReorderPopUpsWarning = TRUE;
+ break;
+ case IDNO:
+ PopUpOptions.ReorderPopUps = FALSE;
+ PopUpOptions.ReorderPopUpsWarning = FALSE;
+ break;
+ default:
+ return;
}
}
db_set_b(NULL, MODULNAME, "ReorderPopUps", PopUpOptions.ReorderPopUps);
@@ -641,7 +606,8 @@ void Check_ReorderPopUps(HWND hwnd) {
if (hwnd) CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopUpOptions.ReorderPopUps);
}
-void ThemeDialogBackground(HWND hwnd) {
+void ThemeDialogBackground(HWND hwnd)
+{
if (IsWinVerXPPlus()) {
static HMODULE hThemeAPI = NULL;
if (!hThemeAPI) hThemeAPI = GetModuleHandleA("uxtheme");
@@ -655,13 +621,13 @@ void ThemeDialogBackground(HWND hwnd) {
INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ LOGFONT lf;
static HFONT hFontTitle = 0;
- switch (msg)
- {
+
+ switch (msg) {
case WM_INITDIALOG:
ThemeDialogBackground(hwndDlg);
- LOGFONT lf;
GetObject((HFONT)SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_GETFONT, 0, 0), sizeof(lf), &lf);
lf.lfWeight = FW_BOLD;
lf.lfHeight *= 1.2;
@@ -684,30 +650,29 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TranslateDialogDefault(hwndDlg);
break;
+
case WM_COMMAND:
- if ((LOWORD(wParam)) == IDOK)
- {
+ if ((LOWORD(wParam)) == IDOK) {
PopUpOptions.gapTop = GetDlgItemInt(hwndDlg, IDC_TXT_TOP, NULL, FALSE);
PopUpOptions.gapBottom = GetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, NULL, FALSE);
PopUpOptions.gapLeft = GetDlgItemInt(hwndDlg, IDC_TXT_LEFT, NULL, FALSE);
PopUpOptions.gapRight = GetDlgItemInt(hwndDlg, IDC_TXT_RIGHT, NULL, FALSE);
PopUpOptions.spacing = GetDlgItemInt(hwndDlg, IDC_TXT_SPACING, NULL, FALSE);
PostMessage(hwndDlg, WM_CLOSE, 0, 0);
- } else
- if ((LOWORD(wParam)) == IDCANCEL)
- {
- PostMessage(hwndDlg, WM_CLOSE, 0, 0);
}
+ else if ((LOWORD(wParam)) == IDCANCEL)
+ PostMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
+
case WM_ACTIVATE:
if (wParam == WA_INACTIVE)
- {
PostMessage(hwndDlg, WM_CLOSE, 0, 0);
- }
break;
+
case WM_CLOSE:
DestroyWindow(hwndDlg);
break;
+
case WM_DESTROY:
DeleteObject(hFontTitle);
break;
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index faca667577..8075bee830 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -209,39 +209,38 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos
LPGENT("Enable Aero Glass (Vista+)"),
LPGENT("Use Windows colours"),
LPGENT("Use advanced text render")};
+
for (int i=0; i < SIZEOF(mainOption); i++) {
bCheck = 0;
switch (i) {
- case 0:
- *dwGlobalOptions |= PopUpOptions.DisplayTime ? (1 << i) : 0;
- bCheck = PopUpOptions.DisplayTime;
- break;
- case 1:
- if (!IsWinVerXPPlus()) continue;
- *dwGlobalOptions |= PopUpOptions.DropShadow ? (1 << i) : 0;
- bCheck = PopUpOptions.DropShadow;
- break;
- case 2:
- if (!IsWinVerXPPlus()) continue;
- *dwGlobalOptions |= PopUpOptions.EnableFreeformShadows ? (1 << i) : 0;
- bCheck = PopUpOptions.EnableFreeformShadows;
- break;
- case 3:
- if (!MyDwmEnableBlurBehindWindow) continue;
- *dwGlobalOptions |= PopUpOptions.EnableAeroGlass ? (1 << i) : 0;
- bCheck = PopUpOptions.EnableAeroGlass;
- break;
- case 4:
- *dwGlobalOptions |= PopUpOptions.UseWinColors ? (1 << i) : 0;
- bCheck = PopUpOptions.UseWinColors;
- break;
- case 5:
- if (!(htuText&&htuTitle)) continue;
- *dwGlobalOptions |= PopUpOptions.UseMText ? (1 << i) : 0;
- bCheck = PopUpOptions.UseMText;
- break;
- default:
- break;
+ case 0:
+ *dwGlobalOptions |= PopUpOptions.DisplayTime ? (1 << i) : 0;
+ bCheck = PopUpOptions.DisplayTime;
+ break;
+ case 1:
+ if (!IsWinVerXPPlus()) continue;
+ *dwGlobalOptions |= PopUpOptions.DropShadow ? (1 << i) : 0;
+ bCheck = PopUpOptions.DropShadow;
+ break;
+ case 2:
+ if (!IsWinVerXPPlus()) continue;
+ *dwGlobalOptions |= PopUpOptions.EnableFreeformShadows ? (1 << i) : 0;
+ bCheck = PopUpOptions.EnableFreeformShadows;
+ break;
+ case 3:
+ if (!MyDwmEnableBlurBehindWindow) continue;
+ *dwGlobalOptions |= PopUpOptions.EnableAeroGlass ? (1 << i) : 0;
+ bCheck = PopUpOptions.EnableAeroGlass;
+ break;
+ case 4:
+ *dwGlobalOptions |= PopUpOptions.UseWinColors ? (1 << i) : 0;
+ bCheck = PopUpOptions.UseWinColors;
+ break;
+ case 5:
+ if (!(htuText&&htuTitle)) continue;
+ *dwGlobalOptions |= PopUpOptions.UseMText ? (1 << i) : 0;
+ bCheck = PopUpOptions.UseMText;
+ break;
}
*OptionsCount += 1;
options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
@@ -443,8 +442,6 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_GETSKINS:
CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/");
break;
- default:
- break;
}//end switch(idCtrl)
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
break;
@@ -534,13 +531,13 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
{
- switch (mode)
- {
- case 0:
+ RECT rc;
+
+ switch (mode) {
+ case 0:
{ // Avatar
HDC hdcAvatar = CreateCompatibleDC(mydc);
HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
- RECT rc;
GetClientRect(hwnd, &rc);
BITMAP bmp;
GetObject(hbmNoAvatar, sizeof(bmp), &bmp);
@@ -552,9 +549,8 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
DeleteObject(rgn);
break;
}
- case 1:
+ case 1:
{ // Opacity
- RECT rc;
HBRUSH hbr = CreateSolidBrush(fonts.clBack);
HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
GetClientRect(hwnd, &rc);
@@ -575,13 +571,12 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
DeleteObject(hbr);
- break;
}
- case 2:
+ break;
+
+ case 2:
{ // Position
- RECT rc;
- HBRUSH hbr;
- hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
+ HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
GetClientRect(hwnd, &rc);
FillRect(mydc, &rc, hbr);
DeleteObject(hbr);
@@ -604,43 +599,33 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
GetWindowRgn(hwnd, hrgn);
FrameRgn(mydc, hrgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
DeleteObject(hrgn);
-
- break;
}
+ break;
}
}
INT_PTR CALLBACK BoxPreviewWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_PAINT:
- {
- if (GetUpdateRect(hwnd, 0, FALSE))
- {
- PAINTSTRUCT ps;
- HDC mydc = BeginPaint(hwnd, &ps);
- BoxPreview_OnPaint(hwnd, mydc, GetWindowLongPtr(hwnd, GWLP_USERDATA));
- EndPaint(hwnd, &ps);
- return TRUE;
- }
- break;
- }
-
- case WM_PRINT:
- case WM_PRINTCLIENT:
- {
- HDC mydc = (HDC)wParam;
+ switch (msg) {
+ case WM_PAINT:
+ if (GetUpdateRect(hwnd, 0, FALSE)) {
+ PAINTSTRUCT ps;
+ HDC mydc = BeginPaint(hwnd, &ps);
BoxPreview_OnPaint(hwnd, mydc, GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ EndPaint(hwnd, &ps);
return TRUE;
}
+ break;
- case WM_LBUTTONDOWN:
- {
- ReleaseCapture();
- SendMessage(hwnd, WM_SYSCOMMAND, 0xF012 /*SC_DRAGMOVE*/, 0);
- return TRUE;
- }
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ BoxPreview_OnPaint(hwnd, (HDC)wParam, GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ return TRUE;
+
+ case WM_LBUTTONDOWN:
+ ReleaseCapture();
+ SendMessage(hwnd, WM_SYSCOMMAND, 0xF012 /*SC_DRAGMOVE*/, 0);
+ return TRUE;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp
index 3965987833..bdaf23e446 100644
--- a/plugins/Popup/src/opttree.cpp
+++ b/plugins/Popup/src/opttree.cpp
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
+enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
+
static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
{
union
@@ -160,10 +162,8 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd
return result;
}
-BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, int *result, int idcTree, OPTTREE_OPTION *options, int optionCount)
+BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, int *result, int idcTree, OPTTREE_OPTION *options, int optionCount)
{
- enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
-
HWND hwndTree = GetDlgItem(hwnd, idcTree);
switch (msg)
{
@@ -348,8 +348,6 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, LPTSTR pszSettingName)
{
- enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
-
HWND hwndTree = GetDlgItem(hwnd, idcTree);
DWORD result = 0;
int i;
@@ -358,7 +356,7 @@ DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int op
if ((!options[i].pszSettingName && !pszSettingName) ||
(options[i].pszSettingName && pszSettingName && !lstrcmp(options[i].pszSettingName, pszSettingName)))
{
- TVITEM tvi;
+ TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE|TVIF_IMAGE;
tvi.hItem = options[i].hItem;
TreeView_GetItem(hwndTree, &tvi);
@@ -371,11 +369,8 @@ DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int op
void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, DWORD dwOptions, LPTSTR pszSettingName)
{
- enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
-
HWND hwndTree = GetDlgItem(hwnd, idcTree);
- int i;
- for (i = 0; i < optionCount; ++i)
+ for (int i = 0; i < optionCount; ++i)
{
if ((!options[i].pszSettingName && !pszSettingName) ||
(options[i].pszSettingName && pszSettingName && !lstrcmp(options[i].pszSettingName, pszSettingName)))
@@ -384,12 +379,10 @@ void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int opt
tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvi.hItem = options[i].hItem;
if (options[i].groupId == OPTTREE_CHECK)
- {
tvi.iImage = tvi.iSelectedImage = (dwOptions & options[i].dwFlag) ? IMG_CHECK : IMG_NOCHECK;
- } else
- {
+ else
tvi.iImage = tvi.iSelectedImage = (dwOptions & options[i].dwFlag) ? IMG_RCHECK : IMG_NORCHECK;
- }
+
TreeView_SetItem(hwndTree, &tvi);
}
}