diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-14 19:07:52 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-14 19:07:52 +0000 |
commit | 0225e25a20995f5b091c31ea1ea91306bfc8e23c (patch) | |
tree | aca60c03c02591f9c95a99705d127d65ee056d68 /plugins | |
parent | 2a884a193239118e9ff76d7a29dae5a84fab1122 (diff) |
cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@13595 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Popup/src/avatars.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/bitmap_funcs.cpp | 2 | ||||
-rw-r--r-- | plugins/Popup/src/font.cpp | 8 | ||||
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/opt_adv.cpp | 426 | ||||
-rw-r--r-- | plugins/Popup/src/opt_adv.h | 6 | ||||
-rw-r--r-- | plugins/Popup/src/opt_class.cpp | 582 | ||||
-rw-r--r-- | plugins/Popup/src/opt_class.h | 6 | ||||
-rw-r--r-- | plugins/Popup/src/opt_contacts.cpp | 48 | ||||
-rw-r--r-- | plugins/Popup/src/opt_contacts.h | 6 | ||||
-rw-r--r-- | plugins/Popup/src/opt_gen.h | 6 | ||||
-rw-r--r-- | plugins/Popup/src/opt_skins.cpp | 462 | ||||
-rw-r--r-- | plugins/Popup/src/opt_skins.h | 6 | ||||
-rw-r--r-- | plugins/Popup/src/opttree.cpp | 304 | ||||
-rw-r--r-- | plugins/Popup/src/opttree.h | 22 | ||||
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 44 | ||||
-rw-r--r-- | plugins/Popup/src/services.cpp | 12 | ||||
-rw-r--r-- | plugins/Popup/src/skin.cpp | 6 |
18 files changed, 976 insertions, 978 deletions
diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp index 094fc26cd8..aa5529c5ee 100644 --- a/plugins/Popup/src/avatars.cpp +++ b/plugins/Popup/src/avatars.cpp @@ -31,10 +31,10 @@ PopupAvatar *PopupAvatar::create(MCONTACT hContact) {
avatarCacheEntry *av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
// MessageBox(NULL, _T("00"), _T(MODULNAME_LONG), MB_OK);
- if (av && (_tcslen(av->szFilename) > 4))
+ if (av && (mir_tstrlen(av->szFilename) > 4))
{
// MessageBox(NULL, _T("01"), _T(MODULNAME_LONG), MB_OK);
- if (!_tcsicmp(av->szFilename + _tcslen(av->szFilename) - 4, _T(".gif")))
+ if (!mir_tstrcmpi(av->szFilename + mir_tstrlen(av->szFilename) - 4, _T(".gif")))
{
// MessageBox(NULL, _T("02"), _T(MODULNAME_LONG), MB_OK);
if (db_get_b(NULL, MODULNAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename))
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 6636ff0546..8feeb7985f 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -832,7 +832,7 @@ bool MyBitmap::loadFromFile(const TCHAR *fn, const TCHAR *fnAlpha) return loadFromFile_gradient(fn);
TCHAR ext[5];
- _tcsncpy_s(ext, fn + (_tcslen(fn) - 4), _TRUNCATE);
+ mir_tstrncpy(ext, fn + (mir_tstrlen(fn) - 4), _TRUNCATE);
if (!mir_tstrcmpi(ext, _T(".png")))
return loadFromFile_png(fn);
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 1424c497af..5af5172e00 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -30,7 +30,7 @@ void InitFonts() { FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.group));
- strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(fid.dbSettingsGroup));
+ mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
@@ -67,15 +67,15 @@ void InitFonts() { ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
- strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(cid.dbSettingsGroup));
+ mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(cid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
- strncpy(cid.setting, PU_COL_BACK_SETTING, SIZEOF(cid.setting));
+ mir_strncpy(cid.setting, PU_COL_BACK_SETTING, SIZEOF(cid.setting));
cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
ColourRegisterT(&cid);
mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
- strncpy(cid.setting, PU_COL_AVAT_SETTING, SIZEOF(cid.setting));
+ mir_strncpy(cid.setting, PU_COL_AVAT_SETTING, SIZEOF(cid.setting));
cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
ColourRegisterT(&cid);
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 84e115bd6d..58d0461124 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -230,8 +230,8 @@ HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ) for (int i = 0; i < gTreeData.getCount(); i++) {
POPUPTREEDATA *p = gTreeData[i];
if (p->typ == typ &&
- (!group || (_tcscmp(p->pszTreeRoot, group) == 0)) &&
- (!name || (_tcscmp(p->pszDescription, name) == 0)))
+ (!group || (mir_tstrcmp(p->pszTreeRoot, group) == 0)) &&
+ (!name || (mir_tstrcmp(p->pszDescription, name) == 0)))
{
return p;
}
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 9275cf30ac..1183fa07d6 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HWND hwndBox = NULL;
LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK AlphaTrackBarWndProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
// effekt name for drop down box
LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
@@ -37,7 +37,7 @@ void OptAdv_RegisterVfx(char *name) void OptAdv_UnregisterVfx()
{
- for (int i=0; i < g_lstPopupVfx.getCount(); ++i)
+ for (int i = 0; i < g_lstPopupVfx.getCount(); ++i)
mir_free(g_lstPopupVfx[i]);
g_lstPopupVfx.destroy();
}
@@ -85,23 +85,23 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) {
case WM_INITDIALOG:
// Create preview box:
- {
- hwndBox = CreateWindowEx(
- WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
- _T(BOXPREVIEW_WNDCLASS), // Class name
- NULL, // Title
- DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
- CW_USEDEFAULT, // x
- CW_USEDEFAULT, // y
- CW_USEDEFAULT, // Width
- CW_USEDEFAULT, // Height
- HWND_DESKTOP, // Parent
- NULL, // menu handle
- hInst, // Instance
- (LPVOID)0);
- ShowWindow(hwndBox, SW_HIDE);
- }
- // Group: History
+ {
+ hwndBox = CreateWindowEx(
+ WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx
+ _T(BOXPREVIEW_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
+ (LPVOID)0);
+ ShowWindow(hwndBox, SW_HIDE);
+ }
+ // Group: History
{
CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopupOptions.EnableHistory ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemInt(hwnd, IDC_HISTORYSIZE, PopupOptions.HistorySize, FALSE);
@@ -114,12 +114,12 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)Translate("Popup History"), 0);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_HISTORY, 0));
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN),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);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), 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);
}
// Group: Avatars
{
@@ -182,29 +182,29 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Fade
SetDlgItemInt(hwnd, IDC_FADEIN, PopupOptions.FadeIn, FALSE);
SetDlgItemInt(hwnd, IDC_FADEOUT, PopupOptions.FadeOut, FALSE);
- UDACCEL aAccels[] = {{0,50},{1,100},{3,500}};
+ UDACCEL aAccels[] = { { 0, 50 }, { 1, 100 }, { 3, 500 } };
SendDlgItemMessage(hwnd, IDC_FADEIN_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_FADEINTIME_MAX, SETTING_FADEINTIME_MIN));
SendDlgItemMessage(hwnd, IDC_FADEIN_SPIN, UDM_SETACCEL, (WPARAM)SIZEOF(aAccels), (LPARAM)&aAccels);
SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_FADEOUTTIME_MAX, SETTING_FADEOUTTIME_MIN));
SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN, UDM_SETACCEL, (WPARAM)SIZEOF(aAccels), (LPARAM)&aAccels);
BOOL how = PopupOptions.UseAnimations || PopupOptions.UseEffect;
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), how);
- EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
// effects drop down
{
DWORD dwItem, dwActiveItem = 0;
BOOL how = TRUE;
- EnableWindow(GetDlgItem(hwnd, IDC_EFFECT), how);
- EnableWindow(GetDlgItem(hwnd, IDC_EFFECT_TXT), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_EFFECT), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_EFFECT_TXT), how);
HWND hCtrl = GetDlgItem(hwnd, IDC_EFFECT);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("No effect")), -2);
@@ -253,11 +253,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM 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_HISTORYSIZE_SPIN),PopupOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopupOptions.EnableHistory);
- EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), 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;
@@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_AVT_BORDER:
PopupOptions.avatarBorders = !PopupOptions.avatarBorders;
- EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders);
+ EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -301,10 +301,10 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM 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);
+ 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;
@@ -318,14 +318,14 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM 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);
+ 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;
@@ -340,24 +340,24 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // 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;
+ {
+ 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;
@@ -366,50 +366,50 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // 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);
- }
+ {
+ int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (maxPop > 0) {
+ PopupOptions.MaxPopups = maxPop;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
- break;
+ }
+ 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);
- }
+ {
+ 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;
+ }
+ 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);
- }
+ {
+ int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (avtRadius <= SETTING_AVTSIZE_MAX / 2) {
+ PopupOptions.avatarRadius = avtRadius;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
- 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);
- }
+ {
+ 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;
+ }
+ 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);
- }
+ {
+ 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;
+ }
+ break;
}
break;
@@ -417,71 +417,71 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // 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);
- }
+ {
+ 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;
+ }
+ 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);
- }
+ {
+ 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;
+ }
+ 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);
- }
+ {
+ 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;
+ }
+ 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 != (int)PopupOptions.FadeIn) {
- SetDlgItemInt(hwnd, idCtrl, PopupOptions.FadeIn, FALSE);
- ErrorMSG(SETTING_FADEINTIME_MIN, SETTING_FADEINTIME_MAX);
- SetFocus((HWND)lParam);
- }
+ {
+ 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 != (int)PopupOptions.FadeIn) {
+ SetDlgItemInt(hwnd, idCtrl, PopupOptions.FadeIn, FALSE);
+ ErrorMSG(SETTING_FADEINTIME_MIN, SETTING_FADEINTIME_MAX);
+ SetFocus((HWND)lParam);
}
- break;
+ }
+ 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 != (int)PopupOptions.FadeOut) {
- SetDlgItemInt(hwnd, idCtrl, PopupOptions.FadeOut, FALSE);
- ErrorMSG(SETTING_FADEOUTTIME_MIN, SETTING_FADEOUTTIME_MAX);
- SetFocus((HWND)lParam);
- }
+ {
+ 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 != (int)PopupOptions.FadeOut) {
+ SetDlgItemInt(hwnd, idCtrl, PopupOptions.FadeOut, FALSE);
+ ErrorMSG(SETTING_FADEOUTTIME_MIN, SETTING_FADEOUTTIME_MAX);
+ SetFocus((HWND)lParam);
}
}
+ }
}
break;
@@ -546,31 +546,31 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA break;
case WM_MOUSEMOVE:
- {
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.dwHoverTime = HOVER_DEFAULT;
- tme.hwndTrack = hwnd;
- _TrackMouseEvent(&tme);
-
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
- if (oldVal != newVal) {
- 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,
- SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
-
- HRGN rgn = CreateRoundRectRgn(0, 0, newVal, newVal, 2 * PopupOptions.avatarRadius, 2 * PopupOptions.avatarRadius);
- SetWindowRgn(hwndBox, rgn, TRUE);
- InvalidateRect(hwndBox, NULL, FALSE);
- oldVal = newVal;
- }
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = hwnd;
+ _TrackMouseEvent(&tme);
+
+ int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ if (oldVal != newVal) {
+ 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,
+ SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+
+ HRGN rgn = CreateRoundRectRgn(0, 0, newVal, newVal, 2 * PopupOptions.avatarRadius, 2 * PopupOptions.avatarRadius);
+ SetWindowRgn(hwndBox, rgn, TRUE);
+ InvalidateRect(hwndBox, NULL, FALSE);
+ oldVal = newVal;
}
- break;
+ }
+ break;
case WM_MOUSELEAVE:
SetWindowRgn(hwndBox, NULL, TRUE);
@@ -595,34 +595,34 @@ LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
case WM_MOUSEMOVE:
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = hwnd;
+ _TrackMouseEvent(&tme);
+
+ int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ if (oldVal != newVal)
{
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.dwHoverTime = HOVER_DEFAULT;
- tme.hwndTrack = hwnd;
- _TrackMouseEvent(&tme);
-
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
- if (oldVal != newVal)
- {
- if (oldVal < 0)
- {
- SetWindowLongPtr(hwndBox, GWLP_USERDATA, 1);
- RECT rc; GetWindowRect(hwnd, &rc);
- SetWindowPos(hwndBox, NULL,
- (rc.left + rc.right - 170) / 2, rc.bottom + 2, 170, 50,
- SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
- SetWindowRgn(hwndBox, NULL, TRUE);
- }
- SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(hwndBox, NULL, newVal, LWA_ALPHA);
-
- oldVal = newVal;
+ if (oldVal < 0)
+ {
+ SetWindowLongPtr(hwndBox, GWLP_USERDATA, 1);
+ RECT rc; GetWindowRect(hwnd, &rc);
+ SetWindowPos(hwndBox, NULL,
+ (rc.left + rc.right - 170) / 2, rc.bottom + 2, 170, 50,
+ SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+ SetWindowRgn(hwndBox, NULL, TRUE);
}
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwndBox, NULL, newVal, LWA_ALPHA);
+
+ oldVal = newVal;
}
- break;
+ }
+ break;
case WM_MOUSELEAVE:
SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
diff --git a/plugins/Popup/src/opt_adv.h b/plugins/Popup/src/opt_adv.h index cadf0c4648..07e6a96617 100644 --- a/plugins/Popup/src/opt_adv.h +++ b/plugins/Popup/src/opt_adv.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 54c98eb7bf..cb5e2c48f6 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //---------------------------------------------------------------------------
// Workaround for MS bug ComboBox_SelectItemData
int ComboBox_SelectItem(HWND hwndCtl, char* data) {
- int i=0;
- for ( i ; i < ComboBox_GetCount(hwndCtl); i++) {
- if (strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i))==0) {
- ComboBox_SetCurSel (hwndCtl,i);
+ int i = 0;
+ for (i; i < ComboBox_GetCount(hwndCtl); i++) {
+ if (mir_strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i)) == 0) {
+ ComboBox_SetCurSel(hwndCtl, i);
return i;
}
}
@@ -45,69 +45,69 @@ struct { BYTE onTyp1;
BYTE onTyp2;
}
-static ctrlsAll[] = {
- {IDC_TXT_TITLE1 ,0 ,1 ,1},
- {IDC_ENABLE ,0 ,1 ,1},
-
- {IDC_TXT_TIMEOUT ,0 ,1 ,1},
- {IDC_TIMEOUT ,0 ,1 ,1},
- {IDC_TIMEOUT_SPIN ,0 ,1 ,1},
- {IDC_TXT_TIMEOUT_SEC ,0 ,1 ,1},
- {IDC_TXT_TIMEOUT_DEFAULT ,0 ,1 ,1},
- {IDC_TXT_TIMEOUT_INFINITE ,0 ,1 ,1},
-
- {IDC_TXT_LACTION ,0 ,1 ,1},
- {IDC_LACTION ,0 ,1 ,1},
-
- {IDC_TXT_RACTION ,0 ,1 ,1},
- {IDC_RACTION ,0 ,1 ,1},
-
- {IDC_CHECKWINDOW ,0 ,0 ,0}, // may be delete ??
-
- {IDC_TXT_TITLE3 ,0 ,1 ,0},
- {IDC_SOFFLINE ,0 ,1 ,0},
- {IDC_SONLINE ,0 ,1 ,0},
- {IDC_SAWAY ,0 ,1 ,0},
- {IDC_SNA ,0 ,1 ,0},
- {IDC_SOCCUPIED ,0 ,1 ,0},
- {IDC_SDND ,0 ,1 ,0},
- {IDC_SFREE4CHAT ,0 ,1 ,0},
- {IDC_SINVISIBLE ,0 ,1 ,0},
- {IDC_SPHONE ,0 ,1 ,0},
- {IDC_SLUNCH ,0 ,1 ,0},
-
- {IDC_TXT_TITLE4 ,0 ,0 ,0},
- {IDC_SOFFLINE2 ,0 ,0 ,0},
- {IDC_SONLINE2 ,0 ,0 ,0},
- {IDC_SAWAY2 ,0 ,0 ,0},
- {IDC_SNA2 ,0 ,0 ,0},
- {IDC_SOCCUPIED2 ,0 ,0 ,0},
- {IDC_SDND2 ,0 ,0 ,0},
- {IDC_SFREE4CHAT2 ,0 ,0 ,0},
- {IDC_SINVISIBLE2 ,0 ,0 ,0},
- {IDC_SPHONE2 ,0 ,0 ,0},
- {IDC_SLUNCH2 ,0 ,0 ,0},
-
- {IDC_ICO_INFO ,0 ,1 ,1},
- {IDC_TXT_COLORS ,0 ,1 ,1},
- {IDC_MORE ,0 ,1 ,1},
-
- {IDC_PREVIEW ,0 ,1 ,1},
+static ctrlsAll[] = {
+ { IDC_TXT_TITLE1, 0, 1, 1 },
+ { IDC_ENABLE, 0, 1, 1 },
+
+ { IDC_TXT_TIMEOUT, 0, 1, 1 },
+ { IDC_TIMEOUT, 0, 1, 1 },
+ { IDC_TIMEOUT_SPIN, 0, 1, 1 },
+ { IDC_TXT_TIMEOUT_SEC, 0, 1, 1 },
+ { IDC_TXT_TIMEOUT_DEFAULT, 0, 1, 1 },
+ { IDC_TXT_TIMEOUT_INFINITE, 0, 1, 1 },
+
+ { IDC_TXT_LACTION, 0, 1, 1 },
+ { IDC_LACTION, 0, 1, 1 },
+
+ { IDC_TXT_RACTION, 0, 1, 1 },
+ { IDC_RACTION, 0, 1, 1 },
+
+ { IDC_CHECKWINDOW, 0, 0, 0 }, // may be delete ??
+
+ { IDC_TXT_TITLE3, 0, 1, 0 },
+ { IDC_SOFFLINE, 0, 1, 0 },
+ { IDC_SONLINE, 0, 1, 0 },
+ { IDC_SAWAY, 0, 1, 0 },
+ { IDC_SNA, 0, 1, 0 },
+ { IDC_SOCCUPIED, 0, 1, 0 },
+ { IDC_SDND, 0, 1, 0 },
+ { IDC_SFREE4CHAT, 0, 1, 0 },
+ { IDC_SINVISIBLE, 0, 1, 0 },
+ { IDC_SPHONE, 0, 1, 0 },
+ { IDC_SLUNCH, 0, 1, 0 },
+
+ { IDC_TXT_TITLE4, 0, 0, 0 },
+ { IDC_SOFFLINE2, 0, 0, 0 },
+ { IDC_SONLINE2, 0, 0, 0 },
+ { IDC_SAWAY2, 0, 0, 0 },
+ { IDC_SNA2, 0, 0, 0 },
+ { IDC_SOCCUPIED2, 0, 0, 0 },
+ { IDC_SDND2, 0, 0, 0 },
+ { IDC_SFREE4CHAT2, 0, 0, 0 },
+ { IDC_SINVISIBLE2, 0, 0, 0 },
+ { IDC_SPHONE2, 0, 0, 0 },
+ { IDC_SLUNCH2, 0, 0, 0 },
+
+ { IDC_ICO_INFO, 0, 1, 1 },
+ { IDC_TXT_COLORS, 0, 1, 1 },
+ { IDC_MORE, 0, 1, 1 },
+
+ { IDC_PREVIEW, 0, 1, 1 },
};
-static UINT ctrlsClass[] = {
+static UINT ctrlsClass[] = {
IDC_TXT_TITLE1, /*IDC_TXT_TITLE3,*/
- IDC_TXT_TIMEOUT, IDC_TIMEOUT,
- IDC_TIMEOUT_SPIN, IDC_TXT_TIMEOUT_SEC,
+ IDC_TXT_TIMEOUT, IDC_TIMEOUT,
+ IDC_TIMEOUT_SPIN, IDC_TXT_TIMEOUT_SEC,
IDC_TXT_TIMEOUT_DEFAULT, IDC_TXT_TIMEOUT_INFINITE,
- IDC_TXT_LACTION, IDC_LACTION,
- IDC_TXT_RACTION, IDC_RACTION,
- IDC_ICO_INFO, IDC_TXT_COLORS,
+ IDC_TXT_LACTION, IDC_LACTION,
+ IDC_TXT_RACTION, IDC_RACTION,
+ IDC_ICO_INFO, IDC_TXT_COLORS,
};
-static UINT ctrlsEnable[] = {
- IDC_TXT_TIMEOUT, IDC_TIMEOUT, IDC_TIMEOUT_SPIN,
- IDC_TXT_TIMEOUT_SEC , IDC_TXT_TIMEOUT_DEFAULT, IDC_TXT_TIMEOUT_INFINITE,
+static UINT ctrlsEnable[] = {
+ IDC_TXT_TIMEOUT, IDC_TIMEOUT, IDC_TIMEOUT_SPIN,
+ IDC_TXT_TIMEOUT_SEC, IDC_TXT_TIMEOUT_DEFAULT, IDC_TXT_TIMEOUT_INFINITE,
IDC_TXT_LACTION, IDC_LACTION,
IDC_TXT_RACTION, IDC_RACTION,
/*IDC_CHECKWINDOW,*/ IDC_TXT_TITLE3, IDC_TXT_TITLE4,
@@ -122,7 +122,7 @@ static UINT ctrlsEnable[] = { IDC_SINVISIBLE2, IDC_SPHONE2, IDC_SLUNCH2,
};
-static UINT ctrlsContact[] = {
+static UINT ctrlsContact[] = {
/*IDC_CHECKWINDOW,*/ IDC_TXT_TITLE4,
IDC_SOFFLINE2, IDC_SONLINE2, IDC_SAWAY2, IDC_SNA2,
IDC_SOCCUPIED2, IDC_SDND2, IDC_SFREE4CHAT2,
@@ -143,36 +143,36 @@ struct { DWORD disableWhenFlag;
}
static statusButtons[] = {
- {IDC_SOFFLINE, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE},
- {IDC_SONLINE, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE},
- {IDC_SAWAY, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY},
- {IDC_SNA, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY},
- {IDC_SOCCUPIED, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND},
- {IDC_SDND, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND},
- {IDC_SFREE4CHAT, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT},
- {IDC_SINVISIBLE, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE},
- {IDC_SPHONE, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE},
- {IDC_SLUNCH, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH},
-
- {IDC_SOFFLINE2, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE<<16},
- {IDC_SONLINE2, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE<<16},
- {IDC_SAWAY2, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY<<16},
- {IDC_SNA2, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY<<16},
- {IDC_SOCCUPIED2, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND<<16},
- {IDC_SDND2, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND<<16},
- {IDC_SFREE4CHAT2, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT<<16},
- {IDC_SINVISIBLE2, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE<<16},
- {IDC_SPHONE2, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE<<16},
- {IDC_SLUNCH2, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH<<16},
+ { IDC_SOFFLINE, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE },
+ { IDC_SONLINE, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE },
+ { IDC_SAWAY, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY },
+ { IDC_SNA, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY },
+ { IDC_SOCCUPIED, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND },
+ { IDC_SDND, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND },
+ { IDC_SFREE4CHAT, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT },
+ { IDC_SINVISIBLE, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE },
+ { IDC_SPHONE, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE },
+ { IDC_SLUNCH, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH },
+
+ { IDC_SOFFLINE2, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE << 16 },
+ { IDC_SONLINE2, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE << 16 },
+ { IDC_SAWAY2, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY << 16 },
+ { IDC_SNA2, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY << 16 },
+ { IDC_SOCCUPIED2, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND << 16 },
+ { IDC_SDND2, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND << 16 },
+ { IDC_SFREE4CHAT2, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT << 16 },
+ { IDC_SINVISIBLE2, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE << 16 },
+ { IDC_SPHONE2, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE << 16 },
+ { IDC_SLUNCH2, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH << 16 },
};
INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int i;
- switch ( msg ) {
+ switch (msg) {
case WM_INITDIALOG:
- TranslateDialogDefault( hwnd );
+ TranslateDialogDefault(hwnd);
{
// Treeview
HWND hwndTree = GetDlgItem(hwnd, IDC_TREE1);
@@ -182,11 +182,11 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l TCHAR itemName[MAXMODULELABELLENGTH];
TreeView_DeleteAllItems(hwndTree);
// Treeview create image list
- HIMAGELIST hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR|ILC_COLOR32|ILC_MASK, 5, num_classes+1);
- ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(ICO_OPT_GROUP,0));
+ HIMAGELIST hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, num_classes + 1);
+ ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(ICO_OPT_GROUP, 0));
TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
- for (i=0; i < gTreeData.getCount(); ++i) {
+ for (i = 0; i < gTreeData.getCount(); ++i) {
switch (gTreeData[i]->typ) {
case 1: // Treeview part for typ 1 (notification)
mir_snprintf(iconName, SIZEOF(iconName), "%s_%S_%S", MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l // spindown for Timeout
SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_INFINITE));
- SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)0, TRUE);
+ SetDlgItemInt(hwnd, IDC_TIMEOUT, (UINT)0, TRUE);
// status buttons
for (i = 0; i < SIZEOF(statusButtons); ++i) {
SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONSETASFLATBTN, TRUE, 0);
@@ -223,7 +223,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l (WPARAM)Translate(statusButtons[i].title), 0);
}
// info icon
- SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY,0), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY, 0), 0);
// more button
EnableWindow(GetDlgItem(hwnd, IDC_MORE), FALSE);
// preview button
@@ -234,216 +234,216 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l return TRUE;
case WM_USER:
- {
- HWND hTV = GetDlgItem(hwnd, IDC_TREE1);
- // get TreeView selection
- TVITEM tvi = { 0 };
- tvi.hItem = TreeView_GetSelection(hTV);
- tvi.mask = TVIF_PARAM|TVIF_HANDLE|TVIF_TEXT;
- if (tvi.hItem) TreeView_GetItem(hTV, &tvi);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, tvi.lParam);
-
- if (tvi.lParam) {
- POPUPTREEDATA* ptd = (POPUPTREEDATA *)tvi.lParam;
- // combo left action (default)
-
- HWND hCtrl = GetDlgItem(hwnd, IDC_LACTION);
- ComboBox_ResetContent(hCtrl);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
-
- // combo right action (default)
+ {
+ HWND hTV = GetDlgItem(hwnd, IDC_TREE1);
+ // get TreeView selection
+ TVITEM tvi = { 0 };
+ tvi.hItem = TreeView_GetSelection(hTV);
+ tvi.mask = TVIF_PARAM | TVIF_HANDLE | TVIF_TEXT;
+ if (tvi.hItem) TreeView_GetItem(hTV, &tvi);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, tvi.lParam);
+
+ if (tvi.lParam) {
+ POPUPTREEDATA* ptd = (POPUPTREEDATA *)tvi.lParam;
+ // combo left action (default)
+
+ HWND hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ ComboBox_ResetContent(hCtrl);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)), POPUP_ACTION_DISMISS);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)), POPUP_ACTION_NOTHING);
+
+ // combo right action (default)
+ hCtrl = GetDlgItem(hwnd, IDC_RACTION);
+ ComboBox_ResetContent(hCtrl);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)), POPUP_ACTION_DISMISS);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)), POPUP_ACTION_NOTHING);
+
+ // element typ1 (Notification)
+ if (ptd->typ == 1) {
+ LPTSTR psztAction = NULL;
+ // Timeout
+ SetDlgItemInt(hwnd, IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
+ SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
+ // combo left action (EXTRA)
+ hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ for (i = 0; i < ptd->notification.actionCount; ++i) {
+ psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
+ mir_free(psztAction); psztAction = NULL;
+ }
+ // combo right action (EXTRA)
hCtrl = GetDlgItem(hwnd, IDC_RACTION);
- ComboBox_ResetContent(hCtrl);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
-
- // element typ1 (Notification)
- if (ptd->typ == 1) {
- LPTSTR psztAction = NULL;
- // Timeout
- SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
- SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
- // combo left action (EXTRA)
- hCtrl = GetDlgItem(hwnd, IDC_LACTION);
- for (i = 0; i < ptd->notification.actionCount; ++i) {
- psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
- mir_free(psztAction); psztAction = NULL;
- }
- // combo right action (EXTRA)
- hCtrl = GetDlgItem(hwnd, IDC_RACTION);
- psztAction = NULL;
- for (i = 0; i < ptd->notification.actionCount; ++i) {
- psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
- mir_free(psztAction); psztAction = NULL;
- }
- // enable all controls
- for (i = 0; i < SIZEOF(ctrlsAll); ++i){
- ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1 ? SW_SHOW : SW_HIDE);
- EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1);
- }
- // enable or disable controls ctrlsEnable
- for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
- EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled ? TRUE : FALSE);
- // show or hide controls ctrlsContact
- for (i = 0; i < SIZEOF(ctrlsContact); ++i)
- ShowWindow(GetDlgItem(hwnd, ctrlsContact[i]), ptd->notification.dwFlags&PNF_CONTACT ? SW_SHOW : SW_HIDE);
- // statusButtons state
- for (i = 0; i < SIZEOF(statusButtons); ++i)
- CheckDlgButton(hwnd, statusButtons[i].idCtrl, ptd->disableWhen & statusButtons[i].disableWhenFlag ? BST_CHECKED : BST_UNCHECKED);
+ psztAction = NULL;
+ for (i = 0; i < ptd->notification.actionCount; ++i) {
+ psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
+ mir_free(psztAction); psztAction = NULL;
}
- // element typ2 (CLASS Plugins)
- else if (ptd->typ == 2) {
- // Timeout
- SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
- SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
- // enable ctrls
- for (i = 0; i < SIZEOF(ctrlsAll); ++i){
- ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2 ? SW_SHOW : SW_HIDE);
- EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2);
- }
+ // enable all controls
+ for (i = 0; i < SIZEOF(ctrlsAll); ++i){
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1);
}
- // checkbox enable notify
- CheckDlgButton(hwnd, IDC_ENABLE, ptd->enabled ? BST_CHECKED : BST_UNCHECKED);
- // combo left action (SELECT)
- hCtrl = GetDlgItem(hwnd, IDC_LACTION);
- ComboBox_SelectItem (hCtrl, ptd->leftAction); // use Workaround for MS bug ComboBox_SelectItemData
- // combo right action (SELECT)
- hCtrl = GetDlgItem(hwnd, IDC_RACTION);
- ComboBox_SelectItem (hCtrl, ptd->rightAction); // use Workaround for MS bug ComboBox_SelectItemData
- } // end if (tvi.lParam)
- else {
- // enable / disable controls
- for (int i=0; i < SIZEOF(ctrlsAll); ++i) {
- ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0 ? SW_SHOW : SW_HIDE);
- EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0);
+ // enable or disable controls ctrlsEnable
+ for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
+ EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled ? TRUE : FALSE);
+ // show or hide controls ctrlsContact
+ for (i = 0; i < SIZEOF(ctrlsContact); ++i)
+ ShowWindow(GetDlgItem(hwnd, ctrlsContact[i]), ptd->notification.dwFlags&PNF_CONTACT ? SW_SHOW : SW_HIDE);
+ // statusButtons state
+ for (i = 0; i < SIZEOF(statusButtons); ++i)
+ CheckDlgButton(hwnd, statusButtons[i].idCtrl, ptd->disableWhen & statusButtons[i].disableWhenFlag ? BST_CHECKED : BST_UNCHECKED);
+ }
+ // element typ2 (CLASS Plugins)
+ else if (ptd->typ == 2) {
+ // Timeout
+ SetDlgItemInt(hwnd, IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
+ SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
+ // enable ctrls
+ for (i = 0; i < SIZEOF(ctrlsAll); ++i){
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2);
}
}
+ // checkbox enable notify
+ CheckDlgButton(hwnd, IDC_ENABLE, ptd->enabled ? BST_CHECKED : BST_UNCHECKED);
+ // combo left action (SELECT)
+ hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ ComboBox_SelectItem(hCtrl, ptd->leftAction); // use Workaround for MS bug ComboBox_SelectItemData
+ // combo right action (SELECT)
+ hCtrl = GetDlgItem(hwnd, IDC_RACTION);
+ ComboBox_SelectItem(hCtrl, ptd->rightAction); // use Workaround for MS bug ComboBox_SelectItemData
+ } // end if (tvi.lParam)
+ else {
+ // enable / disable controls
+ for (int i = 0; i < SIZEOF(ctrlsAll); ++i) {
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0);
+ }
}
- break;
+ }
+ break;
case WM_COMMAND:
- {
- UINT idCtrl = LOWORD(wParam);
- POPUPTREEDATA* ptd = (POPUPTREEDATA *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (!ptd) break;
- switch (HIWORD(wParam)) {
- case BN_CLICKED: // Button controls
- switch(idCtrl) {
- case IDC_ENABLE:
- ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
- for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
- EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled);
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_PREVIEW:
- {
- POPUPDATA2 ppd = {0};
- ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
- ppd.lptzTitle = ptd->pszDescription;
- ppd.lptzText = TranslateT("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!");
- ppd.iSeconds = ptd->timeoutValue;
- ppd.colorBack = ptd->colorBack;
- ppd.colorText = ptd->colorText;
- POPUPTREEDATA *ptdPrev = NULL;
- if (ptd->typ == 1) {
- // we work with a copy for preview
- ptdPrev = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
- memcpy(ptdPrev, ptd, sizeof(POPUPTREEDATA));
- ptdPrev->enabled = ptd->enabled;
- ptdPrev->timeoutValue = ptd->timeoutValue;
- strcpy(ptdPrev->leftAction, ptd->leftAction); // geht noch nicht??
- strcpy(ptdPrev->rightAction, ptd->rightAction); // geht noch nicht??
- ptdPrev->disableWhen = ptd->disableWhen;
-
- ppd.lchNotification = (HANDLE)ptdPrev;
- }
- else if (ptd->typ == 2)
- ppd.lchIcon = ptd->pupClass.hIcon;
-
- CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
- mir_free(ptdPrev); ptdPrev = NULL;
- }
- break;
- case IDC_MORE:
- {
- OPENOPTIONSDIALOG ood = { sizeof(ood) };
- ood.pszGroup = "Customize";
- ood.pszPage = "Fonts and colors";
- Options_Open(&ood);
- }
- break;
-
- case IDC_SOFFLINE: case IDC_SONLINE: case IDC_SAWAY: case IDC_SNA: case IDC_SOCCUPIED:
- case IDC_SDND: case IDC_SFREE4CHAT: case IDC_SINVISIBLE: case IDC_SPHONE: case IDC_SLUNCH:
- case IDC_SOFFLINE2: case IDC_SONLINE2: case IDC_SAWAY2: case IDC_SNA2: case IDC_SOCCUPIED2:
- case IDC_SDND2: case IDC_SFREE4CHAT2: case IDC_SINVISIBLE2: case IDC_SPHONE2: case IDC_SLUNCH2:
- ptd->disableWhen = 0;
- for (i = 0; i < SIZEOF(statusButtons); ++i) {
- if (IsDlgButtonChecked(hwnd, statusButtons[i].idCtrl))
- ptd->disableWhen |= statusButtons[i].disableWhenFlag;
- if (idCtrl == (UINT)statusButtons[i].idCtrl)
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
+ {
+ UINT idCtrl = LOWORD(wParam);
+ POPUPTREEDATA* ptd = (POPUPTREEDATA *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (!ptd) break;
+ switch (HIWORD(wParam)) {
+ case BN_CLICKED: // Button controls
+ switch (idCtrl) {
+ case IDC_ENABLE:
+ ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
+ for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
+ EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
- case CBN_SELCHANGE: // ComboBox controls
- switch(idCtrl) {
- case IDC_LACTION:
- mir_strncpy(ptd->leftAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->leftAction));
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- case IDC_RACTION:
- mir_strncpy(ptd->rightAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->rightAction));
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
+ case IDC_PREVIEW:
+ {
+ POPUPDATA2 ppd = { 0 };
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+ ppd.lptzTitle = ptd->pszDescription;
+ ppd.lptzText = TranslateT("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!");
+ ppd.iSeconds = ptd->timeoutValue;
+ ppd.colorBack = ptd->colorBack;
+ ppd.colorText = ptd->colorText;
+ POPUPTREEDATA *ptdPrev = NULL;
+ if (ptd->typ == 1) {
+ // we work with a copy for preview
+ ptdPrev = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
+ memcpy(ptdPrev, ptd, sizeof(POPUPTREEDATA));
+ ptdPrev->enabled = ptd->enabled;
+ ptdPrev->timeoutValue = ptd->timeoutValue;
+ mir_strcpy(ptdPrev->leftAction, ptd->leftAction); // geht noch nicht??
+ mir_strcpy(ptdPrev->rightAction, ptd->rightAction); // geht noch nicht??
+ ptdPrev->disableWhen = ptd->disableWhen;
+
+ ppd.lchNotification = (HANDLE)ptdPrev;
}
- break;
+ else if (ptd->typ == 2)
+ ppd.lchIcon = ptd->pupClass.hIcon;
+
+ CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
+ mir_free(ptdPrev); ptdPrev = NULL;
+ }
+ break;
+ case IDC_MORE:
+ {
+ OPENOPTIONSDIALOG ood = { sizeof(ood) };
+ ood.pszGroup = "Customize";
+ ood.pszPage = "Fonts and colors";
+ Options_Open(&ood);
+ }
+ break;
- case EN_CHANGE: // Edit controls
- switch(idCtrl) {
- case IDC_TIMEOUT:
- int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
- if (seconds >= SETTING_LIFETIME_INFINITE && seconds <= SETTING_LIFETIME_MAX && seconds != ptd->timeoutValue) {
- ptd->timeoutValue = seconds;
+ case IDC_SOFFLINE: case IDC_SONLINE: case IDC_SAWAY: case IDC_SNA: case IDC_SOCCUPIED:
+ case IDC_SDND: case IDC_SFREE4CHAT: case IDC_SINVISIBLE: case IDC_SPHONE: case IDC_SLUNCH:
+ case IDC_SOFFLINE2: case IDC_SONLINE2: case IDC_SAWAY2: case IDC_SNA2: case IDC_SOCCUPIED2:
+ case IDC_SDND2: case IDC_SFREE4CHAT2: case IDC_SINVISIBLE2: case IDC_SPHONE2: case IDC_SLUNCH2:
+ ptd->disableWhen = 0;
+ for (i = 0; i < SIZEOF(statusButtons); ++i) {
+ if (IsDlgButtonChecked(hwnd, statusButtons[i].idCtrl))
+ ptd->disableWhen |= statusButtons[i].disableWhenFlag;
+ if (idCtrl == (UINT)statusButtons[i].idCtrl)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
}
+ }
+ break;
+
+ case CBN_SELCHANGE: // ComboBox controls
+ switch (idCtrl) {
+ case IDC_LACTION:
+ mir_strncpy(ptd->leftAction,
+ (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ sizeof(ptd->leftAction));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
+ case IDC_RACTION:
+ mir_strncpy(ptd->rightAction,
+ (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ sizeof(ptd->rightAction));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
- case EN_KILLFOCUS: // Edit controls lost fokus
- switch(idCtrl) {
- case IDC_TIMEOUT:
- int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
- if (seconds > SETTING_LIFETIME_MAX)
- ptd->timeoutValue = SETTING_LIFETIME_MAX;
- else if (seconds < SETTING_LIFETIME_INFINITE)
- ptd->timeoutValue = SETTING_LIFETIME_INFINITE;
- if (seconds != ptd->timeoutValue) {
- SetDlgItemInt(hwnd, idCtrl, ptd->timeoutValue, TRUE);
- ErrorMSG(SETTING_LIFETIME_INFINITE, SETTING_LIFETIME_MAX);
- SetFocus((HWND)lParam);
- }
+ case EN_CHANGE: // Edit controls
+ switch (idCtrl) {
+ case IDC_TIMEOUT:
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
+ if (seconds >= SETTING_LIFETIME_INFINITE && seconds <= SETTING_LIFETIME_MAX && seconds != ptd->timeoutValue) {
+ ptd->timeoutValue = seconds;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+
+ case EN_KILLFOCUS: // Edit controls lost fokus
+ switch (idCtrl) {
+ case IDC_TIMEOUT:
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
+ if (seconds > SETTING_LIFETIME_MAX)
+ ptd->timeoutValue = SETTING_LIFETIME_MAX;
+ else if (seconds < SETTING_LIFETIME_INFINITE)
+ ptd->timeoutValue = SETTING_LIFETIME_INFINITE;
+ if (seconds != ptd->timeoutValue) {
+ SetDlgItemInt(hwnd, idCtrl, ptd->timeoutValue, TRUE);
+ ErrorMSG(SETTING_LIFETIME_INFINITE, SETTING_LIFETIME_MAX);
+ SetFocus((HWND)lParam);
}
}
}
- break;
+ }
+ break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_RESET:
- for(i=0; i < gTreeData.getCount(); ++i) {
+ for (i = 0; i < gTreeData.getCount(); ++i) {
switch (gTreeData[i]->typ) {
case 1:
LoadNotificationSettings(gTreeData[i], "PopupNotifications");
@@ -457,15 +457,15 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l return TRUE;
case PSN_APPLY:
- for(i=0; i < gTreeData.getCount(); ++i) {
+ for (i = 0; i < gTreeData.getCount(); ++i) {
switch (gTreeData[i]->typ) {
case 1:
- gTreeData[i]->notification.iSeconds = gTreeData[i]->timeoutValue;
- SaveNotificationSettings(gTreeData[i],"PopupNotifications");
+ gTreeData[i]->notification.iSeconds = gTreeData[i]->timeoutValue;
+ SaveNotificationSettings(gTreeData[i], "PopupNotifications");
break;
case 2: // not finish
gTreeData[i]->pupClass.iSeconds = gTreeData[i]->timeoutValue;
- SaveClassSettings(gTreeData[i],"PopupCLASS");
+ SaveClassSettings(gTreeData[i], "PopupCLASS");
break;
}
}
@@ -487,21 +487,21 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
- char setting[2*MAXMODULELABELLENGTH];
+ char setting[2 * MAXMODULELABELLENGTH];
char *szTmp = NULL;
mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
- ptd->enabled =
+ ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
- ptd->pupClass.iSeconds =
+ ptd->pupClass.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, 0);
mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
- ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
+ ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
@@ -516,7 +516,7 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) }
void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
- char setting[2*MAXMODULELABELLENGTH];
+ char setting[2 * MAXMODULELABELLENGTH];
mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
db_set_b(NULL, szModul, setting, ptd->enabled);
@@ -524,12 +524,12 @@ void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->pupClass.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, SIZEOF(setting), "%s/leftAction",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, SIZEOF(setting), "%s/rightAction",ptd->pupClass.pszName);
+ mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
}
diff --git a/plugins/Popup/src/opt_class.h b/plugins/Popup/src/opt_class.h index 6f6e3557aa..407dcf743e 100644 --- a/plugins/Popup/src/opt_class.h +++ b/plugins/Popup/src/opt_class.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 59532d3325..31041c357a 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -46,17 +46,17 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
- SendDlgItemMessage(hwnd, IDC_ICO_AUTO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_FAVORITE, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_FULLSCREEN, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_AUTO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_FAVORITE, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_FULLSCREEN, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN, 0), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK, 0), 0);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5);
ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_DEF,0));
- ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FAV,0));
- ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0));
- ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_BLOCK,0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_DEF, 0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FAV, 0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FULLSCREEN, 0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_BLOCK, 0));
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*SIZEOF(sttIcons)*/, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
@@ -65,31 +65,31 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_LIST:
switch (((LPNMHDR)lParam)->code) {
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
- sttSetAllContactIcons(GetDlgItem(hwnd,IDC_LIST));
+ sttSetAllContactIcons(GetDlgItem(hwnd, IDC_LIST));
break;
case CLN_OPTIONSCHANGED:
- sttResetListOptions(GetDlgItem(hwnd,IDC_LIST));
+ sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
break;
case NM_CLICK:
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
- if (nm->iColumn==-1) 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;
+ 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));
+ 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)
+ 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));
+ // 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);
}
@@ -101,8 +101,8 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) HWND hwndList = GetDlgItem(hwnd, IDC_LIST);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
- for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i) {
- if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0))) {
+ for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i) {
+ if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0))) {
db_set_b(hContact, MODULNAME, "ShowMode", i);
break;
}
diff --git a/plugins/Popup/src/opt_contacts.h b/plugins/Popup/src/opt_contacts.h index d6023b6063..f65e495466 100644 --- a/plugins/Popup/src/opt_contacts.h +++ b/plugins/Popup/src/opt_contacts.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Popup/src/opt_gen.h b/plugins/Popup/src/opt_gen.h index 6a5c037b38..c0bd009a6e 100644 --- a/plugins/Popup/src/opt_gen.h +++ b/plugins/Popup/src/opt_gen.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 409e906ab4..c4bfb60fba 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -73,11 +73,11 @@ static void updatePreviewImage(HWND hwndBox) POPUPDATA2 ppd;
memset(&ppd, 0, sizeof(ppd));
- ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
- ppd.lchIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE);
- ppd.lptzTitle = TranslateT("Skin preview");
- ppd.lptzText = TranslateT("Just take a look at this skin... ;)");
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+ ppd.lchIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE);
+ ppd.lptzTitle = TranslateT("Skin preview");
+ ppd.lptzText = TranslateT("Just take a look at this skin... ;)");
POPUPOPTIONS customOptions = PopupOptions;
customOptions.DynamicResize = FALSE;
@@ -180,18 +180,18 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos if (!skin->getFlagName(i))
continue;
*OptionsCount += 1;
- options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
- options[pos].dwFlag = (DWORD)(1 << (i-1));
- options[pos].groupId = OPTTREE_CHECK;
- options[pos].iconIndex = 0;
- options[pos].pszSettingName = mir_tstrdup(_T("Skin options"));
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
- mir_tstrlen(options[pos].pszSettingName)+
- mir_strlen(skin->getFlagName(i)) +10 ));
+ options = (OPTTREE_OPTION*)mir_realloc(options, sizeof(OPTTREE_OPTION)*(*OptionsCount));
+ options[pos].dwFlag = (DWORD)(1 << (i - 1));
+ options[pos].groupId = OPTTREE_CHECK;
+ options[pos].iconIndex = 0;
+ options[pos].pszSettingName = mir_tstrdup(_T("Skin options"));
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ mir_tstrlen(options[pos].pszSettingName) +
+ mir_strlen(skin->getFlagName(i)) + 10));
wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
- options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
- options[pos].Data = i; // skin flag index
- *dwGlobalOptions |= skin->getFlag(i) ? (1 << (i-1)) : 0;
+ options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
+ options[pos].Data = i; // skin flag index
+ *dwGlobalOptions |= skin->getFlag(i) ? (1 << (i - 1)) : 0;
pos++;
}
}
@@ -200,17 +200,17 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos /////////////////////////////////////////////////////////////////////////////////////////
-static LPTSTR mainOption [] = {
+static LPTSTR mainOption[] = {
LPGENT("Show clock"),
LPGENT("Drop shadow effect"),
LPGENT("Drop shadow effect")_T("/")LPGENT("non rectangular"),
LPGENT("Enable Aero Glass (Vista+)"),
LPGENT("Use Windows colors"),
- LPGENT("Use advanced text render")};
+ LPGENT("Use advanced text render") };
int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions)
{
- for (int i=0; i < SIZEOF(mainOption); i++) {
+ for (int i = 0; i < SIZEOF(mainOption); i++) {
BOOL bCheck = 0;
switch (i) {
case 0:
@@ -241,26 +241,26 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, break;
}
*OptionsCount += 1;
- options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
- options[pos].dwFlag = (1 << i);
- options[pos].groupId = OPTTREE_CHECK;
- options[pos].iconIndex = 0;
+ options = (OPTTREE_OPTION*)mir_realloc(options, sizeof(OPTTREE_OPTION)*(*OptionsCount));
+ options[pos].dwFlag = (1 << i);
+ options[pos].groupId = OPTTREE_CHECK;
+ options[pos].iconIndex = 0;
options[pos].pszSettingName = mir_tstrdup(LPGENT("Global settings"));
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
- mir_tstrlen(options[pos].pszSettingName)+
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ mir_tstrlen(options[pos].pszSettingName) +
mir_tstrlen(mainOption[i]) + 10));
wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
- options[pos].bState = bCheck;
+ options[pos].bState = bCheck;
pos++;
}
return pos;
}
-bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hwndDlg) {
+bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwndDlg) {
if (options) {
int index = -1;
OptTree_ProcessMessage(hwndDlg, WM_DESTROY, 0, 0, &index, IDC_SKIN_LIST_OPT, options, *OptionsCount);
- for (int i=0; i < *OptionsCount; ++i) {
+ for (int i = 0; i < *OptionsCount; ++i) {
mir_free(options[i].pszOptionName);
mir_free(options[i].pszSettingName);
}
@@ -280,7 +280,7 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw // check "Skin options" state
char prefix[128];
- mir_snprintf(prefix, SIZEOF(prefix),"skin.%S", PopupOptions.SkinPack);
+ mir_snprintf(prefix, SIZEOF(prefix), "skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
@@ -293,14 +293,14 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw void LoadOption_Skins() {
// skin pack
- PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "SkinPack", "* Popup Classic",DBVT_TCHAR);
+ PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "SkinPack", "* Popup Classic", DBVT_TCHAR);
// more Skin options
- PopupOptions.DisplayTime = db_get_b(NULL,MODULNAME, "DisplayTime", TRUE);
- PopupOptions.DropShadow = db_get_b(NULL,MODULNAME, "DropShadow", TRUE);
- PopupOptions.EnableFreeformShadows = db_get_b(NULL,MODULNAME, "EnableShadowRegion", 1);
- PopupOptions.EnableAeroGlass = db_get_b(NULL,MODULNAME, "EnableAeroGlass", 1);
- PopupOptions.UseWinColors = db_get_b(NULL,MODULNAME, "UseWinColors", FALSE);
- PopupOptions.UseMText = db_get_b(NULL,MODULNAME, "UseMText", TRUE);
+ PopupOptions.DisplayTime = db_get_b(NULL, MODULNAME, "DisplayTime", TRUE);
+ PopupOptions.DropShadow = db_get_b(NULL, MODULNAME, "DropShadow", TRUE);
+ PopupOptions.EnableFreeformShadows = db_get_b(NULL, MODULNAME, "EnableShadowRegion", 1);
+ PopupOptions.EnableAeroGlass = db_get_b(NULL, MODULNAME, "EnableAeroGlass", 1);
+ PopupOptions.UseWinColors = db_get_b(NULL, MODULNAME, "UseWinColors", FALSE);
+ PopupOptions.UseMText = db_get_b(NULL, MODULNAME, "UseMText", TRUE);
}
INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -322,22 +322,22 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
else if (mir_tstrcmp(skinOptions[index].pszSettingName, _T("Global settings")) == 0) {
switch (skinOptions[index].dwFlag) {
- case (1 << 0):
+ case (1 << 0) :
PopupOptions.DisplayTime = skinOptions[index].bState;
break;
- case (1 << 1):
+ case (1 << 1) :
PopupOptions.DropShadow = skinOptions[index].bState;
break;
- case (1 << 2):
+ case (1 << 2) :
PopupOptions.EnableFreeformShadows = skinOptions[index].bState;
break;
- case (1 << 3):
+ case (1 << 3) :
PopupOptions.EnableAeroGlass = skinOptions[index].bState;
break;
- case (1 << 4):
+ case (1 << 4) :
PopupOptions.UseWinColors = skinOptions[index].bState;
break;
- case (1 << 5):
+ case (1 << 5) :
PopupOptions.UseMText = skinOptions[index].bState;
break;
}
@@ -349,127 +349,127 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR switch (msg) {
case WM_INITDIALOG:
- {
- HWND hCtrl = NULL;
- DWORD dwIndex = 0;
+ {
+ HWND hCtrl = NULL;
+ DWORD dwIndex = 0;
- // Skin List
- hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
- ListBox_ResetContent(hCtrl);
- for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
- {
- dwIndex = ListBox_AddString(hCtrl, sl->name);
- ListBox_SetItemData(hCtrl, dwIndex, sl->name);
- }
- ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
+ // Skin List
+ hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
+ ListBox_ResetContent(hCtrl);
+ for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
+ {
+ dwIndex = ListBox_AddString(hCtrl, sl->name);
+ ListBox_SetItemData(hCtrl, dwIndex, sl->name);
+ }
+ ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
- // Skin List reload button
- SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0));
- SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
+ // Skin List reload button
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD, 0));
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
- // Skin Option List
- SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+ // Skin Option List
+ SkinOptionList_Update(skinOptions, &skinOptionsCount, hwndDlg);
- // PreviewBox
- mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), WndProcPreviewBox);
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ // PreviewBox
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), WndProcPreviewBox);
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- // hooks
- hhkFontsReload = HookEventMessage(ME_FONT_RELOAD, hwndDlg, WM_USER);
+ // hooks
+ hhkFontsReload = HookEventMessage(ME_FONT_RELOAD, hwndDlg, WM_USER);
- TranslateDialogDefault(hwndDlg);
- bDlgInit = true;
- }
- return TRUE;
+ TranslateDialogDefault(hwndDlg);
+ bDlgInit = true;
+ }
+ return TRUE;
case WM_USER:
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
return TRUE;
case WM_COMMAND:
- {
- HWND hCtrl = NULL;
- UINT idCtrl = LOWORD(wParam);
- switch (HIWORD(wParam)) {
- case BN_KILLFOCUS: // Button controls
- case BN_SETFOCUS: // Button controls
- return TRUE;
+ {
+ HWND hCtrl = NULL;
+ UINT idCtrl = LOWORD(wParam);
+ switch (HIWORD(wParam)) {
+ case BN_KILLFOCUS: // Button controls
+ case BN_SETFOCUS: // Button controls
+ return TRUE;
+ break;
+ case BN_CLICKED: // Button controls
+ switch (idCtrl) {
+ case IDC_PREVIEW:
+ PopupPreview();
break;
- case BN_CLICKED: // Button controls
- switch(idCtrl) {
- case IDC_PREVIEW:
- PopupPreview();
- break;
- case IDC_BTN_RELOAD:
- {
- DWORD dwIndex = 0;
- TCHAR szNewSkin[128];
- LPTSTR pszOldSkin = mir_tstrdup(PopupOptions.SkinPack);
- skins.load();
- hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
- ListBox_ResetContent(hCtrl);
- for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
- {
- dwIndex = ListBox_AddString(hCtrl, sl->name);
- ListBox_SetItemData(hCtrl, dwIndex, sl->name);
- }
- ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
- // make shure we have select skin (ListBox_SetCurSel may be fail)
- ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
- if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
- mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(szNewSkin);
- }
- mir_free(pszOldSkin);
-
- const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopupOptions.SkinPack)) {
- // update Skin Option List from reload SkinPack
- bDlgInit = false;
- bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- }
-
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }// end IDC_BTN_RELOAD:
- break;
- case IDC_GETSKINS:
- CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/addons/category/13");
- break;
- }// end switch(idCtrl)
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- break;
- case CBN_SELCHANGE: // combo box controls
- switch(idCtrl) {
- case IDC_SKINLIST:
- {
- // Skin list change
- mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
- hwndDlg,
- IDC_SKINLIST,
- LB_GETITEMDATA,
- (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SKINLIST, LB_GETCURSEL,0,0),
- 0));
- const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopupOptions.SkinPack)) {
- mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup(skin->getName());
-
- // update Skin Option List
- bDlgInit = false;
- bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- }
- updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }// end switch(idCtrl)
+ case IDC_BTN_RELOAD:
+ {
+ DWORD dwIndex = 0;
+ TCHAR szNewSkin[128];
+ LPTSTR pszOldSkin = mir_tstrdup(PopupOptions.SkinPack);
+ skins.load();
+ hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
+ ListBox_ResetContent(hCtrl);
+ for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
+ {
+ dwIndex = ListBox_AddString(hCtrl, sl->name);
+ ListBox_SetItemData(hCtrl, dwIndex, sl->name);
+ }
+ ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
+ // make shure we have select skin (ListBox_SetCurSel may be fail)
+ ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
+ if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
+ mir_free(PopupOptions.SkinPack);
+ PopupOptions.SkinPack = mir_tstrdup(szNewSkin);
+ }
+ mir_free(pszOldSkin);
+
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopupOptions.SkinPack)) {
+ // update Skin Option List from reload SkinPack
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update(skinOptions, &skinOptionsCount, hwndDlg);
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }// end IDC_BTN_RELOAD:
+ break;
+ case IDC_GETSKINS:
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://miranda-ng.org/addons/category/13");
break;
- }// end switch (HIWORD(wParam))
+ }// end switch(idCtrl)
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
break;
- }// end WM_COMMAND
+ case CBN_SELCHANGE: // combo box controls
+ switch (idCtrl) {
+ case IDC_SKINLIST:
+ {
+ // Skin list change
+ mir_free(PopupOptions.SkinPack);
+ PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
+ hwndDlg,
+ IDC_SKINLIST,
+ LB_GETITEMDATA,
+ (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SKINLIST, LB_GETCURSEL, 0, 0),
+ 0));
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopupOptions.SkinPack)) {
+ mir_free(PopupOptions.SkinPack);
+ PopupOptions.SkinPack = mir_tstrdup(skin->getName());
+
+ // update Skin Option List
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update(skinOptions, &skinOptionsCount, hwndDlg);
+ }
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }// end switch(idCtrl)
+ break;
+ }// end switch (HIWORD(wParam))
+ break;
+ }// end WM_COMMAND
case WM_NOTIFY:
if (!bDlgInit) return FALSE;
@@ -480,23 +480,23 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR LoadOption_Skins();
return TRUE;
- case PSN_APPLY:
- {
- // skin pack
- db_set_ts(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
- // skin options
- const PopupSkin *skin = 0;
- if (skin = skins.getSkin(PopupOptions.SkinPack))
- skin->saveOpts();
- skins.freeAllButActive();
- // more Skin options
- db_set_b(NULL, MODULNAME, "DisplayTime", PopupOptions.DisplayTime);
- db_set_b(NULL, MODULNAME, "DropShadow", PopupOptions.DropShadow);
- db_set_b(NULL, MODULNAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
- db_set_b(NULL, MODULNAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
- db_set_b(NULL, MODULNAME, "UseMText", PopupOptions.UseMText);
- }// end PSN_APPLY:
- return TRUE;
+ case PSN_APPLY:
+ {
+ // skin pack
+ db_set_ts(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
+ // skin options
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopupOptions.SkinPack))
+ skin->saveOpts();
+ skins.freeAllButActive();
+ // more Skin options
+ db_set_b(NULL, MODULNAME, "DisplayTime", PopupOptions.DisplayTime);
+ db_set_b(NULL, MODULNAME, "DropShadow", PopupOptions.DropShadow);
+ db_set_b(NULL, MODULNAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
+ db_set_b(NULL, MODULNAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
+ db_set_b(NULL, MODULNAME, "UseMText", PopupOptions.UseMText);
+ }// end PSN_APPLY:
+ return TRUE;
}// switch (((LPNMHDR)lParam)->code)
break;
}// end switch (((LPNMHDR)lParam)->idFrom)
@@ -510,7 +510,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
if (hhkFontsReload) UnhookEvent(hhkFontsReload);
if (skinOptions) {
- for (int i=0; i < skinOptionsCount; ++i) {
+ for (int i = 0; i < skinOptionsCount; ++i) {
mir_free(skinOptions[i].pszOptionName);
mir_free(skinOptions[i].pszSettingName);
}
@@ -529,72 +529,72 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode) switch (mode) {
case 0:
- { // Avatar
- HDC hdcAvatar = CreateCompatibleDC(mydc);
- HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
- GetClientRect(hwnd, &rc);
- BITMAP bmp;
- GetObject(hbmNoAvatar, sizeof(bmp), &bmp);
- StretchBlt(mydc, 0, 0, rc.right, rc.bottom, hdcAvatar, 0, 0, abs(bmp.bmWidth), abs(bmp.bmHeight), SRCCOPY);
- SelectObject(hdcAvatar, hbmSave);
- DeleteDC(hdcAvatar);
- HRGN rgn = CreateRoundRectRgn(0, 0, rc.right, rc.bottom, 2 * PopupOptions.avatarRadius, 2 * PopupOptions.avatarRadius);
- FrameRgn(mydc, rgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
- DeleteObject(rgn);
- break;
- }
- case 1:
- { // Opacity
- HBRUSH hbr = CreateSolidBrush(fonts.clBack);
- HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
- GetClientRect(hwnd, &rc);
- FillRect(mydc, &rc, hbr);
- DrawIconEx(mydc, 10, (rc.bottom-rc.top-16)/2, IcoLib_GetIcon(ICO_POPUP_ON,0), 16, 16, 0, hbr, DI_NORMAL);
- SetBkMode(mydc, TRANSPARENT);
- GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
- rc.right -= (rc.right-rc.left)/3;
- rc.bottom -= (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
- GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
- rc.left += (rc.right-rc.left)/3;
- rc.top += (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
- GetClientRect(hwnd, &rc);
- FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
- SelectObject(mydc, hfnt);
- DeleteObject(hbr);
- }
+ { // Avatar
+ HDC hdcAvatar = CreateCompatibleDC(mydc);
+ HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
+ GetClientRect(hwnd, &rc);
+ BITMAP bmp;
+ GetObject(hbmNoAvatar, sizeof(bmp), &bmp);
+ StretchBlt(mydc, 0, 0, rc.right, rc.bottom, hdcAvatar, 0, 0, abs(bmp.bmWidth), abs(bmp.bmHeight), SRCCOPY);
+ SelectObject(hdcAvatar, hbmSave);
+ DeleteDC(hdcAvatar);
+ HRGN rgn = CreateRoundRectRgn(0, 0, rc.right, rc.bottom, 2 * PopupOptions.avatarRadius, 2 * PopupOptions.avatarRadius);
+ FrameRgn(mydc, rgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
+ DeleteObject(rgn);
break;
+ }
+ case 1:
+ { // Opacity
+ HBRUSH hbr = CreateSolidBrush(fonts.clBack);
+ HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
+ GetClientRect(hwnd, &rc);
+ FillRect(mydc, &rc, hbr);
+ DrawIconEx(mydc, 10, (rc.bottom - rc.top - 16) / 2, IcoLib_GetIcon(ICO_POPUP_ON, 0), 16, 16, 0, hbr, DI_NORMAL);
+ SetBkMode(mydc, TRANSPARENT);
+ GetClientRect(hwnd, &rc);
+ rc.left += 30; // 10+16+4 -- icon
+ rc.right -= (rc.right - rc.left) / 3;
+ rc.bottom -= (rc.bottom - rc.top) / 3;
+ DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ GetClientRect(hwnd, &rc);
+ rc.left += 30; // 10+16+4 -- icon
+ rc.left += (rc.right - rc.left) / 3;
+ rc.top += (rc.bottom - rc.top) / 3;
+ DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ GetClientRect(hwnd, &rc);
+ FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
+ SelectObject(mydc, hfnt);
+ DeleteObject(hbr);
+ }
+ break;
case 2:
- { // Position
- HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
- GetClientRect(hwnd, &rc);
- FillRect(mydc, &rc, hbr);
- DeleteObject(hbr);
-
- hbr = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
- GetClientRect(hwnd, &rc);
- rc.right -= 100;
- rc.top += 100;
- FillRect(mydc, &rc, hbr);
- DeleteObject(hbr);
-
- HPEN hpen = (HPEN)SelectObject(mydc, CreatePen(PS_DOT, 1, RGB(0,0,0)));
- MoveToEx(mydc, 0, 100, NULL);
- LineTo (mydc, 201, 100);
- MoveToEx(mydc, 100, 0, NULL);
- LineTo (mydc, 100, 201);
- DeleteObject(SelectObject(mydc, hpen));
-
- HRGN hrgn = CreateRectRgn(0,0,0,0);
- GetWindowRgn(hwnd, hrgn);
- FrameRgn(mydc, hrgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
- DeleteObject(hrgn);
- }
- break;
+ { // Position
+ HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
+ GetClientRect(hwnd, &rc);
+ FillRect(mydc, &rc, hbr);
+ DeleteObject(hbr);
+
+ hbr = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
+ GetClientRect(hwnd, &rc);
+ rc.right -= 100;
+ rc.top += 100;
+ FillRect(mydc, &rc, hbr);
+ DeleteObject(hbr);
+
+ HPEN hpen = (HPEN)SelectObject(mydc, CreatePen(PS_DOT, 1, RGB(0, 0, 0)));
+ MoveToEx(mydc, 0, 100, NULL);
+ LineTo(mydc, 201, 100);
+ MoveToEx(mydc, 100, 0, NULL);
+ LineTo(mydc, 100, 201);
+ DeleteObject(SelectObject(mydc, hpen));
+
+ HRGN hrgn = CreateRectRgn(0, 0, 0, 0);
+ GetWindowRgn(hwnd, hrgn);
+ FrameRgn(mydc, hrgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
+ DeleteObject(hrgn);
+ }
+ break;
}
}
diff --git a/plugins/Popup/src/opt_skins.h b/plugins/Popup/src/opt_skins.h index f43c44a357..6179ad35fb 100644 --- a/plugins/Popup/src/opt_skins.h +++ b/plugins/Popup/src/opt_skins.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index b4481864d0..39a9d3f090 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -29,7 +29,7 @@ static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem) {
TCHAR buf[64];
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.hItem = hItem;
tvi.pszText = buf;
@@ -67,7 +67,7 @@ void OptTree_Translate(HWND hwndTree) HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
{
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
TCHAR str[MAX_PATH];
if (hItem)
@@ -118,7 +118,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd hItem = OptTree_FindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
- TVINSERTSTRUCT tvis = {0};
+ TVINSERTSTRUCT tvis = { 0 };
tvis.hParent = hSection;
tvis.hInsertAfter = TVI_LAST;// TVI_SORT;
@@ -151,168 +151,168 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res HWND hwndTree = GetDlgItem(hwnd, idcTree);
switch (msg)
{
- case WM_INITDIALOG:
- {
- int indx;
- TCHAR itemName[1024];
- HIMAGELIST hImgLst;
-
- TreeView_SelectItem(hwndTree, NULL);
- TreeView_DeleteAllItems(hwndTree);
-
- hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT));
- TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
-
- /* build options tree. based on code from IcoLib */
- for (indx = 0; indx < optionCount; indx++) {
- TCHAR *sectionName;
- int sectionLevel = 0;
-
- HTREEITEM hSection = NULL;
- mir_tstrcpy(itemName, options[indx].pszOptionName);
- sectionName = itemName;
-
- while (sectionName) {
- // allow multi-level tree
- TCHAR *pItemName = sectionName;
- HTREEITEM hItem;
-
- if (sectionName = _tcschr(sectionName, '/')) {
- // one level deeper
- *sectionName = 0;
- sectionName++;
- }
+ case WM_INITDIALOG:
+ {
+ int indx;
+ TCHAR itemName[1024];
+ HIMAGELIST hImgLst;
+
+ TreeView_SelectItem(hwndTree, NULL);
+ TreeView_DeleteAllItems(hwndTree);
+
+ hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT));
+ TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
+
+ /* build options tree. based on code from IcoLib */
+ for (indx = 0; indx < optionCount; indx++) {
+ TCHAR *sectionName;
+ int sectionLevel = 0;
+
+ HTREEITEM hSection = NULL;
+ mir_tstrcpy(itemName, options[indx].pszOptionName);
+ sectionName = itemName;
+
+ while (sectionName) {
+ // allow multi-level tree
+ TCHAR *pItemName = sectionName;
+ HTREEITEM hItem;
+
+ if (sectionName = _tcschr(sectionName, '/')) {
+ // one level deeper
+ *sectionName = 0;
+ sectionName++;
+ }
- hItem = OptTree_FindNamedTreeItemAt(hwndTree, hSection, pItemName);
- if (!sectionName || !hItem) {
- if (!hItem) {
- TVINSERTSTRUCT tvis = {0};
-
- tvis.hParent = hSection;
- tvis.hInsertAfter = TVI_LAST;// TVI_SORT;
- tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvis.item.pszText = pItemName;
- tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
- if (sectionName) {
- tvis.item.lParam = -1;
- tvis.item.state |= TVIS_BOLD;
- tvis.item.stateMask |= TVIS_BOLD;
- tvis.item.iImage = tvis.item.iSelectedImage = IMG_GRPOPEN;
- }
- else {
- tvis.item.lParam = indx;
- if (options[indx].groupId == OPTTREE_CHECK)
- tvis.item.iImage = tvis.item.iSelectedImage = IMG_NOCHECK;
- else
- tvis.item.iImage = tvis.item.iSelectedImage = IMG_NORCHECK;
- }
- hItem = TreeView_InsertItem(hwndTree, &tvis);
- if (!sectionName)
- options[indx].hItem = hItem;
+ hItem = OptTree_FindNamedTreeItemAt(hwndTree, hSection, pItemName);
+ if (!sectionName || !hItem) {
+ if (!hItem) {
+ TVINSERTSTRUCT tvis = { 0 };
+
+ tvis.hParent = hSection;
+ tvis.hInsertAfter = TVI_LAST;// TVI_SORT;
+ tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvis.item.pszText = pItemName;
+ tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
+ if (sectionName) {
+ tvis.item.lParam = -1;
+ tvis.item.state |= TVIS_BOLD;
+ tvis.item.stateMask |= TVIS_BOLD;
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_GRPOPEN;
+ }
+ else {
+ tvis.item.lParam = indx;
+ if (options[indx].groupId == OPTTREE_CHECK)
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_NOCHECK;
+ else
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_NORCHECK;
}
+ hItem = TreeView_InsertItem(hwndTree, &tvis);
+ if (!sectionName)
+ options[indx].hItem = hItem;
}
- sectionLevel++;
- hSection = hItem;
}
+ sectionLevel++;
+ hSection = hItem;
}
-
- OptTree_Translate(hwndTree);
- ShowWindow(hwndTree, SW_SHOW);
- TreeView_SelectItem(hwndTree, OptTree_FindNamedTreeItemAt(hwndTree, 0, NULL));
- break;
}
- case WM_DESTROY:
- {
- ImageList_Destroy(TreeView_GetImageList(hwndTree, TVSIL_NORMAL));
- break;
- }
+ OptTree_Translate(hwndTree);
+ ShowWindow(hwndTree, SW_SHOW);
+ TreeView_SelectItem(hwndTree, OptTree_FindNamedTreeItemAt(hwndTree, 0, NULL));
+ break;
+ }
- case WM_NOTIFY:
+ case WM_DESTROY:
+ {
+ ImageList_Destroy(TreeView_GetImageList(hwndTree, TVSIL_NORMAL));
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ LPNMHDR lpnmhdr = (LPNMHDR)lparam;
+ if (lpnmhdr->idFrom != (UINT)idcTree)
+ break;
+ switch (lpnmhdr->code)
+ {
+ case NM_CLICK:
{
- LPNMHDR lpnmhdr = (LPNMHDR)lparam;
- if (lpnmhdr->idFrom != (UINT)idcTree)
- break;
- switch (lpnmhdr->code)
- {
- case NM_CLICK:
- {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(lpnmhdr->hwndFrom, &hti.pt);
- if (TreeView_HitTest(lpnmhdr->hwndFrom, &hti)) {
- if (hti.flags & TVHT_ONITEMICON) {
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.hItem = hti.hItem;
- TreeView_GetItem(lpnmhdr->hwndFrom, &tvi);
- switch (tvi.iImage)
- {
- case IMG_GRPOPEN:
- tvi.iImage = tvi.iSelectedImage = IMG_GRPCLOSED;
- TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_COLLAPSE);
- break;
- case IMG_GRPCLOSED:
- tvi.iImage = tvi.iSelectedImage = IMG_GRPOPEN;
- TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_EXPAND);
- break;
-
- case IMG_CHECK:
- tvi.iImage = tvi.iSelectedImage = IMG_NOCHECK;
- *result = tvi.lParam;
- options[tvi.lParam].bState = FALSE;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- case IMG_NOCHECK:
- tvi.iImage = tvi.iSelectedImage = IMG_CHECK;
- *result = tvi.lParam;
- options[tvi.lParam].bState = TRUE;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- case IMG_NORCHECK:
- {
- int i;
- for (i = 0; i < optionCount; ++i) {
- if (options[i].groupId == options[tvi.lParam].groupId) {
- TVITEM tvi_tmp;
- tvi_tmp.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi_tmp.hItem = options[i].hItem;
- tvi_tmp.iImage = tvi_tmp.iSelectedImage = IMG_NORCHECK;
- TreeView_SetItem(lpnmhdr->hwndFrom, &tvi_tmp);
- }
- }
- tvi.iImage = tvi.iSelectedImage = IMG_RCHECK;
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- }
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(lpnmhdr->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(lpnmhdr->hwndFrom, &hti)) {
+ if (hti.flags & TVHT_ONITEMICON) {
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(lpnmhdr->hwndFrom, &tvi);
+ switch (tvi.iImage)
+ {
+ case IMG_GRPOPEN:
+ tvi.iImage = tvi.iSelectedImage = IMG_GRPCLOSED;
+ TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_COLLAPSE);
+ break;
+ case IMG_GRPCLOSED:
+ tvi.iImage = tvi.iSelectedImage = IMG_GRPOPEN;
+ TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_EXPAND);
+ break;
+
+ case IMG_CHECK:
+ tvi.iImage = tvi.iSelectedImage = IMG_NOCHECK;
+ *result = tvi.lParam;
+ options[tvi.lParam].bState = FALSE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IMG_NOCHECK:
+ tvi.iImage = tvi.iSelectedImage = IMG_CHECK;
+ *result = tvi.lParam;
+ options[tvi.lParam].bState = TRUE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IMG_NORCHECK:
+ {
+ int i;
+ for (i = 0; i < optionCount; ++i) {
+ if (options[i].groupId == options[tvi.lParam].groupId) {
+ TVITEM tvi_tmp;
+ tvi_tmp.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi_tmp.hItem = options[i].hItem;
+ tvi_tmp.iImage = tvi_tmp.iSelectedImage = IMG_NORCHECK;
+ TreeView_SetItem(lpnmhdr->hwndFrom, &tvi_tmp);
}
- TreeView_SetItem(lpnmhdr->hwndFrom, &tvi);
}
+ tvi.iImage = tvi.iSelectedImage = IMG_RCHECK;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ }
}
- break;
- }
-
- case TVN_ITEMEXPANDED:
- {
- LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)lparam;
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.hItem = lpnmtv->itemNew.hItem;
- tvi.iImage = tvi.iSelectedImage = (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
TreeView_SetItem(lpnmhdr->hwndFrom, &tvi);
- break;
}
}
break;
}
+
+ case TVN_ITEMEXPANDED:
+ {
+ LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)lparam;
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = lpnmtv->itemNew.hItem;
+ tvi.iImage = tvi.iSelectedImage = (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
+ TreeView_SetItem(lpnmhdr->hwndFrom, &tvi);
+ break;
+ }
+ }
+ break;
+ }
}
return FALSE;
}
@@ -326,7 +326,7 @@ DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int op if ((!options[i].pszSettingName && !pszSettingName) ||
(options[i].pszSettingName && pszSettingName && !mir_tstrcmp(options[i].pszSettingName, pszSettingName)))
{
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_IMAGE;
tvi.hItem = options[i].hItem;
TreeView_GetItem(hwndTree, &tvi);
diff --git a/plugins/Popup/src/opttree.h b/plugins/Popup/src/opttree.h index 8aa8765328..77cea5d075 100644 --- a/plugins/Popup/src/opttree.h +++ b/plugins/Popup/src/opttree.h @@ -2,9 +2,9 @@ Popup Plus plugin for Miranda IM
Copyright © 2002 Luca Santarelli,
- © 2004-2007 Victor Pavlychko
- © 2010 MPK
- © 2010 Merlin_de
+© 2004-2007 Victor Pavlychko
+© 2010 MPK
+© 2010 Merlin_de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -27,14 +27,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define OPTTREE_CHECK 0
typedef struct {
- int iconIndex;
- LPTSTR pszOptionName;
- int groupId;
- DWORD dwFlag;
- HTREEITEM hItem;
- LPTSTR pszSettingName;
- BOOL bState;
- int Data; //free for use (depend on data)
+ int iconIndex;
+ LPTSTR pszOptionName;
+ int groupId;
+ DWORD dwFlag;
+ HTREEITEM hItem;
+ LPTSTR pszSettingName;
+ BOOL bState;
+ int Data; //free for use (depend on data)
} OPTTREE_OPTION;
BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL *result, int idcTree, OPTTREE_OPTION *options, int optionCount);
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index f041ecaf51..acd1430802 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -835,7 +835,7 @@ BOOL IsUtfSendAvailable(MCONTACT hContact) char* szProto = GetContactProto(hContact);
if (szProto == NULL) return FALSE;
// check for MetaContact and get szProto from subcontact
- if (!strcmp(szProto, META_PROTO)) {
+ if (!mir_strcmp(szProto, META_PROTO)) {
MCONTACT hSubContact = db_mc_getDefault(hContact);
if (!hSubContact)
return FALSE;
@@ -999,16 +999,16 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case ACT_DEF_ADD:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = 0;
- CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- }
- break;
+ {
+ ADDCONTACTSTRUCT acs = { 0 };
+ acs.hContact = m_hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = 0;
+ CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
+ if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
+ }
+ break;
case ACT_DEF_PIN:
if (m_bIsPinned)
@@ -1029,8 +1029,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case ACT_DEF_COPY:
if (m_lptzText || m_lptzTitle) {
- CMString tszText(FORMAT, _T("%s\n\n%s"),
- (m_lptzTitle) ? m_lptzTitle : _T(""),
+ CMString tszText(FORMAT, _T("%s\n\n%s"),
+ (m_lptzTitle) ? m_lptzTitle : _T(""),
(m_lptzText) ? m_lptzText : _T(""));
if (OpenClipboard(m_hwnd)) {
@@ -1154,16 +1154,16 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case AVATAR_TIMER:
- {
- int newDelay = m_avatar->activeFrameDelay();
- animate();
- if ((newDelay <= 0) || (newDelay != m_avatarFrameDelay)) KillTimer(m_hwnd, AVATAR_TIMER);
- if (newDelay > 0) {
- SetTimer(m_hwnd, AVATAR_TIMER, newDelay, 0);
- m_avatarFrameDelay = newDelay;
- }
+ {
+ int newDelay = m_avatar->activeFrameDelay();
+ animate();
+ if ((newDelay <= 0) || (newDelay != m_avatarFrameDelay)) KillTimer(m_hwnd, AVATAR_TIMER);
+ if (newDelay > 0) {
+ SetTimer(m_hwnd, AVATAR_TIMER, newDelay, 0);
+ m_avatarFrameDelay = newDelay;
}
- break;
+ }
+ break;
case CURSOR_TIMER:
POINT pt; GetCursorPos(&pt);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 77fb4ea64f..c89388e586 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -381,13 +381,13 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
mir_sntprintf(fid.group, SIZEOF(fid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
- strncpy(fid.dbSettingsGroup, PU_MODULCLASS, SIZEOF(fid.dbSettingsGroup)-1);
+ mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, SIZEOF(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- _tcsncpy(fid.deffontsettings.szFace, _T("Verdana"), SIZEOF(fid.deffontsettings.szFace)-1);
- _tcsncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name)-1);
- strncpy(fid.prefix, setting, SIZEOF(fid.prefix));
+ mir_tstrncpy(fid.deffontsettings.szFace, _T("Verdana"), SIZEOF(fid.deffontsettings.szFace) - 1);
+ mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name) - 1);
+ mir_strncpy(fid.prefix, setting, SIZEOF(fid.prefix));
mir_snprintf(fid.prefix, SIZEOF(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
@@ -399,8 +399,8 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
mir_sntprintf(cid.group, SIZEOF(cid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
- strncpy(cid.dbSettingsGroup, PU_MODULCLASS, SIZEOF(fid.dbSettingsGroup));
- _tcsncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
+ mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, SIZEOF(fid.dbSettingsGroup));
+ mir_tstrncpy(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
mir_snprintf(cid.setting, SIZEOF(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
ColourRegisterT(&cid);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 03ec882e3f..751370ef54 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -1099,13 +1099,11 @@ bool Skins::load() TCHAR dir[1024] = { '\0' };
if (ServiceExists(MS_FOLDERS_GET_PATH)) {
- if (FoldersGetCustomPathT(folderId, dir, 1024, NULL) != 0)
+ if (FoldersGetCustomPathT(folderId, dir, SIZEOF(dir), NULL) != 0)
return false;
}
else {
- GetModuleFileName(hInst, dir, 1024);
- dir[mir_tstrlen(dir) - 18] = 0;
- mir_tstrcat(dir, _T("\\skins\\popup"));
+ mir_tstrncpy(dir, VARST(_T("%miranda_path%\\skins\\popup")), SIZEOF(dir));
DWORD fa = GetFileAttributes(dir);
if ((fa == INVALID_FILE_ATTRIBUTES) || !(fa&FILE_ATTRIBUTE_DIRECTORY))
return false;
|