diff options
author | George Hazan <george.hazan@gmail.com> | 2014-04-08 14:45:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-04-08 14:45:54 +0000 |
commit | afa73da4259ee9a00e60570031f94338542636d8 (patch) | |
tree | cacf0a9d83484c8a3143e3b6aa0c8af42ed022a4 | |
parent | 0a41e7f5bd2d3cd705e5806b3190ff7afadde131 (diff) |
- fixes #596 (Clist nicer skin doesn't show buttons)
- code formatting fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@8891 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_nicer/src/CLCButton.cpp | 261 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/Version.h | 14 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/clc.h | 294 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/Include/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 5 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 347 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/config.cpp | 96 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/contact.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 310 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 142 |
11 files changed, 813 insertions, 661 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index a0db5e52e6..ef0d9ae385 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -21,29 +21,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_button_int.h>
#include <m_toptoolbar.h>
-struct
-{
- int ctrlid;
- char *pszButtonID, *pszButtonDn, *pszButtonName;
- int isPush, isVis, isAction;
- HANDLE hButton;
- HWND hwndButton;
-}
-static BTNS[] =
+HWND g_hwndToolbarFrame;
+HANDLE hToolbarFrame = (HANDLE)-1;
+
+struct CluiTopButton BTNS[] =
{
- { IDC_TBTOPMENU, "CLN_topmenu", NULL, LPGEN("Show menu"), 1, 1, 1 },
- { IDC_TBHIDEOFFLINE, "CLN_online", NULL, LPGEN("Show / hide offline contacts"), 0, 1, 0 },
- { IDC_TBHIDEGROUPS, "CLN_groups", NULL, LPGEN("Toggle group mode"), 0, 1, 0 },
- { IDC_TBFINDANDADD, "CLN_findadd", NULL, LPGEN("Find and add contacts"), 1, 1, 0 },
- { IDC_TBACCOUNTS, "CLN_accounts", NULL, LPGEN("Accounts"), 1, 1, 0 },
- { IDC_TBOPTIONS, "CLN_options", NULL, LPGEN("Open preferences"), 1, 1, 0 },
- { IDC_TBSOUND, "CLN_sound", "CLN_soundsoff", LPGEN("Toggle sounds"), 0, 1, 0 },
- { IDC_TBMINIMIZE, "CLN_minimize", NULL, LPGEN("Minimize contact list"), 1, 0, 0 },
- { IDC_TBTOPSTATUS, "CLN_topstatus", NULL, LPGEN("Status menu"), 1, 0, 1 },
-
- { IDC_TBSELECTVIEWMODE, "CLN_CLVM_select", NULL, LPGEN("Select view mode"), 1, 0, 1 },
- { IDC_TBCONFIGUREVIEWMODE,"CLN_CLVM_options", NULL, LPGEN("Setup view modes"), 1, 0, 0 },
- { IDC_TBCLEARVIEWMODE, "CLN_CLVM_reset", NULL, LPGEN("Clear view mode"), 1, 0, 0 }
+ { IDC_TBTOPMENU, "CLN_topmenu", NULL, LPGEN("Show menu"), 1, 1, 1 },
+ { IDC_TBHIDEOFFLINE, "CLN_online", NULL, LPGEN("Hide offline contacts"), 0, 1, 0 },
+ { IDC_TBHIDEGROUPS, "CLN_groups", NULL, LPGEN("Enable group mode"), 0, 1, 0 },
+ { IDC_TBFINDANDADD, "CLN_findadd", NULL, LPGEN("Find and add contacts"), 1, 1, 0 },
+ { IDC_TBACCOUNTS, "CLN_accounts", NULL, LPGEN("Accounts"), 1, 1, 0 },
+ { IDC_TBOPTIONS, "CLN_options", NULL, LPGEN("Open preferences"), 1, 1, 0 },
+ { IDC_TBSOUND, "CLN_sound", "CLN_soundsoff", LPGEN("Disable sounds"), 0, 1, 0 },
+ { IDC_TBMINIMIZE, "CLN_minimize", NULL, LPGEN("Minimize contact list"), 1, 0, 0 },
+ { IDC_TBTOPSTATUS, "CLN_topstatus", NULL, LPGEN("Status menu"), 1, 0, 1 },
+
+ { IDC_TBSELECTVIEWMODE, "CLN_CLVM_select", NULL, LPGEN("Select view mode"), 1, 0, 1 },
+ { IDC_TBCONFIGUREVIEWMODE, "CLN_CLVM_options", NULL, LPGEN("Setup view modes"), 1, 0, 0 },
+ { IDC_TBCLEARVIEWMODE, "CLN_CLVM_reset", NULL, LPGEN("Clear view mode"), 1, 0, 0 }
};
static int g_index = -1;
@@ -55,21 +50,30 @@ static int getButtonIndex(HANDLE hButton) if (g_index != -1)
return g_index;
- for (int i=0; i < SIZEOF(BTNS); i++)
+ for (int i = 0; i < SIZEOF(BTNS); i++)
if (BTNS[i].hButton == hButton)
return i;
return -1;
}
+static int getLastIndex()
+{
+ for (int i = 0; ; i++)
+ if (BTNS[i].pszButtonID == NULL)
+ return i;
+
+ return -1;
+}
+
static void InitDefaultButtons()
{
- for (int i=0; i < SIZEOF(BTNS); i++ ) {
+ for (int i = 0; i < SIZEOF(BTNS); i++ ) {
TTBButton tbb = { sizeof(tbb) };
g_index = i;
if (BTNS[i].pszButtonID) {
- if ( !BTNS[i].isPush)
+ if (!BTNS[i].isPush)
tbb.dwFlags |= TTBBF_ASPUSHBUTTON;
tbb.pszTooltipUp = tbb.name = LPGEN(BTNS[i].pszButtonName);
@@ -79,19 +83,19 @@ static void InitDefaultButtons() }
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
- tbb.dwFlags |= (BTNS[i].isVis ? TTBBF_VISIBLE : 0 );
+ tbb.dwFlags |= (BTNS[i].isVis ? TTBBF_VISIBLE : 0);
BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
g_index = -1;
ClcSetButtonState(IDC_TBHIDEOFFLINE, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
ClcSetButtonState(IDC_TBHIDEGROUPS, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
- ClcSetButtonState(IDC_TBSOUND, db_get_b(NULL, "Skin", "UseSound", 1));
+ ClcSetButtonState(IDC_TBSOUND, db_get_b(NULL, "Skin", "UseSound", 1) ? BST_UNCHECKED : BST_CHECKED);
}
void ClcSetButtonState(int ctrlid, int status)
{
- for (int i=0; i < SIZEOF(BTNS); i++)
+ for (int i = 0; i < SIZEOF(BTNS); i++)
if (BTNS[i].ctrlid == ctrlid) {
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[i].hButton, status ? TTBST_PUSHED : TTBST_RELEASED);
break;
@@ -100,7 +104,7 @@ void ClcSetButtonState(int ctrlid, int status) HWND ClcGetButtonWindow(int ctrlid)
{
- for (int i=0; i < SIZEOF(BTNS); i++)
+ for (int i = 0; i < SIZEOF(BTNS); i++)
if (BTNS[i].ctrlid == ctrlid)
return BTNS[i].hwndButton;
@@ -109,7 +113,7 @@ HWND ClcGetButtonWindow(int ctrlid) int ClcGetButtonId(HWND hwnd)
{
- for (int i=0; i < SIZEOF(BTNS); i++)
+ for (int i = 0; i < SIZEOF(BTNS); i++)
if (BTNS[i].hwndButton == hwnd)
return BTNS[i].ctrlid;
@@ -127,11 +131,12 @@ struct MButtonExtension : public MButtonCtrl int iIcon;
ButtonItem *buttonItem;
LONG lastGlyphMetrics[4];
+ bool bIsTTButton;
};
// Used for our own cheap TrackMouseEvent
-#define BUTTON_POLLID 100
-#define BUTTON_POLLDELAY 50
+#define BUTTON_POLLID 100
+#define BUTTON_POLLDELAY 50
static int TBStateConvert2Flat(int state)
{
@@ -180,7 +185,8 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) DrawThemeParentBackground(ctl->hwnd, hdcMem, &rc);
}
DrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rc, &rc);
- } else {
+ }
+ else {
HBRUSH hbr;
RECT rc = rcClient;
@@ -207,7 +213,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) glyphMetrics[3], g_glyphItem->bf);
}
}
- else if (ctl->bIsSkinned) { // skinned
+ else if (ctl->bIsSkinned) { // skinned
RECT rcParent;
POINT pt;
HWND hwndParent = pcli->hwndContactList;
@@ -220,24 +226,28 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) ScreenToClient(pcli->hwndContactList, &pt);
- if (HIWORD(ctl->bIsSkinned))
+ if (ctl->bIsTTButton)
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKTBBUTTONMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED);
else
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKBUTTONSMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKBUTTONSPRESSED : ID_EXTBKBUTTONSNPRESSED);
item = arStatusItems[item_id - ID_STATUS_OFFLINE];
- SetTextColor(hdcMem, item->TEXTCOLOR);
- if (item->IGNORED) {
- if (pt.y < 10 || cfg::dat.bWallpaperMode)
- BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- else
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
+ if (pt.y < 10 || cfg::dat.bWallpaperMode)
+ BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
+ else
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
+
+ if (ctl->bIsTTButton) {
+ GetWindowRect(ctl->hwnd, &rcParent);
+ pt.x = rcParent.left;
+ pt.y = rcParent.top;
+
+ ScreenToClient(g_hwndToolbarFrame, &pt);
+ BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcToolbar, pt.x, pt.y, SRCCOPY);
}
- else {
- if (pt.y < 10 || cfg::dat.bWallpaperMode)
- BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- else
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
+
+ SetTextColor(hdcMem, item->TEXTCOLOR);
+ if (!item->IGNORED) {
rc.top += item->MARGIN_TOP; rc.bottom -= item->MARGIN_BOTTOM;
rc.left += item->MARGIN_LEFT; rc.right -= item->MARGIN_RIGHT;
DrawAlpha(hdcMem, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
@@ -253,7 +263,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) hwndParent = GetParent(ctl->hwnd);
dc = GetDC(hwndParent);
- hbr = (HBRUSH) SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM) dc, (LPARAM) hwndParent);
+ hbr = (HBRUSH)SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM)dc, (LPARAM)hwndParent);
ReleaseDC(hwndParent, dc);
}
if (hbr) {
@@ -261,22 +271,24 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) DeleteObject(hbr);
}
}
- if ( !ctl->bIsSkinned && ctl->buttonItem == 0) {
+ if (!ctl->bIsSkinned && ctl->buttonItem == 0) {
if (ctl->stateId == PBS_HOT || ctl->focus) {
if (ctl->bIsPushed)
DrawEdge(hdcMem, &rc, EDGE_ETCHED, BF_RECT | BF_SOFT);
else
DrawEdge(hdcMem, &rc, BDR_RAISEDOUTER, BF_RECT | BF_SOFT);
- } else if (ctl->stateId == PBS_PRESSED)
+ }
+ else if (ctl->stateId == PBS_PRESSED)
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT | BF_SOFT);
}
}
- } else {
+ }
+ else {
// Draw background/border
if (ctl->hThemeButton && ctl->bIsThemed) {
int state = IsWindowEnabled(ctl->hwnd) ? (ctl->stateId == PBS_NORMAL && ctl->bIsDefault ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
POINT pt;
- RECT rcParent;
+ RECT rcParent, rc = rcClient;
GetWindowRect(ctl->hwnd, &rcParent);
pt.x = rcParent.left;
@@ -284,11 +296,21 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) ScreenToClient(pcli->hwndContactList, &pt);
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
+ if (ctl->bIsTTButton) {
+ GetWindowRect(ctl->hwnd, &rcParent);
+ pt.x = rcParent.left;
+ pt.y = rcParent.top;
+
+ ScreenToClient(g_hwndToolbarFrame, &pt);
+ BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcToolbar, pt.x, pt.y, SRCCOPY);
+ }
+
if (IsThemeBackgroundPartiallyTransparent(ctl->hThemeButton, BP_PUSHBUTTON, state)) {
DrawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
}
DrawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
- } else {
+ }
+ else {
UINT uState = DFCS_BUTTONPUSH | ((ctl->stateId == PBS_HOT) ? DFCS_HOT : 0) | ((ctl->stateId == PBS_PRESSED) ? DFCS_PUSHED : 0);
if (ctl->bIsDefault && ctl->stateId == PBS_NORMAL)
uState |= DLGC_DEFPUSHBUTTON;
@@ -312,9 +334,10 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (ctl->iIcon)
ImageList_DrawEx(ctl->hIml, ctl->iIcon, hdcMem, ix, iy, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
else
- DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
ctl->sLabel.cx = ctl->sLabel.cy = 0;
- } else {
+ }
+ else {
GetTextExtentPoint32(hdcMem, ctl->szText, lstrlen(ctl->szText), &ctl->sLabel);
if (g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left)
@@ -326,10 +349,11 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (ctl->iIcon)
ImageList_DrawEx(ctl->hIml, ctl->iIcon, hdcMem, ix, iy, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
else
- DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
xOffset = ix + g_cxsmIcon + 4;
}
- } else if (ctl->hBitmap) {
+ }
+ else if (ctl->hBitmap) {
BITMAP bminfo;
int ix, iy;
@@ -349,11 +373,11 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) CopyRect(&rcText, &rcClient);
SetBkMode(hdcMem, TRANSPARENT);
// XP w/themes doesn't used the glossy disabled text. Is it always using COLOR_GRAYTEXT? Seems so.
- if ( !ctl->bIsSkinned)
+ if (!ctl->bIsSkinned)
SetTextColor(hdcMem, IsWindowEnabled(ctl->hwnd) || !ctl->hThemeButton ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_GRAYTEXT));
if (ctl->arrow)
- DrawState(hdcMem, NULL, NULL, (LPARAM) ctl->arrow, 0, rcClient.right - rcClient.left - 5 - g_cxsmIcon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - g_cysmIcon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
- DrawState(hdcMem, NULL, NULL, (LPARAM) ctl->szText, 0, xOffset + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + 1 : (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + (ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->sLabel.cx, ctl->sLabel.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - g_cxsmIcon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - g_cysmIcon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->szText, 0, xOffset + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + 1 : (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + (ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->sLabel.cx, ctl->sLabel.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
}
if (hOldFont)
SelectObject(hdcMem, hOldFont);
@@ -385,7 +409,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case BM_SETIMAGE:
- if ( !lParam)
+ if (!lParam)
break;
bct->hIml = 0;
@@ -432,14 +456,14 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case BUTTONSETIMLICON:
if (bct->hIconPrivate)
DestroyIcon(bct->hIconPrivate);
- bct->hIml = (HIMAGELIST) wParam;
- bct->iIcon = (int) lParam;
+ bct->hIml = (HIMAGELIST)wParam;
+ bct->iIcon = (int)lParam;
bct->hIcon = bct->hIconPrivate = 0;
InvalidateRect(bct->hwnd, NULL, TRUE);
break;
case BUTTONSETSKINNED:
- bct->bIsSkinned = lParam != 0;
+ bct->bIsSkinned = wParam != 0;
bct->bIsThemed = bct->bIsSkinned ? FALSE : bct->bIsThemed;
InvalidateRect(bct->hwnd, NULL, TRUE);
break;
@@ -448,10 +472,21 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR bct->buttonItem = (ButtonItem *)lParam;
break;
+ case BUTTONSETTTBUTTON:
+ bct->bIsTTButton = wParam != 0;
+ InvalidateRect(bct->hwnd, NULL, TRUE);
+ break;
+
case WM_NCHITTEST:
- switch( SendMessage(pcli->hwndContactList, WM_NCHITTEST, wParam, lParam)) {
- case HTLEFT: case HTRIGHT: case HTBOTTOM: case HTTOP:
- case HTTOPLEFT: case HTTOPRIGHT: case HTBOTTOMLEFT: case HTBOTTOMRIGHT:
+ switch (SendMessage(pcli->hwndContactList, WM_NCHITTEST, wParam, lParam)) {
+ case HTLEFT:
+ case HTRIGHT:
+ case HTBOTTOM:
+ case HTTOP:
+ case HTTOPLEFT:
+ case HTTOPRIGHT:
+ case HTBOTTOMLEFT:
+ case HTBOTTOMRIGHT:
return HTTRANSPARENT;
}
}
@@ -460,11 +495,72 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- // standard buttons are processed in the main window
- if (msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED) {
- int iCtrlId = ClcGetButtonId((HWND)lParam);
- if (iCtrlId)
- SendMessage(pcli->hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
+ switch (msg) {
+ case WM_ERASEBKGND:
+ return TRUE;
+
+ case WM_NCPAINT:
+ case WM_PAINT:
+ {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd, &ps);
+
+ RECT rc, rcClient;
+ GetClientRect(hwnd, &rc);
+ rcClient = rc;
+
+ if (cfg::dat.hdcToolbar) {
+ SelectObject(cfg::dat.hdcToolbar, cfg::dat.hbmToolbarOld);
+ DeleteObject(cfg::dat.hbmToolbar);
+ DeleteDC(cfg::dat.hdcToolbar);
+ cfg::dat.hdcToolbar = NULL;
+ }
+ cfg::dat.hdcToolbar = CreateCompatibleDC(hdc);
+ cfg::dat.hbmToolbar = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
+ cfg::dat.hbmToolbarOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcToolbar, cfg::dat.hbmToolbar));
+ HDC hdcMem = cfg::dat.hdcToolbar;
+ SetBkMode(hdcMem, TRANSPARENT);
+
+ if (cfg::dat.bWallpaperMode)
+ SkinDrawBg(hwnd, hdcMem);
+
+ StatusItems_t *item = arStatusItems[ID_EXTBKBUTTONBAR - ID_STATUS_OFFLINE];
+ if (item->IGNORED)
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
+ else {
+ rc.top += item->MARGIN_TOP;
+ rc.bottom -= item->MARGIN_BOTTOM;
+ rc.left += item->MARGIN_LEFT;
+ rc.right -= item->MARGIN_RIGHT;
+
+ DrawAlpha(hdcMem, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT,
+ item->GRADIENT, item->CORNER, item->BORDERSTYLE, item->imageItem);
+ }
+
+ BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, hdcMem, 0, 0, SRCCOPY);
+ ps.fErase = FALSE;
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
+
+ case WM_COMMAND:
+ if (HIWORD(wParam) == BN_CLICKED) {
+ int iCtrlId = ClcGetButtonId((HWND)lParam);
+ // standard buttons are processed in the main window
+ if (iCtrlId) {
+ SendMessage(pcli->hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
+ return 0;
+ }
+ }
+
+ case WM_DESTROY:
+ if (cfg::dat.hdcToolbar && lParam == NULL) { // lParam is NULL when toolbar frame is being deleted
+ SelectObject(cfg::dat.hdcToolbar, cfg::dat.hbmToolbarOld);
+ DeleteObject(cfg::dat.hbmToolbar);
+ DeleteDC(cfg::dat.hdcToolbar);
+ cfg::dat.hdcToolbar = NULL;
+ }
+ break;
}
return mir_callNextSubclass(hwnd, ToolbarWndProc, msg, wParam, lParam);
@@ -472,28 +568,40 @@ static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA static void CustomizeToolbar(HANDLE hButton, HWND hWnd, LPARAM)
{
- // we don't customize the toolbar window, only buttons
if (hButton == TTB_WINDOW_HANDLE) {
mir_subclassWindow(hWnd, ToolbarWndProc);
+
+ g_hwndToolbarFrame = hWnd;
+ TTBCtrl* pTBInfo = (TTBCtrl*)GetWindowLongPtr(hWnd, 0);
+ pTBInfo->bHardUpdate = FALSE;
+
InitDefaultButtons();
+ SetButtonToSkinned();
return;
}
SendMessage(hWnd, BUTTONSETCUSTOMPAINT, sizeof(MButtonExtension), (LPARAM)PaintWorker);
mir_subclassWindow(hWnd, TSButtonWndProc);
- MButtonExtension *bct = (MButtonExtension*) GetWindowLongPtr(hWnd, 0);
+ MButtonExtension *bct = (MButtonExtension*)GetWindowLongPtr(hWnd, 0);
int idx = getButtonIndex(hButton);
if (idx != -1) { // adding built-in button
BTNS[idx].hwndButton = hWnd;
if (BTNS[idx].isAction)
bct->bSendOnDown = true;
- if ( !BTNS[idx].isPush)
+ if (!BTNS[idx].isPush)
bct->bIsPushBtn = true;
}
+ else {
+ idx = getLastIndex();
+ BTNS[idx].hwndButton = hWnd;
+ BTNS[idx].pszButtonID = "plugin";
+ bool bSkinned = cfg::dat.bSkinnedButtonMode != 0;
+ CustomizeButton(hWnd, bSkinned, !bSkinned, bSkinned, true);
+ }
}
-void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat)
+void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat, bool bIsTTButton)
{
SendMessage(hWnd, BUTTONSETCUSTOMPAINT, sizeof(MButtonExtension), (LPARAM)PaintWorker);
mir_subclassWindow(hWnd, TSButtonWndProc);
@@ -501,6 +609,7 @@ void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat) SendMessage(hWnd, BUTTONSETSKINNED, bIsSkinned, 0);
SendMessage(hWnd, BUTTONSETASTHEMEDBTN, bIsThemed, 0);
SendMessage(hWnd, BUTTONSETASFLATBTN, bIsFlat, 0);
+ SendMessage(hWnd, BUTTONSETTTBUTTON, bIsTTButton, 0);
}
static int Nicer_CustomizeToolbar(WPARAM, LPARAM)
@@ -512,7 +621,7 @@ static int Nicer_CustomizeToolbar(WPARAM, LPARAM) static int Nicer_ReloadToolbar(WPARAM wParam, LPARAM)
{
PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
- if ( !_stricmp(pInfo->shortName, "TopToolBar"))
+ if (!_stricmp(pInfo->shortName, "TopToolBar"))
TopToolbar_SetCustomProc(CustomizeToolbar, 0);
return 0;
}
diff --git a/plugins/Clist_nicer/src/Include/Version.h b/plugins/Clist_nicer/src/Include/Version.h index d6dc34719a..6e24a0cd7e 100644 --- a/plugins/Clist_nicer/src/Include/Version.h +++ b/plugins/Clist_nicer/src/Include/Version.h @@ -1,14 +1,14 @@ -#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 9
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 9
#define __RELEASE_NUM 2
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
#define __PLUGIN_NAME "Clist nicer"
#define __FILENAME "Clist_nicer.dll"
-#define __DESCRIPTION "Displays contacts, event notifications, protocol status."
-#define __AUTHOR "Pixel, egoDust, cyreve, Nightwish"
+#define __DESCRIPTION "Displays contacts, event notifications, protocol status."
+#define __AUTHOR "Pixel, egoDust, cyreve, Nightwish"
#define __AUTHOREMAIL ""
-#define __AUTHORWEB "http://miranda-ng.org/p/Clist_nicer/"
-#define __COPYRIGHT "Copyright 2000-2010 Miranda-IM project"
+#define __AUTHORWEB "http://miranda-ng.org/p/Clist_nicer/"
+#define __COPYRIGHT "Copyright 2000-2010 Miranda-IM project"
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index ded525095d..e189de5904 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -22,49 +22,49 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define INTM_XSTATUSCHANGED (WM_USER+26)
-#define INTM_METACHANGEDEVENT (WM_USER+27)
-#define INTM_CODEPAGECHANGED (WM_USER+28)
-#define INTM_AVATARCHANGED (WM_USER+30)
-#define INTM_STATUSMSGCHANGED (WM_USER+31)
-#define INTM_SORTCLC (WM_USER+32)
-#define INTM_STATUSCHANGED (WM_USER+33)
-#define INTM_METACHANGED (WM_USER+34)
-#define INTM_INVALIDATECONTACT (WM_USER+35)
+#define INTM_XSTATUSCHANGED (WM_USER+26)
+#define INTM_METACHANGEDEVENT (WM_USER+27)
+#define INTM_CODEPAGECHANGED (WM_USER+28)
+#define INTM_AVATARCHANGED (WM_USER+30)
+#define INTM_STATUSMSGCHANGED (WM_USER+31)
+#define INTM_SORTCLC (WM_USER+32)
+#define INTM_STATUSCHANGED (WM_USER+33)
+#define INTM_METACHANGED (WM_USER+34)
+#define INTM_INVALIDATECONTACT (WM_USER+35)
#define INTM_FORCESORT (WM_USER+36)
-#define DEFAULT_TITLEBAR_HEIGHT 18
+#define DEFAULT_TITLEBAR_HEIGHT 18
-#define CLS_SKINNEDFRAME 0x0800 //this control will be the main contact list (v. 0.3.4.3+ 2004/11/02)
+#define CLS_SKINNEDFRAME 0x0800 //this control will be the main contact list (v. 0.3.4.3+ 2004/11/02)
-#define TIMERID_RENAME 10
-#define TIMERID_DRAGAUTOSCROLL 11
-#define TIMERID_INFOTIP 13
-#define TIMERID_SORT 15
-#define TIMERID_REFRESH 18
-#define TIMERID_PAINT 19
+#define TIMERID_RENAME 10
+#define TIMERID_DRAGAUTOSCROLL 11
+#define TIMERID_INFOTIP 13
+#define TIMERID_SORT 15
+#define TIMERID_REFRESH 18
+#define TIMERID_PAINT 19
-#define CONTACTF_ONLINE 1
-//#define CONTACTF_INVISTO 2
-//#define CONTACTF_VISTO 4
-#define CONTACTF_NOTONLIST 8
-#define CONTACTF_CHECKED 16
-#define CONTACTF_IDLE 32
-#define CONTACTF_STICKY 64
-#define CONTACTF_PRIORITY 128
+#define CONTACTF_ONLINE 1
+//#define CONTACTF_INVISTO 2
+//#define CONTACTF_VISTO 4
+#define CONTACTF_NOTONLIST 8
+#define CONTACTF_CHECKED 16
+#define CONTACTF_IDLE 32
+#define CONTACTF_STICKY 64
+#define CONTACTF_PRIORITY 128
-#define STATUSMSG_XSTATUSID 1
-#define STATUSMSG_XSTATUSNAME 2
-#define STATUSMSG_CLIST 4
-#define STATUSMSG_YIM 8
-#define STATUSMSG_GG 16
-#define STATUSMSG_XSTATUS 32
+#define STATUSMSG_XSTATUSID 1
+#define STATUSMSG_XSTATUSNAME 2
+#define STATUSMSG_CLIST 4
+#define STATUSMSG_YIM 8
+#define STATUSMSG_GG 16
+#define STATUSMSG_XSTATUS 32
-#define STATUSMSG_NOTFOUND 0
+#define STATUSMSG_NOTFOUND 0
-#define SMSG_MAXLEN 700
+#define SMSG_MAXLEN 700
-#define EXTRAIMAGECACHESIZE 1000
+#define EXTRAIMAGECACHESIZE 1000
// extra cache contact flags
@@ -94,65 +94,65 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* Extra icons settings */
typedef struct _OrderTreeData
{
- BYTE ID;
+ BYTE ID;
const TCHAR * Name;
- BYTE Position;
- BOOL Visible;
- BOOL fReserved;
+ BYTE Position;
+ BOOL Visible;
+ BOOL fReserved;
} *PORDERTREEDATA, ORDERTREEDATA;
struct TExtraCache
{
- MCONTACT hContact;
- HANDLE hTimeZone;
- BYTE valid;
- TCHAR *statusMsg;
- BYTE bStatusMsgValid;
- DWORD dwCFlags;
- DWORD dwDFlags; // display flags for caching only
- StatusItems_t *status_item, *proto_status_item;
- DWORD dwLastMsgTime;
- DWORD msgFrequency;
- BOOL isChatRoom;
+ MCONTACT hContact;
+ HANDLE hTimeZone;
+ BYTE valid;
+ TCHAR *statusMsg;
+ BYTE bStatusMsgValid;
+ DWORD dwCFlags;
+ DWORD dwDFlags; // display flags for caching only
+ StatusItems_t *status_item, *proto_status_item;
+ DWORD dwLastMsgTime;
+ DWORD msgFrequency;
+ BOOL isChatRoom;
};
struct ClcContact : public ClcContactBase
{
- BOOL bIsMeta;
- BYTE xStatus;
- int xStatusIcon;
- MCONTACT hSubContact;
- char *metaProto;
- DWORD codePage;
- WORD wStatus;
- int avatarLeft, extraIconRightBegin;
- int isRtl;
- DWORD cFlags;
- BYTE bSecondLine;
-
- avatarCacheEntry *ace;
- TExtraCache* pExtra;
+ BOOL bIsMeta;
+ BYTE xStatus;
+ int xStatusIcon;
+ MCONTACT hSubContact;
+ char *metaProto;
+ DWORD codePage;
+ WORD wStatus;
+ int avatarLeft, extraIconRightBegin;
+ int isRtl;
+ DWORD cFlags;
+ BYTE bSecondLine;
+
+ avatarCacheEntry *ace;
+ TExtraCache* pExtra;
};
-#define DRAGSTAGE_NOTMOVED 0
-#define DRAGSTAGE_ACTIVE 1
-#define DRAGSTAGEM_STAGE 0x00FF
-#define DRAGSTAGEF_MAYBERENAME 0x8000
-#define DRAGSTAGEF_OUTSIDE 0x4000
-
-#define FONTID_CONTACTS 0
-#define FONTID_INVIS 1
-#define FONTID_OFFLINE 2
-#define FONTID_NOTONLIST 3
-#define FONTID_GROUPS 4
-#define FONTID_GROUPCOUNTS 5
-#define FONTID_DIVIDERS 6
-#define FONTID_OFFINVIS 7
-#define FONTID_STATUS 8
-#define FONTID_FRAMETITLE 9
-#define FONTID_EVENTAREA 10
-#define FONTID_TIMESTAMP 11
-#define FONTID_LAST FONTID_TIMESTAMP
+#define DRAGSTAGE_NOTMOVED 0
+#define DRAGSTAGE_ACTIVE 1
+#define DRAGSTAGEM_STAGE 0x00FF
+#define DRAGSTAGEF_MAYBERENAME 0x8000
+#define DRAGSTAGEF_OUTSIDE 0x4000
+
+#define FONTID_CONTACTS 0
+#define FONTID_INVIS 1
+#define FONTID_OFFLINE 2
+#define FONTID_NOTONLIST 3
+#define FONTID_GROUPS 4
+#define FONTID_GROUPCOUNTS 5
+#define FONTID_DIVIDERS 6
+#define FONTID_OFFINVIS 7
+#define FONTID_STATUS 8
+#define FONTID_FRAMETITLE 9
+#define FONTID_EVENTAREA 10
+#define FONTID_TIMESTAMP 11
+#define FONTID_LAST FONTID_TIMESTAMP
struct ClcData : public ClcDataBase
{
@@ -172,7 +172,7 @@ struct ClcData : public ClcDataBase BOOL bNeedPaint, bisEmbedded, bHideSubcontacts;
DWORD lastRepaint;
BOOL forceScroll;
- int oldSelection;
+ int oldSelection;
};
//#define CLUI_FRAME_SHOWTOPBUTTONS 1
@@ -192,21 +192,21 @@ struct ClcData : public ClcDataBase #define CLUI_FULLROWSELECT 16384
#define CLUI_FRAME_EVENTAREASUNKEN 32768
//#define CLUI_FRAME_BUTTONBARSUNKEN 65536
-#define CLUI_FRAME_AVATARS 0x20000
-#define CLUI_FRAME_AVATARSLEFT 0x40000
-#define CLUI_FRAME_GDIPLUS 0x80000
-#define CLUI_FRAME_AVATARBORDER 0x100000
-#define CLUI_FRAME_STATUSICONS 0x200000
-#define CLUI_FRAME_AVATARSRIGHTWITHNICK 0x400000
-#define CLUI_FRAME_TRANSPARENTAVATAR 0x800000
-#define CLUI_FRAME_ROUNDAVATAR 0x1000000
-#define CLUI_FRAME_ALWAYSALIGNNICK 0x2000000
-#define CLUI_FRAME_AVATARSRIGHT 0x4000000
-#define CLUI_FRAME_SHOWSTATUSMSG 0x8000000
-#define CLUI_FRAME_OVERLAYICONS 0x10000000
-#define CLUI_FRAME_SELECTIVEICONS 0x20000000
-#define CLUI_FRAME_ROUNDEDFRAME 0x40000000
-#define CLUI_FRAME_NOGROUPICON 0x80000000
+#define CLUI_FRAME_AVATARS 0x20000
+#define CLUI_FRAME_AVATARSLEFT 0x40000
+#define CLUI_FRAME_GDIPLUS 0x80000
+#define CLUI_FRAME_AVATARBORDER 0x100000
+#define CLUI_FRAME_STATUSICONS 0x200000
+#define CLUI_FRAME_AVATARSRIGHTWITHNICK 0x400000
+#define CLUI_FRAME_TRANSPARENTAVATAR 0x800000
+#define CLUI_FRAME_ROUNDAVATAR 0x1000000
+#define CLUI_FRAME_ALWAYSALIGNNICK 0x2000000
+#define CLUI_FRAME_AVATARSRIGHT 0x4000000
+#define CLUI_FRAME_SHOWSTATUSMSG 0x8000000
+#define CLUI_FRAME_OVERLAYICONS 0x10000000
+#define CLUI_FRAME_SELECTIVEICONS 0x20000000
+#define CLUI_FRAME_ROUNDEDFRAME 0x40000000
+#define CLUI_FRAME_NOGROUPICON 0x80000000
#define MULTIROW_NEVER 0
#define MULTIROW_ALWAYS 1
@@ -253,8 +253,10 @@ struct TCluiData { BYTE titleBarHeight;
BYTE bClipBorder, bRowSpacing;
HBITMAP bmpBackground, hbmBgOld, hbmBg;
+ HBITMAP hbmToolbar, hbmToolbarOld;
HDC hdcBg;
HDC hdcPic;
+ HDC hdcToolbar;
HBITMAP hbmPicOld;
BITMAP bminfoBg;
SIZE dcSize;
@@ -304,7 +306,7 @@ struct TCluiData { BYTE bSkinnedScrollbar;
DWORD langPackCP;
BOOL fOnDesktop;
- int group_padding;
+ int group_padding;
DWORD t_now;
BOOL realTimeSaving;
TCHAR tszProfilePath[MAX_PATH];
@@ -334,6 +336,14 @@ struct NotifyMenuItemExData { // #define NOTIFY_HEIGHT 24
+struct CluiTopButton {
+ int ctrlid;
+ char *pszButtonID, *pszButtonDn, *pszButtonName;
+ int isPush, isVis, isAction;
+ HANDLE hButton;
+ HWND hwndButton;
+};
+
struct TrayIconInfo {
union {
HICON hIcon;
@@ -370,12 +380,12 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat); size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut);
size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut);
-#define DROPTARGET_OUTSIDE 0
-#define DROPTARGET_ONSELF 1
-#define DROPTARGET_ONNOTHING 2
-#define DROPTARGET_ONGROUP 3
-#define DROPTARGET_ONCONTACT 4
-#define DROPTARGET_INSERTION 5
+#define DROPTARGET_OUTSIDE 0
+#define DROPTARGET_ONSELF 1
+#define DROPTARGET_ONNOTHING 2
+#define DROPTARGET_ONGROUP 3
+#define DROPTARGET_ONCONTACT 4
+#define DROPTARGET_INSERTION 5
int GetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
void LoadClcOptions(HWND hwnd, struct ClcData *dat);
void RecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
@@ -450,49 +460,67 @@ int Docking_IsDocked(WPARAM wParam, LPARAM lParam); // Buttons
-#define BUTTONSETIMLICON (WM_USER+20)
-#define BUTTONSETSKINNED (WM_USER+21)
-#define BUTTONSETBTNITEM (WM_USER+22)
+#define BUTTONSETIMLICON (WM_USER+20)
+#define BUTTONSETSKINNED (WM_USER+21)
+#define BUTTONSETBTNITEM (WM_USER+22)
+#define BUTTONSETTTBUTTON (WM_USER+23)
// Menus
void IMG_DeleteItems();
int CoolSB_SetupScrollBar();
-#define NIIF_INTERN_UNICODE 0x00000100
+#define NIIF_INTERN_UNICODE 0x00000100
-#define SETTING_WINDOWSTYLE_DEFAULT 0
+#define SETTING_WINDOWSTYLE_DEFAULT 0
-#define SETTING_TRAYICON_SINGLE 0
-#define SETTING_TRAYICON_CYCLE 1
-#define SETTING_TRAYICON_MULTI 2
+#define SETTING_TRAYICON_SINGLE 0
+#define SETTING_TRAYICON_CYCLE 1
+#define SETTING_TRAYICON_MULTI 2
-#define SETTING_STATE_HIDDEN 0
-#define SETTING_STATE_MINIMIZED 1
-#define SETTING_STATE_NORMAL 2
+#define SETTING_STATE_HIDDEN 0
+#define SETTING_STATE_MINIMIZED 1
+#define SETTING_STATE_NORMAL 2
-#define SETTING_BRINGTOFRONT_DEFAULT 0
+#define SETTING_BRINGTOFRONT_DEFAULT 0
-#define SETTING_WINDOWSTYLE_TOOLWINDOW 1
-#define SETTING_WINDOWSTYLE_THINBORDER 2
-#define SETTING_WINDOWSTYLE_NOBORDER 3
+#define SETTING_WINDOWSTYLE_TOOLWINDOW 1
+#define SETTING_WINDOWSTYLE_THINBORDER 2
+#define SETTING_WINDOWSTYLE_NOBORDER 3
-#define CLCHT_ONAVATAR 0x2000
-#define CLCHT_ONITEMSPACE 0x4000
+#define CLCHT_ONAVATAR 0x2000
+#define CLCHT_ONITEMSPACE 0x4000
-#define CLM_SETEXTRAIMAGEINT (CLM_FIRST+101)
-#define CLM_SETSTICKY (CLM_FIRST+100)
-#define CLM_ISMULTISELECT (CLM_FIRST+102)
-#define CLM_SETEXTRAIMAGEINTMETA (CLM_FIRST+104)
-#define CLM_GETSTATUSMSG (CLM_FIRST+105)
-#define CLM_SETHIDESUBCONTACTS (CLM_FIRST+106)
-#define CLM_TOGGLEPRIORITYCONTACT (CLM_FIRST+107)
-#define CLM_QUERYPRIORITYCONTACT (CLM_FIRST+108)
+#define CLM_SETEXTRAIMAGEINT (CLM_FIRST+101)
+#define CLM_SETSTICKY (CLM_FIRST+100)
+#define CLM_ISMULTISELECT (CLM_FIRST+102)
+#define CLM_SETEXTRAIMAGEINTMETA (CLM_FIRST+104)
+#define CLM_GETSTATUSMSG (CLM_FIRST+105)
+#define CLM_SETHIDESUBCONTACTS (CLM_FIRST+106)
+#define CLM_TOGGLEPRIORITYCONTACT (CLM_FIRST+107)
+#define CLM_QUERYPRIORITYCONTACT (CLM_FIRST+108)
-#define IDC_RESETMODES 110
-#define IDC_SELECTMODE 108
-#define IDC_CONFIGUREMODES 109
+#define IDC_RESETMODES 110
+#define IDC_SELECTMODE 108
+#define IDC_CONFIGUREMODES 109
#define NR_CLIENTS 40
typedef BOOL (WINAPI *PGF)(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG);
+
+#define IDC_STBHIDEOFFLINE IDC_TBHIDEOFFLINE - 20
+#define IDC_STBHIDEGROUPS IDC_TBHIDEGROUPS - 20
+#define IDC_STBSOUND IDC_TBSOUND - 20
+#define IDC_STBFINDANDADD IDC_TBFINDANDADD - 20
+#define IDC_STBOPTIONS IDC_TBOPTIONS - 20
+#define IDC_STBMINIMIZE IDC_TBMINIMIZE - 20
+#define IDC_STABSRMMSLIST IDC_TABSRMMSLIST - 20
+#define IDC_STABSRMMMENU IDC_TABSRMMMENU - 20
+#define IDC_STBSELECTVIEWMODE IDC_TBSELECTVIEWMODE - 20
+#define IDC_STBCLEARVIEWMODE IDC_TBCLEARVIEWMODE - 20
+#define IDC_STBCONFIGUREVIEWMODE IDC_TBCONFIGUREVIEWMODE - 20
+#define IDC_STBTOPMENU IDC_TBTOPMENU - 20
+#define IDC_STBTOPSTATUS IDC_TBTOPSTATUS - 20
+#define IDC_STBFOLDER IDC_TBFOLDER - 20
+#define IDC_STBPOPUP IDC_TBPOPUP - 20
+#define IDC_STBACCOUNTS IDC_TBACCOUNTS - 20
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index 215a8a003e..cdddfa0fab 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -83,4 +83,4 @@ BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem); void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, ImageItem *item);
-void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat);
+void CustomizeButton(HWND hWnd, bool bIsSkinned, bool bIsThemed, bool bIsFlat = false, bool bIsTTButton = false);
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 10a8546a3b..a4aecd563b 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -166,9 +166,10 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
}
- else if (!__strcmp(cws->szModule, "Skin")) {
+ else if (!__strcmp(cws->szModule, "Skin") && !__strcmp(cws->szSetting, "UseSound")) {
cfg::dat.soundsOff = cfg::getByte(cws->szModule, cws->szSetting, 0) ? 0 : 1;
- ClcSetButtonState(IDC_TBSOUND, cfg::dat.soundsOff ? BST_UNCHECKED : BST_CHECKED);
+ ClcSetButtonState(IDC_TBSOUND, cfg::dat.soundsOff ? BST_CHECKED : BST_UNCHECKED);
+ SetButtonStates(pcli->hwndContactList);
}
else if (szProto == NULL) {
if ( !__strcmp(cws->szSetting, "XStatusId"))
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index eef03b12d3..bc1ceab1e5 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -48,7 +48,7 @@ extern RECT old_window_rect, new_window_rect; extern BOOL g_trayTooltipActive;
extern POINT tray_hover_pos;
-extern HWND g_hwndViewModeFrame, g_hwndEventArea;
+extern HWND g_hwndViewModeFrame, g_hwndEventArea, g_hwndToolbarFrame;
extern ImageItem *g_CLUIImageItem;
extern HBRUSH g_CLUISkinnedBkColor;
@@ -88,38 +88,24 @@ HICON overlayicons[10]; static IconItem myIcons[] =
{
- { LPGEN("Toggle show online/offline"), "CLN_online", IDI_HIDEOFFLINE },
- { LPGEN("Toggle groups"), "CLN_groups", IDI_HIDEGROUPS },
- { LPGEN("Find contacts"), "CLN_findadd", IDI_FINDANDADD },
- { LPGEN("Open preferences"), "CLN_options", IDI_TBOPTIONS },
- { LPGEN("Toggle sounds"), "CLN_sound", IDI_SOUNDSON },
- { LPGEN("Minimize contact list"), "CLN_minimize", IDI_MINIMIZE },
- { LPGEN("Show TabSRMM session list"), "CLN_slist", IDI_TABSRMMSESSIONLIST },
- { LPGEN("Show TabSRMM menu"), "CLN_menu", IDI_TABSRMMMENU },
- { LPGEN("Sounds are off"), "CLN_soundsoff", IDI_SOUNDSOFF },
- { LPGEN("Select view mode"), "CLN_CLVM_select", IDI_CLVM_SELECT },
- { LPGEN("Reset view mode"), "CLN_CLVM_reset", IDI_DELETE },
- { LPGEN("Configure view modes"), "CLN_CLVM_options", IDI_CLVM_OPTIONS },
- { LPGEN("Show menu"), "CLN_topmenu", IDI_TBTOPMENU },
- { LPGEN("Setup accounts"), "CLN_accounts", IDI_TBACCOUNTS }
+ { LPGEN("Toggle show online/offline"), "CLN_online", IDI_HIDEOFFLINE },
+ { LPGEN("Toggle groups"), "CLN_groups", IDI_HIDEGROUPS },
+ { LPGEN("Find contacts"), "CLN_findadd", IDI_FINDANDADD },
+ { LPGEN("Open preferences"), "CLN_options", IDI_TBOPTIONS },
+ { LPGEN("Toggle sounds"), "CLN_sound", IDI_SOUNDSON },
+ { LPGEN("Minimize contact list"), "CLN_minimize", IDI_MINIMIZE },
+ { LPGEN("Show TabSRMM session list"), "CLN_slist", IDI_TABSRMMSESSIONLIST },
+ { LPGEN("Show TabSRMM menu"), "CLN_menu", IDI_TABSRMMMENU },
+ { LPGEN("Sounds are off"), "CLN_soundsoff", IDI_SOUNDSOFF },
+ { LPGEN("Select view mode"), "CLN_CLVM_select", IDI_CLVM_SELECT },
+ { LPGEN("Reset view mode"), "CLN_CLVM_reset", IDI_DELETE },
+ { LPGEN("Configure view modes"), "CLN_CLVM_options", IDI_CLVM_OPTIONS },
+ { LPGEN("Show menu"), "CLN_topmenu", IDI_TBTOPMENU },
+ { LPGEN("Setup accounts"), "CLN_accounts", IDI_TBACCOUNTS }
};
HWND hTbMenu, hTbGlobalStatus;
-/*
- * simple service for testing purpose
- * get the *proper* time zone offset for the given contact
- * only UserInfoEx can currently set real time zones
- *
- * This stuff should go into the core...
- *
- * returns: timediff for the contact in seconds. This value has inverted sign,
- * so you need to SUBTRACT it from your current time in order to get the correct
- * target time.
- *
- * If no real time zone is set, the service falls back to ordinary GMT offsets
- */
-
static void Tweak_It(COLORREF clr)
{
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
@@ -143,11 +129,21 @@ static void LayoutButtons(HWND hwnd, RECT *rc) rect.bottom -= cfg::dat.bCBottom;
+ if (g_ButtonItems) {
+ while (btnItems) {
+ LONG x = (btnItems->xOff >= 0) ? rect.left + btnItems->xOff : rect.right - abs(btnItems->xOff);
+ LONG y = (btnItems->yOff >= 0) ? rect.top + btnItems->yOff : rect.bottom - cfg::dat.statusBarHeight;
+
+ SetWindowPos(btnItems->hWnd, 0, x, y, btnItems->width, btnItems->height, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
+ btnItems = btnItems->nextItem;
+ }
+ }
+
SetWindowPos(hTbMenu, 0, 2 + left_offset, rect.bottom - cfg::dat.statusBarHeight - 21 - 1,
- 21 * 3, 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
+ 21 * 3, 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
SetWindowPos(hTbGlobalStatus, 0, left_offset + (3 * 21) + 3, rect.bottom - cfg::dat.statusBarHeight - 21 - 1,
- rect.right - delta - (3 * 21 + 5), 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
+ rect.right - delta - (3 * 21 + 5), 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
}
@@ -158,30 +154,24 @@ static int FS_FontsChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-/*
-* create the CLC control, but not yet the frame. The frame containing the CLC should be created as the
-* last frame of all.
-*/
-
+// create the CLC control, but not yet the frame. The frame containing the CLC should be created as the
+// last frame of all.
static HWND PreCreateCLC(HWND parent)
{
- pcli->hwndContactTree = CreateWindow( _T(CLISTCONTROL_CLASS), _T(""),
- WS_CHILD | CLS_CONTACTLIST
- | (cfg::getByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
- | CLS_HIDEOFFLINE
- //|(db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
- | (cfg::getByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
- | CLS_MULTICOLUMN
- , 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
+ pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), _T(""),
+ WS_CHILD | CLS_CONTACTLIST
+ | (cfg::getByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
+ | CLS_HIDEOFFLINE
+ //|(db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
+ | (cfg::getByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
+ | CLS_MULTICOLUMN
+ , 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
return pcli->hwndContactTree;
}
-/*
-* create internal frames, including the last frame (actual CLC control)
-*/
-
+// create internal frames, including the last frame (actual CLC control)
static int CreateCLC(HWND parent)
{
pcli->pfnReloadExtraIcons();
@@ -204,10 +194,9 @@ static int CreateCLC(HWND parent) HideShowNotifyFrame();
CreateViewModeFrame();
}
- SetButtonToSkinned();
{
- CLISTFrame Frame = { 0 };
+ CLISTFrame Frame = {0};
memset(&Frame, 0, sizeof(Frame));
Frame.cbSize = sizeof(CLISTFrame);
Frame.hWnd = pcli->hwndContactTree;
@@ -221,25 +210,18 @@ static int CreateCLC(HWND parent) //free(Frame.name);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME, hFrameContactTree), (LPARAM)Translate("My Contacts"));
- /*
- * ugly, but working hack. Prevent that annoying little scroll bar from appearing in the "My Contacts" title bar
- */
-
+ // ugly, but working hack. Prevent that annoying little scroll bar from appearing in the "My Contacts" title bar
DWORD flags = (DWORD)CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hFrameContactTree), 0);
flags |= F_VISIBLE;
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hFrameContactTree), flags);
}
+
+ SetButtonToSkinned();
return 0;
}
static int CluiModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- static const char *szPrefix = "clist_nicer_plus ";
-
- static char *component = "CList Nicer+";
- static char *szVersionUrl = "http://download.miranda.or.at/clist_nicer/0.9/versionW.txt";
- static char *szUpdateUrl = "http://download.miranda.or.at/clist_nicer/0.9/clist_nicer_plusW.zip";
-
FS_RegisterFonts();
HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
return 0;
@@ -282,13 +264,13 @@ static void InitIcoLib() PROTOACCOUNT **accs = NULL;
int p_count = 0;
- ProtoEnumAccounts( &p_count, &accs );
+ ProtoEnumAccounts(&p_count, &accs);
for (int k = 0; k < p_count; k++) {
- if ( !IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ if (!IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
TCHAR szDescr[128];
- mir_sntprintf(szDescr, SIZEOF(szDescr), TranslateT("%s Connecting"), accs[k]->tszAccountName );
+ mir_sntprintf(szDescr, SIZEOF(szDescr), TranslateT("%s Connecting"), accs[k]->tszAccountName);
IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING };
Icon_RegisterT(g_hInst, LPGENT("CList - Nicer/Connecting Icons"), &icon, 1, accs[k]->szModuleName);
}
@@ -302,25 +284,22 @@ static int IcoLibChanged(WPARAM wParam, LPARAM lParam) void CreateButtonBar(HWND hWnd)
{
- hTbMenu = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU) IDC_TBMENU, g_hInst, NULL);
+ hTbMenu = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBMENU, g_hInst, NULL);
CustomizeButton(hTbMenu, false, false, false);
SetWindowText(hTbMenu, TranslateT("Menu"));
- SendMessage(hTbMenu, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_OTHER_MAINMENU));
+ SendMessage(hTbMenu, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MAINMENU));
SendMessage(hTbMenu, BUTTONSETSENDONDOWN, TRUE, 0);
- SendMessage(hTbMenu, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Open main menu"), BATF_TCHAR);
+ SendMessage(hTbMenu, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open main menu"), BATF_TCHAR);
- hTbGlobalStatus = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU) IDC_TBGLOBALSTATUS, g_hInst, NULL);
+ hTbGlobalStatus = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBGLOBALSTATUS, g_hInst, NULL);
CustomizeButton(hTbGlobalStatus, false, false, false);
SetWindowText(hTbGlobalStatus, TranslateT("Offline"));
- SendMessage(hTbGlobalStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_STATUS_OFFLINE));
+ SendMessage(hTbGlobalStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_OFFLINE));
SendMessage(hTbGlobalStatus, BUTTONSETSENDONDOWN, TRUE, 0);
- SendMessage(hTbGlobalStatus, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Set status modes"), BATF_TCHAR);
+ SendMessage(hTbGlobalStatus, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Set status modes"), BATF_TCHAR);
}
-/*
-* if mode != 0 we do first time init, otherwise only reload the extra icon stuff
-*/
-
+// if mode != 0 we do first time init, otherwise only reload the extra icon stuff
void CLN_LoadAllIcons(BOOL mode)
{
if (mode) {
@@ -342,7 +321,8 @@ void ConfigureEventArea(HWND hwnd) cfg::dat.notifyActive = iCount > 0 ? 1 : 0;
else
cfg::dat.notifyActive = 1;
- } else
+ }
+ else
cfg::dat.notifyActive = 0;
if (oldstate != cfg::dat.notifyActive)
@@ -351,9 +331,9 @@ void ConfigureEventArea(HWND hwnd) void ConfigureFrame()
{
- int show = cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? SW_SHOW : SW_HIDE;
- ShowWindow(hTbMenu,show);
- ShowWindow(hTbGlobalStatus,show);
+ int show = cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? SW_SHOW : SW_HIDE;
+ ShowWindow(hTbMenu,show);
+ ShowWindow(hTbGlobalStatus, show);
}
void IcoLibReloadIcons()
@@ -381,7 +361,8 @@ void ConfigureCLUIGeometry(int mode) SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
GetWindowRect(pcli->hwndStatus, &rcStatus);
cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top);
- } else
+ }
+ else
cfg::dat.statusBarHeight = 0;
}
@@ -396,10 +377,7 @@ void ConfigureCLUIGeometry(int mode) }
}
-/*
- * set the states of defined database action buttons (only if button is a toggle)
-*/
-
+// set the states of defined database action buttons (only if button is a toggle)
void SetDBButtonStates(MCONTACT hPassedContact)
{
ButtonItem *buttonItem = g_ButtonItems;
@@ -418,7 +396,7 @@ void SetDBButtonStates(MCONTACT hPassedContact) while (buttonItem) {
BOOL result = FALSE;
- if ( !(buttonItem->dwFlags & BUTTON_ISTOGGLE && buttonItem->dwFlags & BUTTON_ISDBACTION)) {
+ if (!(buttonItem->dwFlags & BUTTON_ISTOGGLE && buttonItem->dwFlags & BUTTON_ISDBACTION)) {
buttonItem = buttonItem->nextItem;
continue;
}
@@ -433,17 +411,19 @@ void SetDBButtonStates(MCONTACT hPassedContact) if (buttonItem->dwFlags & BUTTON_ISCONTACTDBACTION)
szModule = GetContactProto(hContact);
hFinalContact = hContact;
- } else
+ }
+ else
hFinalContact = 0;
if (buttonItem->type == DBVT_ASCIIZ) {
DBVARIANT dbv = {0};
- if ( !cfg::getString(hFinalContact, szModule, szSetting, &dbv)) {
+ if (!cfg::getString(hFinalContact, szModule, szSetting, &dbv)) {
result = !strcmp((char *)buttonItem->bValuePush, dbv.pszVal);
db_free(&dbv);
}
- } else {
+ }
+ else {
switch (buttonItem->type) {
case DBVT_BYTE: {
BYTE val = cfg::getByte(hFinalContact, szModule, szSetting, 0);
@@ -467,6 +447,31 @@ void SetDBButtonStates(MCONTACT hPassedContact) }
}
+// set states of standard buttons (pressed/unpressed)
+void SetButtonStates(HWND hwnd)
+{
+ ButtonItem *buttonItem = g_ButtonItems;
+
+ if (g_ButtonItems) {
+ while (buttonItem) {
+ if (buttonItem->dwFlags & BUTTON_ISINTERNAL) {
+ switch (buttonItem->uId) {
+ case IDC_STBSOUND:
+ SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::dat.soundsOff ? BST_CHECKED : BST_UNCHECKED, 0);
+ break;
+ case IDC_STBHIDEOFFLINE:
+ SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::getByte("CList", "HideOffline", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ break;
+ case IDC_STBHIDEGROUPS:
+ SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::getByte("CList", "UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ break;
+ }
+ }
+ buttonItem = buttonItem->nextItem;
+ }
+ }
+}
+
void BlitWallpaper(HDC hdc, RECT *rc, RECT *rcPaint, struct ClcData *dat)
{
int x, y;
@@ -577,7 +582,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) if (disableautoupd)
return;
- if ( !cfg::getByte("CLUI", "AutoSize", 0))
+ if (!cfg::getByte("CLUI", "AutoSize", 0))
return;
if (Docking_IsDocked(0, 0))
@@ -684,7 +689,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) uItemID -= ID_STATUS_OFFLINE;
item = arStatusItems[uItemID];
- if ( !item->IGNORED) {
+ if (!item->IGNORED) {
int alpha = nmcsbcd->uState == CDIS_DISABLED ? item->ALPHA - 50 : item->ALPHA;
DrawAlpha(hdcScroll, &nmcsbcd->rect, item->COLOR, alpha, item->COLOR2, item->COLOR2_TRANSPARENT,
item->GRADIENT, item->CORNER, item->BORDERSTYLE, item->imageItem);
@@ -699,7 +704,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) arrowItem = arStatusItems[ID_EXTBKSCROLLARROWDOWN - ID_STATUS_OFFLINE];
if (arrowItem && !arrowItem->IGNORED)
DrawAlpha(hdcScroll, &nmcsbcd->rect, arrowItem->COLOR, arrowItem->ALPHA, arrowItem->COLOR2, arrowItem->COLOR2_TRANSPARENT,
- arrowItem->GRADIENT, arrowItem->CORNER, arrowItem->BORDERSTYLE, arrowItem->imageItem);
+ arrowItem->GRADIENT, arrowItem->CORNER, arrowItem->BORDERSTYLE, arrowItem->imageItem);
else if (arrowItem)
DrawFrameControl(hdcScroll, &nmcsbcd->rect, DFC_SCROLL, (nmcsbcd->uItem == HTSCROLL_UP ? DFCS_SCROLLUP : DFCS_SCROLLDOWN) | dfcFlags);
@@ -734,16 +739,18 @@ static void ShowCLUI(HWND hwnd) int onTop = cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT);
SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
- if ( !cfg::getByte("CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ if (!cfg::getByte("CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(pcli->hwndContactList, NULL);
if (state == SETTING_STATE_NORMAL) {
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL);
SendMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
- } else if (state == SETTING_STATE_MINIMIZED) {
+ }
+ else if (state == SETTING_STATE_MINIMIZED) {
cfg::dat.forceResize = TRUE;
ShowWindow(pcli->hwndContactList, SW_HIDE);
- } else if (state == SETTING_STATE_HIDDEN) {
+ }
+ else if (state == SETTING_STATE_HIDDEN) {
cfg::dat.forceResize = TRUE;
ShowWindow(pcli->hwndContactList, SW_HIDE);
}
@@ -789,7 +796,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l cfg::writeByte("CList", "State", SETTING_STATE_HIDDEN);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~WS_VISIBLE);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | WS_CLIPCHILDREN);
- if ( !cfg::dat.bFirstRun)
+ if (!cfg::dat.bFirstRun)
ConfigureEventArea(hwnd);
CluiProtocolStatusChanged(0, 0);
ConfigureCLUIGeometry(0);
@@ -832,13 +839,11 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
ShowWindow(pcli->hwndContactList, SW_HIDE);
style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT)
- {
+ if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) {
style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
style &= ~WS_EX_APPWINDOW;
}
- else
- {
+ else {
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
if (cfg::getByte("CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
@@ -852,7 +857,10 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
}
+ if (cfg::dat.bSkinnedButtonMode)
+ SetButtonToSkinned();
ConfigureFrame();
+ SetButtonStates(hwnd);
CreateCLC(hwnd);
cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
@@ -870,7 +878,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
DBVARIANT dbv = {0};
- if ( !db_get(NULL, "CList", "LastViewMode", &dbv)) {
+ if (!db_get(NULL, "CList", "LastViewMode", &dbv)) {
if (lstrlenA(dbv.pszVal) > 2) {
if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
ApplyViewMode((char *)dbv.pszVal);
@@ -878,19 +886,21 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l db_free(&dbv);
}
}
- if ( !cfg::dat.autosize)
+ if (!cfg::dat.autosize)
ShowCLUI(hwnd);
else {
show_on_first_autosize = TRUE;
RecalcScrollBar(pcli->hwndContactTree, cfg::clcdat);
}
return 0;
- }
+ }
case WM_ERASEBKGND:
return TRUE;
+ /*
if (cfg::dat.bSkinnedButtonMode)
return TRUE;
return DefWindowProc(hwnd, msg, wParam, lParam);
+ */
case WM_PAINT:
{
@@ -906,7 +916,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l GetClientRect(hwnd, &rcClient);
CopyRect(&rc, &rcClient);
- if ( !cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
+ if (!cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
RECT rcWorkArea;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
@@ -944,7 +954,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l GetWindowRect(hwnd, &rcWin);
BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
- } else
+ }
+ else
FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
}
@@ -952,7 +963,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int docked = CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0);
int clip = cfg::dat.bClipBorder;
- if ( !g_CLUISkinnedBkColor)
+ if (!g_CLUISkinnedBkColor)
FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
@@ -991,7 +1002,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (cfg::dat.bSkinnedButtonMode)
rcFrame.bottom -= (cfg::dat.bottomOffset);
DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT);
- } else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
+ }
+ else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
if (cfg::dat.bmpBackground)
BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
@@ -1046,7 +1058,7 @@ skipbg: return TRUE;
case WM_WINDOWPOSCHANGED:
- if ( Docking_IsDocked(0, 0))
+ if (Docking_IsDocked(0, 0))
break;
case WM_WINDOWPOSCHANGING:
@@ -1109,7 +1121,7 @@ skipbg: }
case WM_MOVE:
- if ( !IsIconic(hwnd)) {
+ if (!IsIconic(hwnd)) {
RECT rc;
GetWindowRect(hwnd, &rc);
@@ -1124,7 +1136,7 @@ skipbg: GetWindowRect(hwnd, &rc);
// if docked, dont remember pos (except for width)
- if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
cfg::writeDword("CList", "Height", (DWORD)(rc.bottom - rc.top));
cfg::writeDword("CList", "x", (DWORD) rc.left);
cfg::writeDword("CList", "y", (DWORD) rc.top);
@@ -1143,7 +1155,7 @@ skipbg: if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && cfg::getByte("CList", "AlwaysHideOnTB", 0))
RemoveFromTaskBar(hwnd);
return 0;
- }
+ }
case WM_ACTIVATE:
if (g_fading_active) {
if (wParam != WA_INACTIVE && cfg::dat.isTransparent)
@@ -1155,7 +1167,8 @@ skipbg: if (cfg::dat.isTransparent)
if (transparentFocus)
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
- } else {
+ }
+ else {
if (cfg::dat.isTransparent) {
KillTimer(hwnd, TM_AUTOALPHA);
SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
@@ -1168,7 +1181,7 @@ skipbg: case WM_SETCURSOR:
if (cfg::dat.isTransparent) {
- if ( !transparentFocus && GetForegroundWindow() != hwnd) {
+ if (!transparentFocus && GetForegroundWindow() != hwnd) {
SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
@@ -1193,14 +1206,16 @@ skipbg: if (pt.x > r.right - clip - 10)
return HTBOTTOMRIGHT;
- } else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
+ }
+ else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
return HTTOP;
if (pt.x < r.left + clip + 10)
return HTTOPLEFT;
if (pt.x > r.right - clip - 10)
return HTTOPRIGHT;
- } else if (pt.x >= r.left && pt.x <= r.left + clip + 6)
+ }
+ else if (pt.x >= r.left && pt.x <= r.left + clip + 6)
return HTLEFT;
else if (pt.x >= r.right - clip - 6 && pt.x <= r.right)
return HTRIGHT;
@@ -1210,10 +1225,10 @@ skipbg: if (cfg::dat.autosize)
return HTCLIENT;
return result;
- }
+ }
case WM_TIMER:
- if ((int) wParam == TM_AUTOALPHA) {
+ if ((int)wParam == TM_AUTOALPHA) {
int inwnd;
if (GetForegroundWindow() == hwnd) {
@@ -1223,8 +1238,8 @@ skipbg: else {
POINT pt;
HWND hwndPt;
- pt.x = (short) LOWORD(GetMessagePos());
- pt.y = (short) HIWORD(GetMessagePos());
+ pt.x = (short)LOWORD(GetMessagePos());
+ pt.y = (short)HIWORD(GetMessagePos());
hwndPt = WindowFromPoint(pt);
inwnd = (hwndPt == hwnd || GetParent(hwndPt) == hwnd);
}
@@ -1236,9 +1251,10 @@ skipbg: else
SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.autoalpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
}
- if ( !transparentFocus)
+ if (!transparentFocus)
KillTimer(hwnd, TM_AUTOALPHA);
- } else if (wParam == TIMERID_AUTOSIZE) {
+ }
+ else if (wParam == TIMERID_AUTOSIZE) {
KillTimer(hwnd, wParam);
SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
PostMessage(hwnd, WM_SIZE, 0, 0);
@@ -1271,7 +1287,7 @@ skipbg: return DefWindowProc(hwnd, msg, wParam, lParam);
if (noRecurse)
return DefWindowProc(hwnd, msg, wParam, lParam);
- if ( !cfg::dat.fadeinout)
+ if (!cfg::dat.fadeinout)
return DefWindowProc(hwnd, msg, wParam, lParam);
g_fading_active = 1;
@@ -1284,7 +1300,8 @@ skipbg: ShowWindow(hwnd, SW_SHOW);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
noRecurse = 0;
- } else {
+ }
+ else {
sourceAlpha = cfg::dat.isTransparent ? (transparentFocus ? cfg::dat.alpha : cfg::dat.autoalpha) : 255;
destAlpha = 0;
}
@@ -1303,7 +1320,7 @@ skipbg: case WM_SYSCOMMAND:
{
- BYTE bWindowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ BYTE bWindowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle) {
if (wParam == SC_RESTORE) {
CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
@@ -1397,7 +1414,8 @@ skipbg: pValue = fChecked ? item->bValueRelease : item->bValuePush;
if (fChecked && pValue[0] == 0)
fDelete = TRUE;
- } else
+ }
+ else
pValue = item->bValuePush;
if (fDelete)
@@ -1418,10 +1436,11 @@ skipbg: break;
}
}
- } else if (item->dwFlags & BUTTON_ISTOGGLE)
+ }
+ else if (item->dwFlags & BUTTON_ISTOGGLE)
SendMessage(item->hWnd, BM_SETCHECK, 0, 0);
}
- if ( !contactOK)
+ if (!contactOK)
MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat"), TranslateT("Parameter mismatch"), MB_OK);
if (serviceFailure) {
char szError[512];
@@ -1439,47 +1458,56 @@ skipbg: switch (LOWORD(wParam)) {
case IDC_TBMENU:
case IDC_TBTOPMENU:
+ case IDC_STBTOPMENU:
{
RECT rc;
- HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, NULL);
}
return 0;
case IDC_TBTOPSTATUS:
+ case IDC_STBTOPSTATUS:
case IDC_TBGLOBALSTATUS:
{
RECT rc;
HMENU hmenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc);
- TrackPopupMenu(hmenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, rc.top, 0, hwnd, NULL);
+ TrackPopupMenu(hmenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBGLOBALSTATUS ? rc.top : rc.bottom, 0, hwnd, NULL);
}
return 0;
case IDC_TBSOUND:
+ case IDC_STBSOUND:
cfg::dat.soundsOff = !cfg::dat.soundsOff;
cfg::writeByte("CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff);
cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
return 0;
case IDC_TBSELECTVIEWMODE:
+ case IDC_STBSELECTVIEWMODE:
SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_SELECTMODE, lParam);
break;
case IDC_TBCLEARVIEWMODE:
+ case IDC_STBCLEARVIEWMODE:
SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_RESETMODES, lParam);
break;
case IDC_TBCONFIGUREVIEWMODE:
+ case IDC_STBCONFIGUREVIEWMODE:
SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_CONFIGUREMODES, lParam);
break;
case IDC_TBFINDANDADD:
+ case IDC_STBFINDANDADD:
CallService(MS_FINDADD_FINDADD, 0, 0);
return 0;
case IDC_TBACCOUNTS:
+ case IDC_STBACCOUNTS:
CallService(MS_PROTO_SHOWACCMGR, 0, 0);
break;
case IDC_TBOPTIONS:
+ case IDC_STBOPTIONS:
CallService("Options/OptionsCommand", 0, 0);
return 0;
}
@@ -1497,6 +1525,7 @@ buttons_done: break;
case ID_TRAY_HIDE:
case IDC_TBMINIMIZE:
+ case IDC_STBMINIMIZE:
pcli->pfnShowHide(0, 0);
break;
case POPUP_NEWGROUP:
@@ -1506,6 +1535,7 @@ buttons_done: break;
case POPUP_HIDEOFFLINE:
case IDC_TBHIDEOFFLINE:
+ case IDC_STBHIDEOFFLINE:
CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
break;
case POPUP_HIDEOFFLINEROOT:
@@ -1519,6 +1549,7 @@ buttons_done: }
break;
case IDC_TBHIDEGROUPS:
+ case IDC_STBHIDEGROUPS:
case POPUP_DISABLEGROUPS:
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
@@ -1573,15 +1604,15 @@ buttons_done: break;
case WM_NOTIFY:
- if (((LPNMHDR) lParam)->hwndFrom == pcli->hwndContactTree) {
- switch (((LPNMHDR) lParam)->code) {
+ if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndContactTree) {
+ switch (((LPNMHDR)lParam)->code) {
case CLN_LISTSIZECHANGE:
sttProcessResize(hwnd, (NMCLISTCONTROL*)lParam);
return FALSE;
case NM_CLICK:
{
- NMCLISTCONTROL *nm = (NMCLISTCONTROL *) lParam;
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL *)lParam;
DWORD hitFlags;
HANDLE hItem;
@@ -1606,15 +1637,15 @@ buttons_done: RECT rc;
POINT pt;
- pt.x = (short) LOWORD(lParam);
- pt.y = (short) HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
// x/y might be -1 if it was generated by a kb click
GetWindowRect(pcli->hwndContactTree, &rc);
if (pt.x == -1 && pt.y == -1) {
// all this is done in screen-coords!
GetCursorPos(&pt);
// the mouse isnt near the window, so put it in the middle of the window
- if ( !PtInRect(&rc, pt)) {
+ if (!PtInRect(&rc, pt)) {
pt.x = rc.left + (rc.right - rc.left) / 2;
pt.y = rc.top + (rc.bottom - rc.top) / 2;
}
@@ -1649,7 +1680,7 @@ buttons_done: case WM_DRAWITEM:
{
- LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam;
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (hbmLockedPoint == 0) {
RECT rc = {0, 0, 5, 5};
@@ -1687,13 +1718,13 @@ buttons_done: cst.flags = CSSF_MASK_STATUS;
cst.status = &xStatus;
if (ProtoServiceExists(pd->RealName, PS_GETCUSTOMSTATUSEX) && !ProtoCallService(pd->RealName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cst) && xStatus > 0)
- hIcon = (HICON)CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set)
+ hIcon = (HICON)CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set)
else
hIcon = LoadSkinnedProtoIcon(szProto, status);
}
else hIcon = LoadSkinnedProtoIcon(szProto, status);
- if ( !(showOpts & 6) && cfg::dat.bEqualSections)
+ if (!(showOpts & 6) && cfg::dat.bEqualSections)
x = (dis->rcItem.left + dis->rcItem.right - 16) >> 1;
if (pd->protopos == 0)
x += (cfg::dat.bEqualSections ? (cfg::dat.bCLeft / 2) : cfg::dat.bCLeft);
@@ -1723,8 +1754,8 @@ buttons_done: if (showOpts & 2) {
TCHAR szName[64];
- PROTOACCOUNT *pa = ProtoGetAccount( szProto );
- if ( pa ) {
+ PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ if (pa) {
lstrcpyn( szName, pa->tszAccountName, SIZEOF(szName));
szName[ SIZEOF(szName)-1 ] = 0;
}
@@ -1793,12 +1824,10 @@ buttons_done: DeleteObject(hbmLockedPoint);
DeleteDC(hdcLockedPoint);
}
- /*
- * if this has not yet been set, do it now.
- * indicates that clist is shutting down and prevents various things
- * from happening at shutdown.
- */
- if ( !cfg::shutDown)
+ // if this has not yet been set, do it now.
+ // indicates that clist is shutting down and prevents various things
+ // from happening at shutdown.
+ if (!cfg::shutDown)
cfg::shutDown = 1;
CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)hFrameContactTree, 0);
break;
@@ -1907,7 +1936,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar static INT_PTR CLN_ShowAbout(WPARAM wParam, LPARAM lParam)
{
- if ( !g_AboutDlgActive)
+ if (!g_AboutDlgActive)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CLNABOUT), 0, DlgProcAbout, 0);
return 0;
}
@@ -1934,8 +1963,8 @@ static INT_PTR CLN_ShowStatusMenu(WPARAM wParam, LPARAM lParam) return 0;
}
-#define MS_CLUI_SHOWMAINMENU "CList/ShowMainMenu"
-#define MS_CLUI_SHOWSTATUSMENU "CList/ShowStatusMenu"
+#define MS_CLUI_SHOWMAINMENU "CList/ShowMainMenu"
+#define MS_CLUI_SHOWSTATUSMENU "CList/ShowStatusMenu"
void LoadCLUIModule(void)
{
@@ -1967,7 +1996,7 @@ void LoadCLUIModule(void) CreateServiceFunction(MS_CLUI_SHOWMAINMENU, CLN_ShowMainMenu);
CreateServiceFunction(MS_CLUI_SHOWSTATUSMENU, CLN_ShowStatusMenu);
- if ( cfg::getByte("CLUI", "FloaterMode", 0)) {
+ if (cfg::getByte("CLUI", "FloaterMode", 0)) {
MessageBox(NULL,
TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed"),
TranslateT("Warning"), MB_OK | MB_ICONWARNING);
@@ -1992,18 +2021,18 @@ struct }
static clistFontDescr[] =
{
- { LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
- { LPGENT("Groups"), FIDF_CLASSHEADER },
- { LPGENT("Group member counts"), FIDF_CLASSHEADER },
- { LPGENT("Dividers"), FIDF_CLASSSMALL },
- { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Status mode"), FIDF_CLASSGENERAL },
- { LPGENT("Frame titles"), FIDF_CLASSGENERAL },
- { LPGENT("Event area"), FIDF_CLASSGENERAL },
- { LPGENT("Contact list local time"), FIDF_CLASSGENERAL }
+ { LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
+ { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
+ { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
+ { LPGENT("Groups"), FIDF_CLASSHEADER },
+ { LPGENT("Group member counts"), FIDF_CLASSHEADER },
+ { LPGENT("Dividers"), FIDF_CLASSSMALL },
+ { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENT("Status mode"), FIDF_CLASSGENERAL },
+ { LPGENT("Frame titles"), FIDF_CLASSGENERAL },
+ { LPGENT("Event area"), FIDF_CLASSGENERAL },
+ { LPGENT("Contact list local time"), FIDF_CLASSGENERAL }
};
void FS_RegisterFonts()
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 0e49aea1bf..96663f2074 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <commonheaders.h>
TCluiData cfg::dat = {0};
-ClcData* cfg::clcdat = 0;
+ClcData* cfg::clcdat = 0;
static CRITICAL_SECTION cachecs;
LIST<TExtraCache> cfg::arCache(100, LIST<TExtraCache>::FTSortFunc(NumericKeySortT));
@@ -54,121 +54,104 @@ void cfg::init() DWORD cfg::getDword(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0)
{
- return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
+ return ((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
}
-/*
- * read a setting from our default module (Tab_SRMSG)
- */
-
+// read a setting from our default module (Tab_SRMSG)
DWORD cfg::getDword(const char *szSetting = 0, DWORD uDefault = 0)
{
- return((DWORD)db_get_dw(0, DEFAULT_MODULE, szSetting, uDefault));
+ return ((DWORD)db_get_dw(0, DEFAULT_MODULE, szSetting, uDefault));
}
-/*
- * read a setting from module only
- */
-
+// read a setting from module only
DWORD cfg::getDword(const char *szModule, const char *szSetting, DWORD uDefault)
{
- return((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
+ return ((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
}
WORD cfg::getWord(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD uDefault = 0)
{
- return((WORD)db_get_w(hContact, szModule, szSetting, uDefault));
+ return ((WORD)db_get_w(hContact, szModule, szSetting, uDefault));
}
-/*
- * read a setting from our default module (Tab_SRMSG)
- */
-
+// read a setting from our default module (Tab_SRMSG)
WORD cfg::getWord(const char *szSetting = 0, WORD uDefault = 0)
{
- return((WORD)db_get_w(0, DEFAULT_MODULE, szSetting, uDefault));
+ return ((WORD)db_get_w(0, DEFAULT_MODULE, szSetting, uDefault));
}
-/*
- * read a setting from module only
- */
-
+// read a setting from module only
WORD cfg::getWord(const char *szModule, const char *szSetting, WORD uDefault)
{
- return((WORD)db_get_w(0, szModule, szSetting, uDefault));
+ return ((WORD)db_get_w(0, szModule, szSetting, uDefault));
}
-/*
- * same for bytes now
- */
+// same for bytes now
int cfg::getByte(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0)
{
- return(db_get_b(hContact, szModule, szSetting, uDefault));
+ return (db_get_b(hContact, szModule, szSetting, uDefault));
}
int cfg::getByte(const char *szSetting = 0, int uDefault = 0)
{
- return(db_get_b(0, DEFAULT_MODULE, szSetting, uDefault));
+ return (db_get_b(0, DEFAULT_MODULE, szSetting, uDefault));
}
int cfg::getByte(const char *szModule, const char *szSetting, int uDefault)
{
- return(db_get_b(0, szModule, szSetting, uDefault));
+ return (db_get_b(0, szModule, szSetting, uDefault));
}
INT_PTR cfg::getTString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
- return(db_get_ts(hContact, szModule, szSetting, dbv));
+ return (db_get_ts(hContact, szModule, szSetting, dbv));
}
INT_PTR cfg::getString(const MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
- return(db_get_s(hContact, szModule, szSetting, dbv));
+ return (db_get_s(hContact, szModule, szSetting, dbv));
}
-/*
- * writer functions
- */
-
+// writer functions
INT_PTR cfg::writeDword(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
{
- return(db_set_dw(hContact, szModule, szSetting, value));
+ return (db_set_dw(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
{
- return(db_set_dw(0, szModule, szSetting, value));
+ return (db_set_dw(0, szModule, szSetting, value));
}
INT_PTR cfg::writeWord(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
{
- return(db_set_w(hContact, szModule, szSetting, value));
+ return (db_set_w(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeWord(const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
{
- return(db_set_w(0, szModule, szSetting, value));
+ return (db_set_w(0, szModule, szSetting, value));
}
INT_PTR cfg::writeByte(const MCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
{
- return(db_set_b(hContact, szModule, szSetting, value));
+ return (db_set_b(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
{
- return(db_set_b(0, szModule, szSetting, value));
+ return (db_set_b(0, szModule, szSetting, value));
}
INT_PTR cfg::writeTString(const MCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0)
{
- return(db_set_ts(hContact, szModule, szSetting, str));
+ return (db_set_ts(hContact, szModule, szSetting, str));
}
INT_PTR cfg::writeString(const MCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const char *str = 0)
{
- return(db_set_s(hContact, szModule, szSetting, str));
+ return (db_set_s(hContact, szModule, szSetting, str));
}
TExtraCache* cfg::getCache(const MCONTACT hContact, const char *szProto)
@@ -209,7 +192,7 @@ void CSH_Destroy() free(p->status_item);
p->status_item = 0;
- for (int j = i; j < cfg::arCache.getCount(); j++) // avoid duplicate free()'ing status item pointers (there are references from sub to master contacts, so compare the pointers...
+ for (int j = i; j < cfg::arCache.getCount(); j++) // avoid duplicate free()'ing status item pointers (there are references from sub to master contacts, so compare the pointers...
if (cfg::arCache[j]->status_item == item)
cfg::arCache[j]->status_item = 0;
}
@@ -228,7 +211,7 @@ void API::onInit() if (sysConfig.isVistaPlus) {
if ((hDwm = Utils::loadSystemLibrary(_T("\\dwmapi.dll")), true) != 0) {
pfnDwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled_t)GetProcAddress(hDwm, "DwmIsCompositionEnabled");
- pfnDwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea_t)GetProcAddress(hDwm,"DwmExtendFrameIntoClientArea");
+ pfnDwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea_t)GetProcAddress(hDwm, "DwmExtendFrameIntoClientArea");
}
}
@@ -274,7 +257,7 @@ INT_PTR CALLBACK API::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM {
WORD wNotifyCode, wID;
- switch(uMsg) {
+ switch (uMsg) {
case WM_INITDIALOG: {
char szBuffer[2048];
#ifdef _WIN64
@@ -301,8 +284,7 @@ INT_PTR CALLBACK API::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_COMMAND:
wNotifyCode = HIWORD(wParam);
wID = LOWORD(wParam);
- if (wNotifyCode == BN_CLICKED)
- {
+ if (wNotifyCode == BN_CLICKED) {
if (wID == IDOK || wID == IDCANCEL)
EndDialog(hwndDlg, wID);
@@ -323,7 +305,7 @@ void API::Ex_Handler() int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCHAR* szReason, bool fAllowContinue)
{
- char szDrive[MAX_PATH], szDir[MAX_PATH], szName[MAX_PATH], szExt[MAX_PATH];
+ char szDrive[MAX_PATH], szDir[MAX_PATH], szName[MAX_PATH], szExt[MAX_PATH];
_splitpath(szFile, szDrive, szDir, szName, szExt);
memcpy(&exRecord, ep->ExceptionRecord, sizeof(EXCEPTION_RECORD));
@@ -340,17 +322,13 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCH }
-/**
- * enable or disable a dialog control
- */
+// enable or disable a dialog control
void TSAPI Utils::enableDlgControl(const HWND hwnd, UINT id, BOOL fEnable)
{
::EnableWindow(::GetDlgItem(hwnd, id), fEnable);
}
-/**
- * show or hide a dialog control
- */
+// show or hide a dialog control
void TSAPI Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd)
{
::ShowWindow(::GetDlgItem(hwnd, id), showCmd);
@@ -364,8 +342,8 @@ void TSAPI Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) */
HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
{
- TCHAR sysPathName[MAX_PATH + 2];
- HMODULE _h = 0;
+ TCHAR sysPathName[MAX_PATH + 2];
+ HMODULE _h = 0;
try {
if (0 == ::GetSystemDirectory(sysPathName, MAX_PATH))
@@ -383,11 +361,11 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle) if (0 == _h)
throw(CRTException("Error while loading system library", szFilename));
}
- catch(CRTException& ex) {
+ catch (CRTException& ex) {
ex.display();
return 0;
}
- return(_h);
+ return (_h);
}
CRTException::CRTException(const char *szMsg, const TCHAR *szParam) : std::runtime_error(std::string(szMsg))
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 32131c3c8f..f28d97019b 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -275,6 +275,7 @@ int SetHideOffline(WPARAM wParam, LPARAM lParam) case -1:
cfg::writeByte("CList", "HideOffline", (BYTE) ! cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)); break;
}
+ SetButtonStates(pcli->hwndContactList);
LoadContactTree();
return 0;
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 8fa7588976..e6c9330b81 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int g_hottrack;
extern HWND g_hwndViewModeFrame;
+extern struct CluiTopButton BTNS[];
LIST<StatusItems_t> arStatusItems(10);
ImageItem *g_ImageItems = NULL, *g_glyphItem = NULL;
@@ -245,11 +246,11 @@ static StatusItems_t _StatusItems[] = { BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem)
{
int idx = status - ID_STATUS_OFFLINE; // better check the index...
- if ( idx < 0 || idx >= arStatusItems.getCount())
+ if (idx < 0 || idx >= arStatusItems.getCount())
idx = 0;
*retitem = *arStatusItems[idx];
- if (g_hottrack && status != ID_EXTBKHOTTRACK) // allow hottracking for ignored items, unless hottrack item itself should be ignored
+ if (g_hottrack && status != ID_EXTBKHOTTRACK) // allow hottracking for ignored items, unless hottrack item itself should be ignored
retitem->IGNORED = FALSE;
return TRUE;
}
@@ -261,7 +262,7 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto) for (int i = SIZEOF(_StatusItems); i < arStatusItems.getCount(); i++) {
StatusItems_t *p = arStatusItems[i];
- if ( !strcmp(p->szName[0] == '{' ? p->szName+3 : p->szName, szProto))
+ if (!strcmp(p->szName[0] == '{' ? p->szName+3 : p->szName, szProto))
return p;
}
return NULL;
@@ -271,22 +272,22 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto) void LoadExtBkSettingsFromDB()
{
int i, n;
- for (i=0; i < SIZEOF(_StatusItems); i++) {
- StatusItems_t *p = (StatusItems_t*)mir_alloc( sizeof(StatusItems_t));
+ for (i = 0; i < SIZEOF(_StatusItems); i++) {
+ StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t));
*p = _StatusItems[i];
arStatusItems.insert(p);
}
int protoCount;
PROTOACCOUNT **accs;
- ProtoEnumAccounts( &protoCount, &accs );
+ ProtoEnumAccounts(&protoCount, &accs);
for (i = 0; i < protoCount; i++) {
- StatusItems_t *p = (StatusItems_t*)mir_alloc( sizeof(StatusItems_t));
+ StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t));
*p = _StatusItems[0];
ID_EXTBK_LAST++;
- mir_snprintf(p->szDBname, 30, "EXBK_%s", accs[i]->szModuleName );
+ mir_snprintf(p->szDBname, 30, "EXBK_%s", accs[i]->szModuleName);
if (i == 0) {
lstrcpynA(p->szName, "{-}", 30);
strncat(p->szName, accs[i]->szModuleName, 30);
@@ -361,8 +362,17 @@ static void SaveCompleteStructToDB(void) void SetButtonToSkinned()
{
bool bSkinned = (cfg::dat.bSkinnedButtonMode = cfg::getByte("CLCExt", "bskinned", 0)) != 0;
- CustomizeButton( GetDlgItem(pcli->hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
- CustomizeButton( GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
+
+ for (int i = 0; ; i++) {
+ if (BTNS[i].pszButtonID == NULL)
+ break;
+ if (BTNS[i].hwndButton == 0 || BTNS[i].ctrlid == IDC_TBGLOBALSTATUS || BTNS[i].ctrlid == IDC_TBMENU)
+ continue;
+ CustomizeButton(BTNS[i].hwndButton, bSkinned, !bSkinned, bSkinned, true);
+ }
+
+ CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
SendMessage(g_hwndViewModeFrame, WM_USER + 100, 0, 0);
}
@@ -408,10 +418,7 @@ void SaveNonStatusItemsSettings(HWND hwndDlg) SetButtonToSkinned();
}
-/*
-* skin/theme related settings which are exported to/imported from the .ini style .clist file
-*/
-
+// skin/theme related settings which are exported to/imported from the .ini style .clist file
struct {char *szModule; char *szSetting; unsigned int size; int defaultval;} _tagSettings[] = {
"CLCExt", "3dbright", 4, RGB(224, 225, 225),
"CLCExt", "3ddark", 4, RGB(224, 225, 225),
@@ -474,7 +481,7 @@ void extbk_export(char *file) mir_snprintf(szSection, 255, "Font%d", n);
mir_snprintf(szKey, 255, "Font%dName", n);
- if ( !cfg::getString(NULL, "CLC", szKey, &dbv)) {
+ if (!cfg::getString(NULL, "CLC", szKey, &dbv)) {
WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file);
mir_free(dbv.pszVal);
}
@@ -504,24 +511,24 @@ void extbk_export(char *file) }
i = 0;
- while(_tagSettings[i].szModule != NULL) {
+ while (_tagSettings[i].szModule != NULL) {
data = 0;
- switch(_tagSettings[i].size) {
+ switch (_tagSettings[i].size) {
case 1:
- data = (DWORD)cfg::getByte( _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)_tagSettings[i].defaultval);
+ data = (DWORD)cfg::getByte(_tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)_tagSettings[i].defaultval);
break;
case 2:
- data = (DWORD)cfg::getWord( _tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
+ data = (DWORD)cfg::getWord(_tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
break;
case 4:
- data = (DWORD)cfg::getDword( _tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
+ data = (DWORD)cfg::getDword(_tagSettings[i].szModule, _tagSettings[i].szSetting, (DWORD)_tagSettings[i].defaultval);
break;
}
WritePrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
i++;
}
- if ( !cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file);
db_free(&dbv);
}
@@ -533,10 +540,10 @@ DWORD __fastcall HexStringToLong(const char *szSource) COLORREF clr = strtol(szSource, &stopped, 16);
if (clr == -1)
return clr;
- return(RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
+ return (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
}
-static StatusItems_t default_item = {
+static StatusItems_t default_item = {
"{--Contact--}", "", 0,
CLCDEFAULT_GRADIENT, CLCDEFAULT_CORNER,
CLCDEFAULT_COLOR, CLCDEFAULT_COLOR2, CLCDEFAULT_COLOR2_TRANSPARENT, -1,
@@ -603,25 +610,17 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap) for (y = 0; y < bmp.bmHeight; ++y) {
BYTE *px = p + bmp.bmWidth * 4 * y;
- for (x = 0; x < bmp.bmWidth; ++x)
- {
+ for (x = 0; x < bmp.bmWidth; ++x) {
if (px[3] != 0)
- {
fixIt = FALSE;
- }
else
- {
px[3] = 255;
- }
-
px += 4;
}
}
if (fixIt)
- {
SetBitmapBits(hBitmap, bmp.bmWidth * bmp.bmHeight * 4, p);
- }
free(p);
}
@@ -673,7 +672,7 @@ static void IMG_CreateItem(ImageItem *item, const char *fileName, HDC hdc) static void IMG_DeleteItem(ImageItem *item)
{
- if ( !(item->dwFlags & IMAGE_GLYPH)) {
+ if (!(item->dwFlags & IMAGE_GLYPH)) {
SelectObject(item->hdc, item->hbmOld);
DeleteObject(item->hbm);
DeleteDC(item->hdc);
@@ -694,7 +693,7 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) if (strcmp(buffer, "None")) {
for (int i = 0; i < arStatusItems.getCount(); i++) {
StatusItems_t *p = arStatusItems[i];
- if ( !_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
+ if (!_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
defaults = p;
break;
}
@@ -785,7 +784,7 @@ done_with_glyph: mir_snprintf(szFinalName, MAX_PATH, "%s\\%s\\%s", szDrive, szPath, buffer);
tmpItem.alpha = GetPrivateProfileIntA(itemname, "Alpha", 100, szFileName);
tmpItem.alpha = min(tmpItem.alpha, 100);
- tmpItem.alpha = (BYTE)((FLOAT)(((FLOAT) tmpItem.alpha) / 100) * 255);
+ tmpItem.alpha = (BYTE)((FLOAT)(((FLOAT)tmpItem.alpha) / 100) * 255);
tmpItem.bf.SourceConstantAlpha = tmpItem.alpha;
tmpItem.bLeft = GetPrivateProfileIntA(itemname, "Left", 0, szFileName);
tmpItem.bRight = GetPrivateProfileIntA(itemname, "Right", 0, szFileName);
@@ -814,7 +813,7 @@ done_with_glyph: COLORREF fillColor = HexStringToLong(buffer);
tmpItem.fillBrush = CreateSolidBrush(fillColor);
tmpItem.dwFlags |= IMAGE_FILLSOLID;
- }
+ }
else
tmpItem.fillBrush = 0;
@@ -827,7 +826,7 @@ done_with_glyph: tmpItem.bStretch = IMAGE_STRETCH_H;
tmpItem.hbm = 0;
- if ( !_stricmp(itemname, "$glyphs")) {
+ if (!_stricmp(itemname, "$glyphs")) {
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
@@ -838,7 +837,7 @@ done_with_glyph: goto imgread_done;
}
if (itemname[0] == '@') {
- if ( !(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
ImageItem *pItem = g_ImageItems;
@@ -852,20 +851,20 @@ done_with_glyph: else {
ImageItem *pItem = g_ImageItems;
- while(pItem->nextItem != 0)
+ while (pItem->nextItem != 0)
pItem = pItem->nextItem;
pItem->nextItem = newItem;
}
}
goto imgread_done;
}
- for (n = 0;;n++) {
+ for (n = 0; ; n++) {
mir_snprintf(szItemNr, 30, "Item%d", n);
GetPrivateProfileStringA(itemname, szItemNr, "None", buffer, 500, szFileName);
- if ( !strcmp(buffer, "None"))
+ if (!strcmp(buffer, "None"))
break;
- if ( !strcmp(buffer, "CLUI")) {
- if ( !(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!strcmp(buffer, "CLUI")) {
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
COLORREF clr;
@@ -887,9 +886,9 @@ done_with_glyph: }
for (i = 0; i < arStatusItems.getCount(); i++) {
StatusItems_t *p = arStatusItems[i];
- if ( !_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
- if ( !alloced) {
- if ( !(tmpItem.dwFlags & IMAGE_GLYPH))
+ if (!_stricmp(p->szName[0] == '{' ? p->szName+3 : p->szName, buffer)) {
+ if (!alloced) {
+ if (!(tmpItem.dwFlags & IMAGE_GLYPH))
IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
@@ -901,7 +900,7 @@ done_with_glyph: else {
ImageItem *pItem = g_ImageItems;
- while(pItem->nextItem != 0)
+ while (pItem->nextItem != 0)
pItem = pItem->nextItem;
pItem->nextItem = newItem;
}
@@ -925,14 +924,14 @@ void IMG_DeleteItems() int i;
- while(pItem) {
+ while (pItem) {
IMG_DeleteItem(pItem);
pNextItem = pItem->nextItem;
free(pItem);
pItem = pNextItem;
}
g_ImageItems = NULL;
- while(pbItem) {
+ while (pbItem) {
DestroyWindow(pbItem->hWnd);
pbNextItem = pbItem->nextItem;
free(pbItem);
@@ -974,11 +973,11 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.dwFlags |= GetPrivateProfileIntA(itemName, "toggle", 0, file) ? BUTTON_ISTOGGLE : 0;
GetPrivateProfileStringA(itemName, "Pressed", "None", szBuffer, 1000, file);
- if ( !_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgPressed = arStatusItems[ID_EXTBKTBBUTTONSPRESSED - ID_STATUS_OFFLINE]->imageItem;
else {
- while(imgItem) {
- if ( !_stricmp(imgItem->szName, szBuffer)) {
+ while (imgItem) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgPressed = imgItem;
break;
}
@@ -988,11 +987,11 @@ static void BTN_ReadItem(char *itemName, char *file) imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Normal", "None", szBuffer, 1000, file);
- if ( !_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgNormal = arStatusItems[ID_EXTBKTBBUTTONSNPRESSED - ID_STATUS_OFFLINE]->imageItem;
else {
- while(imgItem) {
- if ( !_stricmp(imgItem->szName, szBuffer)) {
+ while (imgItem) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgNormal = imgItem;
break;
}
@@ -1002,11 +1001,11 @@ static void BTN_ReadItem(char *itemName, char *file) imgItem = g_ImageItems;
GetPrivateProfileStringA(itemName, "Hover", "None", szBuffer, 1000, file);
- if ( !_stricmp(szBuffer, "default"))
+ if (!_stricmp(szBuffer, "default"))
tmpItem.imgHover = arStatusItems[ID_EXTBKTBBUTTONMOUSEOVER - ID_STATUS_OFFLINE]->imageItem;
else {
- while(imgItem) {
- if ( !_stricmp(imgItem->szName, szBuffer)) {
+ while (imgItem) {
+ if (!_stricmp(imgItem->szName, szBuffer)) {
tmpItem.imgHover = imgItem;
break;
}
@@ -1036,7 +1035,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = IDC_TBFIRSTUID - 1;
GetPrivateProfileStringA(itemName, "Action", "Custom", szBuffer, 1000, file);
- if ( !_stricmp(szBuffer, "service")) {
+ if (!_stricmp(szBuffer, "service")) {
tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None")) {
@@ -1045,7 +1044,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = nextButtonID++;
}
}
- else if ( !_stricmp(szBuffer, "protoservice")) {
+ else if (!_stricmp(szBuffer, "protoservice")) {
tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None")) {
@@ -1054,7 +1053,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = nextButtonID++;
}
}
- else if ( !_stricmp(szBuffer, "database")) {
+ else if (!_stricmp(szBuffer, "database")) {
int n;
GetPrivateProfileStringA(itemName, "Module", "None", szBuffer, 1000, file);
@@ -1074,7 +1073,7 @@ static void BTN_ReadItem(char *itemName, char *file) pValue = (n == 0 ? tmpItem.bValuePush : tmpItem.bValueRelease);
GetPrivateProfileStringA(itemName, szKey, "None", szBuffer, 1000, file);
- switch(szBuffer[0]) {
+ switch (szBuffer[0]) {
case 'b':
{
BYTE value = (BYTE)atol(&szBuffer[1]);
@@ -1097,11 +1096,9 @@ static void BTN_ReadItem(char *itemName, char *file) break;
}
case 's':
- {
- mir_snprintf((char *)pValue, 256, &szBuffer[1]);
- tmpItem.type = DBVT_ASCIIZ;
- break;
- }
+ mir_snprintf((char *)pValue, 256, &szBuffer[1]);
+ tmpItem.type = DBVT_ASCIIZ;
+ break;
}
}
if (tmpItem.szModule[0] && tmpItem.szSetting[0]) {
@@ -1111,6 +1108,18 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = nextButtonID++;
}
}
+ else if(_stricmp(szBuffer, "Custom")) {
+ int i = 0;
+
+ while (BTNS[i].ctrlid) {
+ if (!_stricmp(BTNS[i].pszButtonID, szBuffer)) {
+ tmpItem.uId = BTNS[i].ctrlid - 20;
+ tmpItem.dwFlags |= BUTTON_ISINTERNAL;
+ break;
+ }
+ i++;
+ }
+ }
GetPrivateProfileStringA(itemName, "PassContact", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None")) {
@@ -1122,10 +1131,8 @@ static void BTN_ReadItem(char *itemName, char *file) GetPrivateProfileStringA(itemName, "Tip", "None", szBuffer, 1000, file);
if (strcmp(szBuffer, "None")) {
-
MultiByteToWideChar(cfg::dat.langPackCP, 0, szBuffer, -1, tmpItem.szTip, 256);
tmpItem.szTip[255] = 0;
-
}
else
tmpItem.szTip[0] = 0;
@@ -1141,14 +1148,14 @@ static void BTN_ReadItem(char *itemName, char *file) }
else {
ButtonItem *curItem = g_ButtonItems;
- while(curItem->nextItem)
+ while (curItem->nextItem)
curItem = curItem->nextItem;
*newItem = tmpItem;
newItem->nextItem = 0;
curItem->nextItem = newItem;
}
newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, pcli->hwndContactList, (HMENU)newItem->uId, g_hInst, NULL);
- CustomizeButton(newItem->hWnd, false, false, false);
+ CustomizeButton(newItem->hWnd, false, false, true);
SendMessage(newItem->hWnd, BUTTONSETBTNITEM, 0, (LPARAM)newItem);
if (newItem->dwFlags & BUTTON_ISTOGGLE)
SendMessage(newItem->hWnd, BUTTONSETASPUSHBTN, TRUE, 0);
@@ -1165,22 +1172,20 @@ void IMG_LoadItems() DBVARIANT dbv;
char szFileName[MAX_PATH];
TCHAR tszFileName[MAX_PATH];
- int i = 0;
+ int i = 0;
if (cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv))
return;
MY_pathToAbsolute(dbv.ptszVal, tszFileName);
- /* TODO
- * rewrite the skin loading in TCHAR manner
- */
+ // TODO: rewrite the skin loading in TCHAR manner
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
db_free(&dbv);
- if ( !PathFileExists(tszFileName))
+ if (!PathFileExists(tszFileName))
return;
IMG_DeleteItems();
@@ -1192,18 +1197,20 @@ void IMG_LoadItems() szSections[3001] = szSections[3000] = 0;
p = szSections;
- while(lstrlenA(p) > 1) {
+ while (lstrlenA(p) > 1) {
if (p[0] == '$' || p[0] == '@')
IMG_ReadItem(p, szFileName);
p += (lstrlenA(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
p = szSections;
- while(lstrlenA(p) > 1) {
+ while (lstrlenA(p) > 1) {
if (p[0] == '!')
BTN_ReadItem(p, szFileName);
p += (lstrlenA(p) + 1);
}
+ if (pcli && pcli->hwndContactList)
+ SetButtonStates(pcli->hwndContactList);
free(szSections);
if (g_ImageItems) {
@@ -1229,7 +1236,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) StatusItems_t *items = NULL, *this_item;
int i = 1;
- char file[MAX_PATH];
+ char file[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, file, MAX_PATH, 0, 0);
file[MAX_PATH - 1] = 0;
@@ -1239,7 +1246,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) GetPrivateProfileSectionNamesA(szSections, 3000, file);
szSections[3001] = szSections[3000] = 0;
p = szSections;
- while(lstrlenA(p) > 1) {
+ while (lstrlenA(p) > 1) {
if (p[0] == '%') {
p += (lstrlenA(p) + 1);
continue;
@@ -1267,12 +1274,12 @@ void LoadPerContactSkins(TCHAR *tszFileName) continue;
char *uid = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR) uid != CALLSERVICE_NOTFOUND && uid != NULL) {
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid != NULL) {
DBVARIANT dbv = {0};
db_get(hContact, szProto, uid, &dbv);
char UIN[40];
- switch(dbv.type) {
+ switch (dbv.type) {
case DBVT_DWORD:
mir_snprintf(UIN, 40, "%d", dbv.dVal);
break;
@@ -1287,7 +1294,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) int j;
for (j = 0; j < i - 1; j++) {
- if ( !strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) &&
+ if (!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) &&
lstrlenA(szProto) == lstrlenA(items[j].szName) && lstrlenA(UIN) == lstrlenA(items[j].szDBname)) {
cfg::writeDword(hContact, "EXTBK", "TEXT", items[j].TEXTCOLOR);
cfg::writeDword(hContact, "EXTBK", "COLOR1", items[j].COLOR);
@@ -1310,7 +1317,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) break;
}
}
- if (j == i - 1) { // disable the db copy if it has been disabled in the skin .ini file
+ if (j == i - 1) { // disable the db copy if it has been disabled in the skin .ini file
if (cfg::getByte(hContact, "EXTBK", "VALID", 0))
cfg::writeByte(hContact, "EXTBK", "VALID", 0);
}
@@ -1395,10 +1402,10 @@ void extbk_import(char *file, HWND hwndDlg) char szString[MAX_PATH];
szString[0] = 0;
- while(_tagSettings[i].szModule != NULL) {
+ while (_tagSettings[i].szModule != NULL) {
data = 0;
GetPrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
- switch(_tagSettings[i].size) {
+ switch (_tagSettings[i].size) {
case 1:
cfg::writeByte(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, (BYTE)data);
break;
@@ -1406,7 +1413,7 @@ void extbk_import(char *file, HWND hwndDlg) cfg::writeDword(NULL, _tagSettings[i].szModule, _tagSettings[i].szSetting, data);
break;
case 2:
- cfg::writeWord( _tagSettings[i].szModule, _tagSettings[i].szSetting, (WORD)data);
+ cfg::writeWord(_tagSettings[i].szModule, _tagSettings[i].szSetting, (WORD)data);
break;
}
i++;
@@ -1418,21 +1425,22 @@ void extbk_import(char *file, HWND hwndDlg) Reload3dBevelColors();
ReloadThemedOptions();
+ SetButtonToSkinned();
// refresh
if (hwndDlg && ServiceExists(MS_CLNSE_FILLBYCURRENTSEL))
CallService(MS_CLNSE_FILLBYCURRENTSEL, (WPARAM)hwndDlg, 0);
pcli->pfnClcOptionsChanged();
ConfigureCLUIGeometry(1);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
static void ApplyCLUISkin()
{
- DBVARIANT dbv = {0};
- TCHAR tszFinalName[MAX_PATH];
- char szFinalName[MAX_PATH];
- if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ DBVARIANT dbv = {0};
+ TCHAR tszFinalName[MAX_PATH];
+ char szFinalName[MAX_PATH];
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
@@ -1454,49 +1462,48 @@ static void ApplyCLUISkin() static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case WM_INITDIALOG:
- {
- DBVARIANT dbv;
- TranslateDialogDefault(hwndDlg);
+ case WM_INITDIALOG: {
+ DBVARIANT dbv;
+ TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_EQUALSELECTION, (cfg::getByte("CLCExt", "EXBK_EqualSelection", 1) == 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SELBLEND, cfg::getByte("CLCExt", "EXBK_SelBlend", 1));
- CheckDlgButton(hwndDlg, IDC_SETALLBUTTONSKINNED, cfg::getByte("CLCExt", "bskinned", 0));
+ CheckDlgButton(hwndDlg, IDC_EQUALSELECTION, (cfg::getByte("CLCExt", "EXBK_EqualSelection", 1) == 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SELBLEND, cfg::getByte("CLCExt", "EXBK_SelBlend", 1));
+ CheckDlgButton(hwndDlg, IDC_SETALLBUTTONSKINNED, cfg::getByte("CLCExt", "bskinned", 0));
- SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
- SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETPOS, 0, cfg::dat.cornerRadius);
+ SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
+ SendDlgItemMessage(hwndDlg, IDC_CORNERSPIN, UDM_SETPOS, 0, cfg::dat.cornerRadius);
- SendDlgItemMessage(hwndDlg, IDC_GRPPADDINGSPIN, UDM_SETRANGE, 0, MAKELONG(20, 0));
- SendDlgItemMessage(hwndDlg, IDC_GRPPADDINGSPIN, UDM_SETPOS, 0, cfg::dat.group_padding);
+ SendDlgItemMessage(hwndDlg, IDC_GRPPADDINGSPIN, UDM_SETRANGE, 0, MAKELONG(20, 0));
+ SendDlgItemMessage(hwndDlg, IDC_GRPPADDINGSPIN, UDM_SETPOS, 0, cfg::dat.group_padding);
- SendDlgItemMessage(hwndDlg, IDC_LASTITEMPADDINGSPIN, UDM_SETRANGE, 0, MAKELONG(40, 0));
- SendDlgItemMessage(hwndDlg, IDC_LASTITEMPADDINGSPIN, UDM_SETPOS, 0, cfg::dat.titleBarHeight);
+ SendDlgItemMessage(hwndDlg, IDC_LASTITEMPADDINGSPIN, UDM_SETRANGE, 0, MAKELONG(40, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LASTITEMPADDINGSPIN, UDM_SETPOS, 0, cfg::dat.titleBarHeight);
- CheckDlgButton(hwndDlg, IDC_APPLYINDENTBG, cfg::dat.bApplyIndentToBg);
- CheckDlgButton(hwndDlg, IDC_USEPERPROTO, cfg::dat.bUsePerProto);
- CheckDlgButton(hwndDlg, IDC_OVERRIDEPERSTATUSCOLOR, cfg::dat.bOverridePerStatusColors);
- CheckDlgButton(hwndDlg, IDC_FASTGRADIENT, cfg::dat.bWantFastGradients);
- CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, cfg::getByte("CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_APPLYINDENTBG, cfg::dat.bApplyIndentToBg);
+ CheckDlgButton(hwndDlg, IDC_USEPERPROTO, cfg::dat.bUsePerProto);
+ CheckDlgButton(hwndDlg, IDC_OVERRIDEPERSTATUSCOLOR, cfg::dat.bOverridePerStatusColors);
+ CheckDlgButton(hwndDlg, IDC_FASTGRADIENT, cfg::dat.bWantFastGradients);
+ CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, cfg::getByte("CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
- if ( !cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal);
- db_free(&dbv);
- Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE);
- }
- else
- Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
- CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
- if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
- db_free(&dbv);
- }
- else
- SetDlgItemText(hwndDlg, IDC_SKINFILENAME, _T(""));
- return TRUE;
+ if (!cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal);
+ db_free(&dbv);
+ Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE);
+ }
+ else
+ Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
+ CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
+ db_free(&dbv);
}
+ else
+ SetDlgItemText(hwndDlg, IDC_SKINFILENAME, _T(""));
+ return TRUE;
+ }
case WM_COMMAND:
switch (LOWORD(wParam)) {
- case IDC_USESKIN:
+ case IDC_USESKIN:
{
int useskin = IsDlgButtonChecked(hwndDlg, IDC_USESKIN);
@@ -1506,13 +1513,14 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_UNLOAD:
IMG_DeleteItems();
ConfigureFrame();
+ SetButtonStates(pcli->hwndContactList);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
break;
case IDC_SELECTSKINFILE:
{
- OPENFILENAME ofn = {0};
- TCHAR str[MAX_PATH] = _T("*.clist"), final_path[MAX_PATH];
+ OPENFILENAME ofn = {0};
+ TCHAR str[MAX_PATH] = _T("*.clist"), final_path[MAX_PATH];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
@@ -1523,14 +1531,14 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.nMaxFile = MAX_PATH;
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = _T("");
- if ( !GetOpenFileName(&ofn))
+ if (!GetOpenFileName(&ofn))
break;
MY_pathToRelative(str, final_path);
if (PathFileExists(str)) {
int skinChanged = 0;
DBVARIANT dbv = {0};
- if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
if (_tcscmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
@@ -1549,7 +1557,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case IDC_RELOAD:
{
- TCHAR tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
+ TCHAR tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SKINFILE, tszFilename, MAX_PATH);
tszFilename[MAX_PATH - 1] = 0;
@@ -1568,9 +1576,9 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch (((LPNMHDR) lParam)->code) {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
SaveNonStatusItemsSettings(hwndDlg);
pcli->pfnClcOptionsChanged();
@@ -1589,7 +1597,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara static int iInit = TRUE;
static HWND hwndSkinEdit = 0;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
{
@@ -1604,13 +1612,13 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_SKIN), hwnd, DlgProcSkinOpts);
tci.pszText = TranslateT("Load and apply");
TabCtrl_InsertItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), 0, &tci);
- MoveWindow((HWND)tci.lParam,5,25,rcClient.right-9,rcClient.bottom-60,1);
+ MoveWindow((HWND)tci.lParam, 5, 25, rcClient.right - 9, rcClient.bottom - 60, 1);
ShowWindow((HWND)tci.lParam, oPage == 0 ? SW_SHOW : SW_HIDE);
if (IS_THEMED)
EnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- if ( ServiceExists(MS_CLNSE_INVOKE)) {
- SKINDESCRIPTION sd = { 0 };
+ if (ServiceExists(MS_CLNSE_INVOKE)) {
+ SKINDESCRIPTION sd = {0};
sd.cbSize = sizeof(sd);
sd.StatusItems = arStatusItems.getArray();
sd.hWndParent = hwnd;
@@ -1638,11 +1646,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara }
case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if ( !iInit)
+ if (!iInit)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_EXPORT:
{
char str[MAX_PATH] = "*.clist";
@@ -1656,7 +1664,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara ofn.nMaxFile = sizeof(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "clist";
- if ( !GetSaveFileNameA(&ofn))
+ if (!GetSaveFileNameA(&ofn))
break;
extbk_export(str);
break;
@@ -1675,7 +1683,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara ofn.nMaxFile = sizeof(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "";
- if ( !GetOpenFileNameA(&ofn))
+ if (!GetOpenFileNameA(&ofn))
break;
extbk_import(str, hwndSkinEdit);
SendMessage(hwndSkinEdit, WM_USER + 101, 0, 0);
@@ -1684,7 +1692,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara }
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
@@ -1692,10 +1700,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara TCITEM tci;
int i,count;
tci.mask = TCIF_PARAM;
- count = TabCtrl_GetItemCount(GetDlgItem(hwnd,IDC_OPTIONSTAB));
- for (i=0;i<count;i++) {
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),i,&tci);
- SendMessage((HWND)tci.lParam,WM_NOTIFY,0,lParam);
+ count = TabCtrl_GetItemCount(GetDlgItem(hwnd, IDC_OPTIONSTAB));
+ for (i = 0; i < count; i++) {
+ TabCtrl_GetItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), i, &tci);
+ SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam);
}
}
break;
@@ -1707,16 +1715,16 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara {
TCITEM tci;
tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),TabCtrl_GetCurSel(GetDlgItem(hwnd,IDC_OPTIONSTAB)),&tci);
- ShowWindow((HWND)tci.lParam,SW_HIDE);
+ TabCtrl_GetItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)), &tci);
+ ShowWindow((HWND)tci.lParam, SW_HIDE);
}
break;
case TCN_SELCHANGE:
{
TCITEM tci;
tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),TabCtrl_GetCurSel(GetDlgItem(hwnd,IDC_OPTIONSTAB)),&tci);
- ShowWindow((HWND)tci.lParam,SW_SHOW);
+ TabCtrl_GetItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)), &tci);
+ ShowWindow((HWND)tci.lParam, SW_SHOW);
cfg::writeByte("CLUI", "opage", (BYTE)TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)));
Utils::enableDlgControl(hwnd, IDC_EXPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
Utils::enableDlgControl(hwnd, IDC_IMPORT, TabCtrl_GetCurSel(GetDlgItem(hwnd, IDC_OPTIONSTAB)) != 0);
@@ -1751,7 +1759,7 @@ int CoolSB_SetupScrollBar() !arStatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE]->IGNORED;
- if ( !arStatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE]->imageItem ||
+ if (!arStatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE]->imageItem ||
!arStatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE]->imageItem ||
!arStatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE]->imageItem ||
!arStatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE]->imageItem ||
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index c2841295d5..e8726d7194 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -255,7 +255,7 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS |
CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
cfg::dat.dwFlags |= (cfg::getByte("CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0);
- cfg::dat.soundsOff = cfg::getByte("CLUI", "NoSounds", 0);
+ cfg::dat.soundsOff = cfg::getByte("Skin", "UseSound", 1) ? 0 : 1;
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
_tcslwr(cfg::dat.tszProfilePath);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 0be4ed7741..9f9f7e6189 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -74,7 +74,7 @@ void CLVM_EnumModes(pfnEnumCallback EnumCallback) dbces.szModule = CLVM_MODULE;
dbces.ofsSettings=0;
dbces.lParam = (LPARAM)EnumCallback;
- CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
+ CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
}
int FillModes(char *szsetting)
@@ -98,19 +98,19 @@ static void ShowPage(HWND hwnd, int page) if (pageChange)
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
- switch(page) {
+ switch (page) {
case 0:
- while(_page1Controls[i] != 0)
+ while (_page1Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_SHOW);
i = 0;
- while(_page2Controls[i] != 0)
+ while (_page2Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_HIDE);
break;
case 1:
- while(_page1Controls[i] != 0)
+ while (_page1Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_HIDE);
i = 0;
- while(_page2Controls[i] != 0)
+ while (_page2Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_SHOW);
break;
}
@@ -124,7 +124,7 @@ static int UpdateClistItem(MCONTACT hContact, DWORD mask) {
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hContact, MAKELONG(i - ID_STATUS_OFFLINE,
- (1 << (i - ID_STATUS_OFFLINE)) & mask ? i - ID_STATUS_OFFLINE : nullImage));
+ (1 << (i - ID_STATUS_OFFLINE)) & mask ? i - ID_STATUS_OFFLINE : nullImage));
return 0;
}
@@ -154,7 +154,7 @@ static void UpdateStickies() HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0);
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP, (LPARAM)hItem);
- while(hItem) {
+ while (hItem) {
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELONG(i - ID_STATUS_OFFLINE, nullImage));
hItem=(HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
@@ -181,7 +181,7 @@ static int FillDialog(HWND hwnd) ProtoEnumAccounts( &protoCount, &accs );
item.mask = LVIF_TEXT;
item.iItem = 1000;
- for (i=0; i < protoCount; i++) {
+ for (i = 0; i < protoCount; i++) {
item.pszText = accs[i]->tszAccountName;
ListView_InsertItem(hwndList, &item);
}
@@ -240,19 +240,19 @@ static int FillDialog(HWND hwnd) return 0;
}
-static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iImage)
+static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
{
int iOldIcon;
- HANDLE hItem,hChildItem;
+ HANDLE hItem, hChildItem;
- int typeOfFirst = SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
if (typeOfFirst == CLCIT_GROUP)
hItem = hFirstItem;
else
- hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
- while(hItem) {
- hChildItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ while (hItem) {
+ hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem)
SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
@@ -261,8 +261,8 @@ static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iIm if (typeOfFirst == CLCIT_CONTACT)
hItem = hFirstItem;
else
- hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
- while(hItem) {
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ while (hItem) {
iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
@@ -270,27 +270,27 @@ static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iIm }
}
-static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iColumn,int iImage)
+static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int iColumn, int iImage)
{
int itemType = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
if (itemType == CLCIT_CONTACT) {
int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
}
else if (itemType == CLCIT_INFO) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
if (hItem == hItemAll)
SetAllChildIcons(hwndList, hItem, iColumn, iImage);
else
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage)); //hItemUnknown
}
else if (itemType == CLCIT_GROUP) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItem)
SetAllChildIcons(hwndList, hItem, iColumn, iImage);
@@ -298,7 +298,7 @@ static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iCo }
void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
- unsigned int stickies, unsigned int operators, unsigned int lmdat)
+ unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
char szSetting[512];
@@ -318,10 +318,7 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr cfg::writeDword(CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
}
-/*
- * saves the state of the filter definitions for the current item
- */
-
+// saves the state of the filter definitions for the current item
void SaveState()
{
TCHAR newGroupFilter[2048] = _T("|");
@@ -387,7 +384,7 @@ void SaveState() DWORD dwGlobalMask, dwLocalMask;
BOOL translated;
- szModeName = ( char* )malloc(iLen + 1);
+ szModeName = (char*)malloc(iLen + 1);
if (szModeName) {
DWORD options, lmdat;
SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szModeName);
@@ -427,10 +424,7 @@ void SaveState() }
-/*
- * updates the filter list boxes with the data taken from the filtering string
- */
-
+// updates the filter list boxes with the data taken from the filtering string
void UpdateFilters()
{
DBVARIANT dbv_pf = {0};
@@ -441,7 +435,7 @@ void UpdateFilters() DWORD statusMask = 0, localMask = 0;
DWORD dwFlags;
DWORD opt;
- char szTemp[100];
+ char szTemp[100];
if (clvm_curItem == LB_ERR)
return;
@@ -493,6 +487,7 @@ void UpdateFilters() ListView_SetCheckState(hwndList, i, FALSE);
}
}
+
{
LVITEM item = {0};
TCHAR szTemp[256];
@@ -513,9 +508,10 @@ void UpdateFilters() if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
- ListView_SetCheckState(hwndList, i, FALSE);
+ ListView_SetCheckState(hwndList, i, FALSE);
}
}
+
{
HWND hwndList = GetDlgItem(clvmHwnd, IDC_STATUSMODES);
int i;
@@ -524,7 +520,7 @@ void UpdateFilters() if ((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, TRUE)
else
- ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
+ ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
}
}
SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_SETCURSEL, dwFlags & CLVM_PROTOGROUP_OP ? 1 : 0, 0);
@@ -563,7 +559,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
clvmHwnd = hwndDlg;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
{
int i = 0;
@@ -584,7 +580,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP DestroyIcon(hIcon);
GetClientRect(hwndDlg, &rcClient);
- tci.mask = TCIF_PARAM|TCIF_TEXT;
+ tci.mask = TCIF_PARAM | TCIF_TEXT;
tci.lParam = 0;
tci.pszText = Translate("Sticky contacts");
SendMessageA(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEMA, 0, (LPARAM)&tci);
@@ -613,7 +609,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP clvm_curItem = -1;
g_ViewModeOptDlg = TRUE;
i = 0;
- while(_page2Controls[i] != 0)
+ while (_page2Controls[i] != 0)
ShowWindow(GetDlgItem(hwndDlg, _page2Controls[i++]), SW_HIDE);
ShowWindow(hwndDlg, SW_SHOWNORMAL);
Utils::enableDlgControl(hwndDlg, IDC_APPLY, FALSE);
@@ -653,7 +649,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP char szSetting[256];
int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (iLen) {
- char *szBuf = ( char* )malloc(iLen + 1);
+ char *szBuf = (char*)malloc(iLen + 1);
if (szBuf) {
SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szBuf);
mir_snprintf(szSetting, 256, "%c%s_PF", 246, szBuf);
@@ -667,7 +663,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szBuf);
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szBuf);
- if ( !strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
+ if (!strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
cfg::dat.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowTextA(hwndSelector, Translate("No view mode"));
@@ -746,38 +742,38 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_NOTIFY:
{
- switch (((LPNMHDR) lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_GROUPS:
case IDC_STATUSMODES:
case IDC_PROTOCOLS:
case IDC_CLIST:
- if (((LPNMHDR) lParam)->code == NM_CLICK || ((LPNMHDR) lParam)->code == CLN_CHECKCHANGED)
+ if (((LPNMHDR)lParam)->code == NM_CLICK || ((LPNMHDR)lParam)->code == CLN_CHECKCHANGED)
Utils::enableDlgControl(hwndDlg, IDC_APPLY, TRUE);
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
{
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
- if (nm->iColumn==-1)
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
+ if (nm->iColumn == -1)
break;
DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST,CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if (hItem == NULL || !(hitFlags & CLCHT_ONITEMEXTRA))
break;
- int iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ int iImage = SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
if (iImage == nullImage)
iImage = nm->iColumn;
else if (iImage != EMPTY_EXTRA_ICON)
iImage = nullImage;
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_CLIST), hItem, hInfoItem, nm->iColumn, iImage);
break;
}
}
break;
case IDC_TAB:
- if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
+ if (((LPNMHDR)lParam)->code == TCN_SELCHANGE) {
int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
if (id == 0)
ShowPage(hwndDlg, 0);
@@ -826,34 +822,34 @@ void BuildViewModeMenu() struct
{
- UINT btn_id;
+ UINT btn_id;
LPCSTR icon;
}
static _buttons[] =
{
- { IDC_RESETMODES, "CLN_CLVM_reset" },
- { IDC_SELECTMODE, "CLN_CLVM_select" },
- { IDC_CONFIGUREMODES, "CLN_CLVM_options" }
+ { IDC_RESETMODES, "CLN_CLVM_reset" },
+ { IDC_SELECTMODE, "CLN_CLVM_select" },
+ { IDC_CONFIGUREMODES, "CLN_CLVM_options" }
};
LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_CREATE:
{
hwndSelector = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
+ hwnd, (HMENU)IDC_SELECTMODE, g_hInst, NULL);
CustomizeButton(hwndSelector, false, false, false);
SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_UNICODE);
SendMessage(hwndSelector, BUTTONSETSENDONDOWN, TRUE, 0);
HWND hwndButton = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
+ hwnd, (HMENU)IDC_CONFIGUREMODES, g_hInst, NULL);
CustomizeButton(hwndButton, false, false, false);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_UNICODE);
hwndButton = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_RESETMODES, g_hInst, NULL);
+ hwnd, (HMENU)IDC_RESETMODES, g_hInst, NULL);
CustomizeButton(hwndButton, false, false, false);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_UNICODE);
@@ -876,18 +872,18 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HDWP PosBatch = BeginDeferWindowPos(3);
GetClientRect(hwnd, &rcCLVMFrame);
PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
- rcCLVMFrame.right - 23, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ rcCLVMFrame.right - 24, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
- rcCLVMFrame.right - 45, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ rcCLVMFrame.right - 47, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
- 1, 1, rcCLVMFrame.right - 46, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ 2, 1, rcCLVMFrame.right - 50, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
EndDeferWindowPos(PosBatch);
break;
}
case WM_USER + 100:
{
bool bSkinned = cfg::getByte("CLCExt", "bskinned", 0) != 0;
- for (int i = 0; i < SIZEOF(_buttons); i++ ) {
+ for (int i = 0; i < SIZEOF(_buttons); i++) {
HWND hwndButton = GetDlgItem(hwnd, _buttons[i].btn_id);
SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon(_buttons[i].icon));
CustomizeButton(hwndButton, bSkinned, !bSkinned, bSkinned);
@@ -940,7 +936,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
KillTimer(hwnd, wParam);
- if ( !cfg::dat.old_viewmode[0])
+ if (!cfg::dat.old_viewmode[0])
SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
else
ApplyViewMode((const char *)cfg::dat.old_viewmode);
@@ -950,7 +946,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
case WM_COMMAND:
{
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_SELECTMODE:
{
RECT rc;
@@ -964,7 +960,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect((HWND)lParam, &rc);
pt.x = rc.left;
pt.y = rc.bottom;
- selection = TrackPopupMenu(hViewModeMenu,TPM_RETURNCMD|TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
+ selection = TrackPopupMenu(hViewModeMenu, TPM_RETURNCMD | TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
if (selection) {
if (selection == 10001)
@@ -988,13 +984,14 @@ clvm_reset_command: SetWindowTextA(GetDlgItem(hwnd, IDC_SELECTMODE), Translate("No view mode"));
CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)cfg::dat.boldHideOffline, 0);
cfg::dat.boldHideOffline = (BYTE)-1;
+ SetButtonStates(pcli->hwndContactList);
cfg::dat.current_viewmode[0] = 0;
cfg::dat.old_viewmode[0] = 0;
cfg::writeString(NULL, "CList", "LastViewMode", "");
break;
case IDC_CONFIGUREMODES:
clvm_config_command:
- if ( !g_ViewModeOptDlg)
+ if (!g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
break;
}
@@ -1022,7 +1019,7 @@ void CreateViewModeFrame() wndclass.hInstance = g_hInst;
wndclass.hIcon = 0;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH) (COLOR_3DFACE);
+ wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE);
wndclass.lpszMenuName = 0;
wndclass.lpszClassName = _T("CLVMFrameWindow");
@@ -1034,11 +1031,11 @@ void CreateViewModeFrame() frame.TBtname = TranslateT("View Modes");
frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
frame.height = 22;
- frame.Flags=F_VISIBLE|F_SHOWTBTIP|F_NOBORDER|F_TCHAR;
+ frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, _T("CLVMFrameWindow"), _T("CLVM"), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU) 0, g_hInst, NULL);
+ frame.hWnd = CreateWindowEx(0, _T("CLVMFrameWindow"), _T("CLVM"), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, NULL);
g_hwndViewModeFrame = frame.hWnd;
- hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&frame,0);
+ hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
}
@@ -1052,7 +1049,7 @@ void ApplyViewMode(const char *name) cfg::dat.bFilterEffective = 0;
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if ( !cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (lstrlenA(dbv.pszVal) >= 2) {
strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter));
cfg::dat.protoFilter[sizeof(cfg::dat.protoFilter) - 1] = 0;
@@ -1061,7 +1058,7 @@ void ApplyViewMode(const char *name) mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if ( !cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (lstrlen(dbv.ptszVal) >= 2) {
_tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter));
cfg::dat.groupFilter[SIZEOF(cfg::dat.groupFilter) - 1] = 0;
@@ -1114,7 +1111,7 @@ void ApplyViewMode(const char *name) cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
DWORD unit = LOWORD(cfg::dat.lastMsgFilter);
- switch(HIBYTE(HIWORD(cfg::dat.lastMsgFilter))) {
+ switch (HIBYTE(HIWORD(cfg::dat.lastMsgFilter))) {
case 0:
unit *= 60;
break;
@@ -1137,6 +1134,7 @@ void ApplyViewMode(const char *name) CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
SetWindowTextA(hwndSelector, name);
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
+ SetButtonStates(pcli->hwndContactList);
cfg::writeString(NULL, "CList", "LastViewMode", cfg::dat.current_viewmode);
}
|