diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-15 17:24:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-15 17:24:17 +0000 |
commit | 84932349d8a832c0a0b19092160a92d3110d6914 (patch) | |
tree | c75bcf9ff2da87f235456935ffd0709762dc3b2c /plugins/Clist_nicer/SRC | |
parent | 3744b5146df8530d3b43a972d58223cb3ffb533c (diff) |
adaptation of clist nicer for TTB, part I
git-svn-id: http://svn.miranda-ng.org/main/trunk@431 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/SRC')
-rw-r--r-- | plugins/Clist_nicer/SRC/CLCButton.cpp | 706 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clc.cpp | 27 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clcitems.cpp | 19 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clcopts.cpp | 10 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clcpaint.cpp | 19 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clcutils.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clistevents.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clistmod.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clistopts.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/clui.cpp | 493 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/contact.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/extBackg.cpp | 64 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/init.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_nicer/SRC/viewmodes.cpp | 30 |
14 files changed, 141 insertions, 1264 deletions
diff --git a/plugins/Clist_nicer/SRC/CLCButton.cpp b/plugins/Clist_nicer/SRC/CLCButton.cpp deleted file mode 100644 index 290484c62f..0000000000 --- a/plugins/Clist_nicer/SRC/CLCButton.cpp +++ /dev/null @@ -1,706 +0,0 @@ -/*
-Miranda IM
-Copyright (C) 2002 Robert Rainwater
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include <commonheaders.h>
-
-extern HINSTANCE g_hInst;
-extern LONG g_cxsmIcon, g_cysmIcon;
-extern StatusItems_t *StatusItems;
-extern ImageItem *g_glyphItem;
-
-static HWND hwndToolTips = NULL;
-
-typedef struct {
- HWND hwnd;
- int stateId; // button state
- int focus; // has focus (1 or 0)
- HFONT hFont; // font
- HICON arrow; // uses down arrow
- int defbutton; // default button
- HICON hIcon, hIconPrivate;
- HBITMAP hBitmap;
- int pushBtn;
- int pbState;
- HANDLE hThemeButton;
- HANDLE hThemeToolbar;
- BOOL bThemed;
- DWORD bSkinned;
- char cHot;
- int flatBtn;
- TCHAR szText[128];
- SIZE sLabel;
- HIMAGELIST hIml;
- int iIcon;
- BOOL bSendOnDown;
- ButtonItem *buttonItem;
- LONG lastGlyphMetrics[4];
-} MButtonCtrl;
-
-
-// Used for our own cheap TrackMouseEvent
-#define BUTTON_POLLID 100
-#define BUTTON_POLLDELAY 50
-
-#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
-
-static void DestroyTheme(MButtonCtrl *ctl)
-{
- if(API::pfnCloseThemeData) {
- if (ctl->hThemeButton) {
- API::pfnCloseThemeData(ctl->hThemeButton);
- ctl->hThemeButton = 0;
- }
- if (ctl->hThemeToolbar) {
- API::pfnCloseThemeData(ctl->hThemeToolbar);
- ctl->hThemeToolbar = 0;
- }
- ctl->bThemed = 0;
- }
-}
-
-static void LoadTheme(MButtonCtrl *ctl)
-{
- DestroyTheme(ctl);
- if (IS_THEMED) {
- ctl->hThemeButton = API::pfnOpenThemeData(ctl->hwnd, L"BUTTON");
- ctl->hThemeToolbar = API::pfnOpenThemeData(ctl->hwnd, L"TOOLBAR");
- ctl->bThemed = TRUE;
- }
-}
-
-static int TBStateConvert2Flat(int state)
-{
- switch (state) {
- case PBS_NORMAL:
- return TS_NORMAL;
- case PBS_HOT:
- return TS_HOT;
- case PBS_PRESSED:
- return TS_PRESSED;
- case PBS_DISABLED:
- return TS_DISABLED;
- case PBS_DEFAULTED:
- return TS_NORMAL;
- }
- return TS_NORMAL;
-}
-
-static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
-{
- if (hdcPaint) {
- HDC hdcMem;
- HBITMAP hbmMem;
- HBITMAP hbmOld = 0;
- RECT rcClient;
- HFONT hOldFont = 0;
- int xOffset = 0;
-
- GetClientRect(ctl->hwnd, &rcClient);
- hdcMem = CreateCompatibleDC(hdcPaint);
- hbmMem = CreateCompatibleBitmap(hdcPaint, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
- hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
-
- hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, ctl->hFont));
- // If its a push button, check to see if it should stay pressed
- if (ctl->pushBtn && ctl->pbState)
- ctl->stateId = PBS_PRESSED;
-
- // Draw the flat button
- if (ctl->flatBtn) {
- if (ctl->hThemeToolbar && ctl->bThemed) {
- RECT rc = rcClient;
- int state = IsWindowEnabled(ctl->hwnd) ? (ctl->stateId == PBS_NORMAL && ctl->defbutton ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
- SkinDrawBg(ctl->hwnd, hdcMem);
- if (API::pfnIsThemeBackgroundPartiallyTransparent(ctl->hThemeToolbar, TP_BUTTON, TBStateConvert2Flat(state))) {
- API::pfnDrawThemeParentBackground(ctl->hwnd, hdcMem, &rc);
- }
- API::pfnDrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rc, &rc);
- } else {
- HBRUSH hbr;
- RECT rc = rcClient;
-
- if(ctl->buttonItem) {
- RECT rcParent;
- POINT pt;
- HWND hwndParent = pcli->hwndContactList;
- ImageItem *imgItem = ctl->stateId == PBS_HOT ? ctl->buttonItem->imgHover : (ctl->stateId == PBS_PRESSED ? ctl->buttonItem->imgPressed : ctl->buttonItem->imgNormal);
- LONG *glyphMetrics = ctl->stateId == PBS_HOT ? ctl->buttonItem->hoverGlyphMetrics : (ctl->stateId == PBS_PRESSED ? ctl->buttonItem->pressedGlyphMetrics : ctl->buttonItem->normalGlyphMetrics);
-
- //if(ctl->stateId == PBS_HOT && glyphMetrics[2] <= 1 && glyphMetrics[3] <= 1)
- // glyphMetrics = ctl->lastGlyphMetrics;
-
- GetWindowRect(ctl->hwnd, &rcParent);
- pt.x = rcParent.left;
- pt.y = rcParent.top;
-
- ScreenToClient(pcli->hwndContactList, &pt);
-
- BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- if(imgItem)
- DrawAlpha(hdcMem, &rc, 0, 0, 0, 0, 0, 0, 0, imgItem);
- if(g_glyphItem) {
- API::pfnAlphaBlend(hdcMem, (rc.right - glyphMetrics[2]) / 2, (rc.bottom - glyphMetrics[3]) / 2,
- glyphMetrics[2], glyphMetrics[3], g_glyphItem->hdc,
- glyphMetrics[0], glyphMetrics[1], glyphMetrics[2],
- glyphMetrics[3], g_glyphItem->bf);
- //CopyMemory(ctl->lastGlyphMetrics, glyphMetrics, 4 * sizeof(LONG));
- }
- }
- else if(ctl->bSkinned) { // skinned
- RECT rcParent;
- POINT pt;
- HWND hwndParent = pcli->hwndContactList;
- StatusItems_t *item;
- int item_id;
-
- GetWindowRect(ctl->hwnd, &rcParent);
- pt.x = rcParent.left;
- pt.y = rcParent.top;
-
- ScreenToClient(pcli->hwndContactList, &pt);
-
- if(HIWORD(ctl->bSkinned))
- item_id = ctl->stateId == PBS_HOT ? ID_EXTBKTBBUTTONMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED);
- //GetItemByStatus(ctl->stateId == PBS_HOT ? ID_EXTBKBUTTONSMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED), &item);
- else
- item_id = ctl->stateId == PBS_HOT ? ID_EXTBKBUTTONSMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKBUTTONSPRESSED : ID_EXTBKBUTTONSNPRESSED);
- item = &StatusItems[item_id - ID_STATUS_OFFLINE];
- //GetItemByStatus(ctl->stateId == PBS_PRESSED ? ID_EXTBKBUTTONSPRESSED : ID_EXTBKBUTTONSNPRESSED, &item);
- SetTextColor(hdcMem, item->TEXTCOLOR);
- if(item->IGNORED) {
- if(pt.y < 10 || cfg::dat.bWallpaperMode)
- //SkinDrawBg(ctl->hwnd, hdcMem);
- BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- else
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
- }
- else {
- if(pt.y < 10 || cfg::dat.bWallpaperMode)
- //SkinDrawBg(ctl->hwnd, hdcMem);
- BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- else
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
- 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);
- }
- }
- else {
- if (ctl->stateId == PBS_PRESSED || ctl->stateId == PBS_HOT)
- hbr = GetSysColorBrush(COLOR_3DFACE);
- else {
- HDC dc;
- HWND hwndParent;
-
- hwndParent = GetParent(ctl->hwnd);
- dc = GetDC(hwndParent);
- hbr = (HBRUSH) SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM) dc, (LPARAM) hwndParent);
- ReleaseDC(hwndParent, dc);
- }
- if (hbr) {
- FillRect(hdcMem, &rc, hbr);
- DeleteObject(hbr);
- }
- }
- if (!ctl->bSkinned && ctl->buttonItem == 0) {
- if (ctl->stateId == PBS_HOT || ctl->focus) {
- if (ctl->pbState)
- 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)
- DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT | BF_SOFT);
- }
- }
- } else {
- // Draw background/border
- if (ctl->hThemeButton && ctl->bThemed) {
- int state = IsWindowEnabled(ctl->hwnd) ? (ctl->stateId == PBS_NORMAL && ctl->defbutton ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
- POINT pt;
- RECT rcParent;
-
- GetWindowRect(ctl->hwnd, &rcParent);
- pt.x = rcParent.left;
- pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
- BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
-
- if (API::pfnIsThemeBackgroundPartiallyTransparent(ctl->hThemeButton, BP_PUSHBUTTON, state)) {
- API::pfnDrawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
- }
- API::pfnDrawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
- } else {
- UINT uState = DFCS_BUTTONPUSH | ((ctl->stateId == PBS_HOT) ? DFCS_HOT : 0) | ((ctl->stateId == PBS_PRESSED) ? DFCS_PUSHED : 0);
- if (ctl->defbutton && ctl->stateId == PBS_NORMAL)
- uState |= DLGC_DEFPUSHBUTTON;
- DrawFrameControl(hdcMem, &rcClient, DFC_BUTTON, uState);
- }
-
- // Draw focus rectangle if button has focus
- if (ctl->focus) {
- RECT focusRect = rcClient;
- InflateRect(&focusRect, -3, -3);
- DrawFocusRect(hdcMem, &focusRect);
- }
- }
-
- // If we have an icon or a bitmap, ignore text and only draw the image on the button
- if (ctl->hIcon || ctl->hIconPrivate || ctl->iIcon) {
- int ix = (rcClient.right - rcClient.left) / 2 - (g_cxsmIcon / 2);
- int iy = (rcClient.bottom - rcClient.top) / 2 - (g_cxsmIcon / 2);
- HICON hIconNew = ctl->hIconPrivate != 0 ? ctl->hIconPrivate : ctl->hIcon;
- if (lstrlen(ctl->szText) == 0) {
- 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);
- ctl->sLabel.cx = ctl->sLabel.cy = 0;
- } else {
- GetTextExtentPoint32(hdcMem, ctl->szText, lstrlen(ctl->szText), &ctl->sLabel);
-
- if(g_cxsmIcon + ctl->sLabel.cx + 8 > rcClient.right - rcClient.left)
- ctl->sLabel.cx = (rcClient.right - rcClient.left) - g_cxsmIcon - 8;
- else
- ctl->sLabel.cx += 4;
-
- ix = (rcClient.right - rcClient.left) / 2 - ((g_cxsmIcon + ctl->sLabel.cx) / 2);
- 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);
- xOffset = ix + g_cxsmIcon + 4;
- }
- } else if (ctl->hBitmap) {
- BITMAP bminfo;
- int ix, iy;
-
- GetObject(ctl->hBitmap, sizeof(bminfo), &bminfo);
- ix = (rcClient.right - rcClient.left) / 2 - (bminfo.bmWidth / 2);
- iy = (rcClient.bottom - rcClient.top) / 2 - (bminfo.bmHeight / 2);
- if (ctl->stateId == PBS_PRESSED) {
- ix++;
- iy++;
- }
- DrawState(hdcMem, NULL, NULL, (LPARAM) ctl->hBitmap, 0, ix, iy, bminfo.bmWidth, bminfo.bmHeight, IsWindowEnabled(ctl->hwnd) ? DST_BITMAP : DST_BITMAP | DSS_DISABLED);
- }
- if (GetWindowTextLength(ctl->hwnd)) {
- // Draw the text and optinally the arrow
- RECT rcText;
-
- 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->bSkinned)
- 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);
- }
- if (hOldFont)
- SelectObject(hdcMem, hOldFont);
- BitBlt(hdcPaint, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdcMem, 0, 0, SRCCOPY);
- SelectObject(hdcMem, hbmOld);
- DeleteObject(hbmMem);
- DeleteDC(hdcMem);
- DeleteObject(hbmOld);
- }
-}
-
-static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- MButtonCtrl *bct = (MButtonCtrl *) GetWindowLongPtr(hwndDlg, 0);
- switch (msg) {
- case WM_NCCREATE:
- SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) | BS_OWNERDRAW);
- bct = reinterpret_cast<MButtonCtrl *>(calloc(1, sizeof(MButtonCtrl)));
- if (bct == NULL)
- return FALSE;
-
- bct->hwnd = hwndDlg;
- bct->stateId = PBS_NORMAL;
- bct->hFont = reinterpret_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT));
- LoadTheme(bct);
- SetWindowLongPtr(hwndDlg, 0, (LONG_PTR) bct);
- if (((CREATESTRUCT*) lParam)->lpszName)
- SetWindowText(hwndDlg, ((CREATESTRUCT *) lParam)->lpszName);
- return TRUE;
-
- case WM_DESTROY:
- if (bct) {
- if (hwndToolTips) {
- TOOLINFO ti;
-
- ZeroMemory(&ti, sizeof(ti));
- ti.cbSize = sizeof(ti);
- ti.uFlags = TTF_IDISHWND;
- ti.hwnd = bct->hwnd;
- ti.uId = (UINT_PTR) bct->hwnd;
- if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM) &ti)) {
- SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM) &ti);
- }
- if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM) &ti) == 0) {
- DestroyWindow(hwndToolTips);
- hwndToolTips = NULL;
- }
- }
- if (bct->hIconPrivate)
- DestroyIcon(bct->hIconPrivate);
- DestroyTheme(bct);
- free(bct);
- }
- SetWindowLongPtr(hwndDlg, 0, 0);
- break;
-
- case WM_SETTEXT:
- bct->cHot = 0;
- if ((char*) lParam) {
- char *tmp = (char *) lParam;
- while (*tmp) {
- if (*tmp == '&' && *(tmp + 1)) {
- bct->cHot = tolower(*(tmp + 1));
- break;
- }
- tmp++;
- }
- InvalidateRect(bct->hwnd, NULL, TRUE);
- lstrcpyn(bct->szText, (TCHAR *)lParam, 127);
- bct->szText[127] = 0;
- }
- break;
-
- case WM_SYSKEYUP:
- if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == tolower((int) wParam)) {
- if (bct->pushBtn) {
- if (bct->pbState)
- bct->pbState = 0;
- else
- bct->pbState = 1;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- if (!bct->bSendOnDown)
- SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
- return 0;
- }
- break;
-
- case WM_THEMECHANGED:
- if (bct->bThemed)
- LoadTheme(bct);
- InvalidateRect(bct->hwnd, NULL, TRUE); // repaint it
- break;
-
- case WM_SETFONT:
- // remember the font so we can use it later
- bct->hFont = (HFONT) wParam; // maybe we should redraw?
- break;
-
- case WM_NCPAINT:
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- HDC hdcPaint;
-
- hdcPaint = BeginPaint(hwndDlg, &ps);
- if (hdcPaint) {
- PaintWorker(bct, hdcPaint);
- EndPaint(hwndDlg, &ps);
- }
- break;
- }
-
- case BM_GETIMAGE:
- if(wParam == IMAGE_ICON)
- return (LRESULT)(bct->hIconPrivate ? bct->hIconPrivate : bct->hIcon);
- break;
-
- case BM_SETIMAGE:
- if (!lParam)
- break;
- bct->hIml = 0;
- bct->iIcon = 0;
- if (wParam == IMAGE_ICON) {
- ICONINFO ii = {0};
- BITMAP bm = {0};
-
- if (bct->hIconPrivate) {
- DestroyIcon(bct->hIconPrivate);
- bct->hIconPrivate = 0;
- }
-
- GetIconInfo((HICON) lParam, &ii);
- GetObject(ii.hbmColor, sizeof(bm), &bm);
- if (bm.bmWidth > g_cxsmIcon || bm.bmHeight > g_cysmIcon) {
- HIMAGELIST hImageList;
- hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
- ImageList_AddIcon(hImageList, (HICON) lParam);
- bct->hIconPrivate = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
- ImageList_RemoveAll(hImageList);
- ImageList_Destroy(hImageList);
- bct->hIcon = 0;
- } else {
- bct->hIcon = (HICON) lParam;
- bct->hIconPrivate = 0;
- }
-
- DeleteObject(ii.hbmMask);
- DeleteObject(ii.hbmColor);
- bct->hBitmap = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- else if (wParam == IMAGE_BITMAP) {
- bct->hBitmap = (HBITMAP) lParam;
- if (bct->hIconPrivate)
- DestroyIcon(bct->hIconPrivate);
- bct->hIcon = bct->hIconPrivate = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- break;
-
- case BM_SETPRIVATEICON:
- bct->hIml = 0;
- bct->iIcon = 0; {
- if (bct->hIconPrivate)
- DestroyIcon(bct->hIconPrivate);
- bct->hIconPrivate = DuplicateIcon(g_hInst, (HICON) lParam);
- bct->hIcon = 0;
- }
- break;
-
- case BM_SETIMLICON:
- {
- if (bct->hIconPrivate)
- DestroyIcon(bct->hIconPrivate);
- bct->hIml = (HIMAGELIST) wParam;
- bct->iIcon = (int) lParam;
- bct->hIcon = bct->hIconPrivate = 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- break;
-
- case BM_SETSKINNED:
- bct->bSkinned = (DWORD)lParam;
- bct->bThemed = bct->bSkinned ? FALSE : bct->bThemed;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BM_SETBTNITEM:
- bct->buttonItem = (ButtonItem *)lParam;
- break;
-
- case BM_SETASMENUACTION:
- bct->bSendOnDown = wParam ? TRUE : FALSE;
- return 0;
-
- case BM_SETCHECK:
- if (!bct->pushBtn)
- break;
- if (wParam == BST_CHECKED) {
- bct->pbState = 1;
- bct->stateId = PBS_PRESSED;
- } else if (wParam == BST_UNCHECKED) {
- bct->pbState = 0;
- bct->stateId = PBS_NORMAL;
- }
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BM_GETCHECK:
- if (bct->pushBtn)
- return bct->pbState ? BST_CHECKED : BST_UNCHECKED;
-
- return 0;
-
- case BUTTONSETARROW:
- // turn arrow on/off
- if (wParam) {
- if (!bct->arrow)
- bct->arrow = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MINIMIZE), IMAGE_ICON, g_cxsmIcon, g_cysmIcon, 0);
- }
- else {
- if (bct->arrow) {
- DestroyIcon(bct->arrow);
- bct->arrow = NULL;
- }
- }
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BUTTONSETDEFAULT:
- bct->defbutton = wParam ? 1 : 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BUTTONSETASPUSHBTN:
- bct->pushBtn = 1;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BUTTONSETASFLATBTN:
- bct->flatBtn = lParam == 0 ? 1 : 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case BUTTONSETASFLATBTN + 10:
- bct->bThemed = lParam ? TRUE : FALSE;
- bct->bSkinned = bct->bThemed ? 0 : bct->bSkinned;
- break;
-
- case BUTTONADDTOOLTIP:
- if (wParam) {
- if (!hwndToolTips) {
- hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
- SetWindowPos(hwndToolTips, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- }
-
- TOOLINFO ti = { 0 };
- ti.cbSize = sizeof(ti);
- ti.uFlags = TTF_IDISHWND;
- ti.hwnd = bct->hwnd;
- ti.uId = (UINT_PTR) bct->hwnd;
- if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM) &ti)) {
- SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM) &ti);
- }
- ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
- ti.uId = (UINT_PTR) bct->hwnd;
- ti.lpszText = (TCHAR *) wParam;
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti);
- }
- break;
-
- case WM_SETFOCUS:
- // set keybord focus and redraw
- bct->focus = 1;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case WM_KILLFOCUS:
- // kill focus and redraw
- bct->focus = 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case WM_WINDOWPOSCHANGED:
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case WM_ENABLE:
- // windows tells us to enable/disable
- bct->stateId = wParam ? PBS_NORMAL : PBS_DISABLED;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- break;
-
- case WM_MOUSELEAVE:
- // faked by the WM_TIMER
- if (bct->stateId != PBS_DISABLED) {
- // don't change states if disabled
- bct->stateId = PBS_NORMAL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- break;
-
- case WM_LBUTTONDOWN:
- if (bct->stateId != PBS_DISABLED && bct->stateId != PBS_PRESSED) {
- bct->stateId = PBS_PRESSED;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- if(bct->bSendOnDown) {
- SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
- bct->stateId = PBS_NORMAL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- }
- break;
-
- case WM_LBUTTONUP:
- if (bct->pushBtn) {
- if (bct->pbState)
- bct->pbState = 0;
- else
- bct->pbState = 1;
- }
- if (bct->stateId != PBS_DISABLED) {
- // don't change states if disabled
- if (msg == WM_LBUTTONUP)
- bct->stateId = PBS_HOT;
- else
- bct->stateId = PBS_NORMAL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- if (!bct->bSendOnDown)
- SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
- break;
-
- case WM_MOUSEMOVE:
- if (bct->stateId == PBS_NORMAL) {
- bct->stateId = PBS_HOT;
- InvalidateRect(bct->hwnd, NULL, TRUE);
- }
- // Call timer, used to start cheesy TrackMouseEvent faker
- SetTimer(hwndDlg, BUTTON_POLLID, BUTTON_POLLDELAY, NULL);
- break;
-
- case WM_NCHITTEST:
- {
- LRESULT lr = SendMessage(GetParent(hwndDlg), WM_NCHITTEST, wParam, lParam);
- if(lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT
- || lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT)
- return HTTRANSPARENT;
- }
- break;
-
- case WM_TIMER:
- // use a timer to check if they have did a mouseout
- if (wParam == BUTTON_POLLID) {
- RECT rc;
- POINT pt;
- GetWindowRect(hwndDlg, &rc);
- GetCursorPos(&pt);
- if (!PtInRect(&rc, pt)) {
- // mouse must be gone, trigger mouse leave
- PostMessage(hwndDlg, WM_MOUSELEAVE, 0, 0L);
- KillTimer(hwndDlg, BUTTON_POLLID);
- }
- }
- break;
-
- case WM_ERASEBKGND:
- return 1;
- }
- return DefWindowProc(hwndDlg, msg, wParam, lParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int LoadCLCButtonModule(void)
-{
- WNDCLASSEX wc = { 0 };
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = _T("CLCButtonClass");
- wc.lpfnWndProc = TSButtonWndProc;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.cbWndExtra = sizeof(MButtonCtrl *);
- wc.hbrBackground = 0;
- wc.style = CS_GLOBALCLASS;
- RegisterClassEx(&wc);
- return 0;
-}
-
-int UnloadTSButtonModule(WPARAM, LPARAM)
-{
- return 0;
-}
diff --git a/plugins/Clist_nicer/SRC/clc.cpp b/plugins/Clist_nicer/SRC/clc.cpp index e32626a8b6..9e7e907bcc 100644 --- a/plugins/Clist_nicer/SRC/clc.cpp +++ b/plugins/Clist_nicer/SRC/clc.cpp @@ -49,7 +49,7 @@ extern StatusItems_t *StatusItems; HIMAGELIST hCListImages;
extern HIMAGELIST himlExtraImages;
-HANDLE hSoundHook = 0, hIcoLibChanged = 0, hSvc_GetContactStatusMsg = 0;
+HANDLE hIcoLibChanged = 0, hSvc_GetContactStatusMsg = 0;
static HANDLE hClcSettingsChanged, hClcDBEvent = 0;
@@ -111,11 +111,6 @@ static int ClcEventAdded(WPARAM wParam, LPARAM lParam) return 0;
}
-int ClcSoundHook(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
{
char *szProto = NULL;
@@ -183,18 +178,6 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) cfg::dat.bMetaEnabled = bMetaEnabled;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
- } else if (wParam == 0 && !__strcmp(cws->szModule, "Skin")) {
- if (!__strcmp(cws->szSetting, "UseSound")) {
- if (hSoundHook) {
- UnhookEvent(hSoundHook);
- hSoundHook = 0;
- }
- cfg::dat.soundsOff = cfg::getByte(cws->szModule, cws->szSetting, 0) ? 0 : 1;
- if (cfg::dat.soundsOff && hSoundHook == 0)
- hSoundHook = HookEvent(ME_SKIN_PLAYINGSOUND, ClcSoundHook);
- CheckDlgButton(pcli->hwndContactList, IDC_TBSOUND, cfg::dat.soundsOff ? BST_UNCHECKED : BST_CHECKED);
- SetButtonStates(pcli->hwndContactList);
- }
} else if (szProto == NULL && wParam == 0) {
if (!__strcmp(cws->szSetting, "XStatusId"))
CluiProtocolStatusChanged(0, cws->szModule);
@@ -466,9 +449,9 @@ LBL_Def: if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
-
+#if defined(_UNICODE)
RTL_DetectAndSet(contact, 0);
-
+#endif
dat->bNeedSort = TRUE;
PostMessage(hwnd, INTM_SORTCLC, 0, 0);
goto LBL_Def;
@@ -554,9 +537,9 @@ LBL_Def: contact->proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
CallService(MS_CLIST_INVALIDATEDISPLAYNAME, wParam, 0);
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
-
+#if defined(_UNICODE)
RTL_DetectAndSet(contact, 0);
-
+#endif
dat->bNeedSort = TRUE;
PostMessage(hwnd, INTM_SORTCLC, 0, 0);
goto LBL_Def;
diff --git a/plugins/Clist_nicer/SRC/clcitems.cpp b/plugins/Clist_nicer/SRC/clcitems.cpp index 009a57a36d..34b3a66405 100644 --- a/plugins/Clist_nicer/SRC/clcitems.cpp +++ b/plugins/Clist_nicer/SRC/clcitems.cpp @@ -76,10 +76,13 @@ struct ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, D {
struct ClcGroup *p = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
-
+ #if defined(_UNICODE)
if ( p && p->parent )
RTL_DetectGroupName( p->parent->cl.items[ p->parent->cl.count-1] );
-
+ #else
+ if ( p && p->parent )
+ p->parent->cl.items[ p->parent->cl.count -1]->isRtl = 0;
+ #endif
return p;
}
@@ -163,9 +166,9 @@ int AddContactToGroup(struct ClcData *dat, struct ClcGroup *group, HANDLE hConta // notify other plugins to re-supply their extra images (icq for xstatus, mBirthday etc...)
NotifyEventHooks(hExtraImageApplying, (WPARAM)hContact, 0);
}
-
+#if defined(_UNICODE)
RTL_DetectAndSet( p, p->hContact);
-
+#endif
p->avatarLeft = p->extraIconRightBegin = -1;
p->flags |= cfg::getByte(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
@@ -339,7 +342,7 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto) if ( !result )
DBFreeVariant( &dbv );
-
+#if defined(_UNICODE)
if(cEntry->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
int iLen, i
@@ -355,7 +358,7 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto) }
}
}
-
+#endif
if(cEntry->hTimeZone == NULL)
TZ_LoadTimeZone(hContact, cEntry, szProto);
return cEntry->bStatusMsgValid;;
@@ -394,7 +397,7 @@ void ReloadExtraInfo(HANDLE hContact) * autodetect RTL property of the nickname, evaluates the first 10 characters of the nickname only
*/
-
+#if defined(_UNICODE)
void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact)
{
WORD infoTypeC2[12];
@@ -444,7 +447,7 @@ void RTL_DetectGroupName(struct ClcContact *group) }
}
}
-
+#endif
/*
* check for exteneded user information - email, phone numbers, homepage
* set extra icons accordingly
diff --git a/plugins/Clist_nicer/SRC/clcopts.cpp b/plugins/Clist_nicer/SRC/clcopts.cpp index 5dbe0d7ceb..0b59425f65 100644 --- a/plugins/Clist_nicer/SRC/clcopts.cpp +++ b/plugins/Clist_nicer/SRC/clcopts.cpp @@ -469,15 +469,7 @@ void DSP_Apply(DISPLAYPROFILE *p) if(oldexIconScale != cfg::dat.exIconScale) {
ImageList_RemoveAll(himlExtraImages);
ImageList_SetIconSize(himlExtraImages, cfg::dat.exIconScale, cfg::dat.exIconScale);
- if(cfg::dat.IcoLib_Avail)
- IcoLibReloadIcons();
- else {
- CLN_LoadAllIcons(0);
- pcli->pfnReloadProtoMenus();
- //FYR: Not necessary. It is already notified in pfnReloadProtoMenus
- //NotifyEventHooks(pcli->hPreBuildStatusMenuEvent, 0, 0);
- ReloadExtraIcons();
- }
+ IcoLibReloadIcons();
}
pcli->pfnClcOptionsChanged();
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
diff --git a/plugins/Clist_nicer/SRC/clcpaint.cpp b/plugins/Clist_nicer/SRC/clcpaint.cpp index ef7cf12932..7d3d799992 100644 --- a/plugins/Clist_nicer/SRC/clcpaint.cpp +++ b/plugins/Clist_nicer/SRC/clcpaint.cpp @@ -497,7 +497,7 @@ void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *c else
cEntry = cfg::eCache;
-
+#if defined(_UNICODE)
if(dat->bisEmbedded)
goto set_bg_l;
@@ -525,7 +525,16 @@ void __inline PaintItem(HDC hdcMem, struct ClcGroup *group, struct ClcContact *c bg_indent_l = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
set_bg_l:
-
+#else
+ if(type == CLCIT_GROUP && cfg::dat.bGroupAlign == CLC_GROUPALIGN_RIGHT && !dat->bisEmbedded && API::pfnSetLayout != 0) {
+ g_RTL = TRUE;
+ bg_indent_r = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
+ }
+ else {
+ g_RTL = FALSE;
+ bg_indent_l = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
+ }
+#endif
g_hottrack = dat->exStyle & CLS_EX_TRACKSELECT && type == CLCIT_CONTACT && dat->iHotTrack == index;
if (g_hottrack == selected)
@@ -1267,9 +1276,11 @@ nodisplay: if ((dwFlags & CLUI_FRAME_SHOWSTATUSMSG && smsgValid > STATUSMSG_XSTATUSID) || smsgValid == STATUSMSG_XSTATUSNAME)
szText = cEntry->statusMsg;
else
-
+#if defined(_UNICODE)
szText = &statusNames[cstatus - ID_STATUS_OFFLINE][0];
-
+#else
+ szText = statusNames[cstatus - ID_STATUS_OFFLINE];
+#endif
if(cEntry->dwCFlags & ECF_RTLSTATUSMSG && cfg::dat.bUseDCMirroring == 3)
dt_2ndrowflags |= (DT_RTLREADING | DT_RIGHT);
diff --git a/plugins/Clist_nicer/SRC/clcutils.cpp b/plugins/Clist_nicer/SRC/clcutils.cpp index f41b091517..e4aee0fda9 100644 --- a/plugins/Clist_nicer/SRC/clcutils.cpp +++ b/plugins/Clist_nicer/SRC/clcutils.cpp @@ -542,7 +542,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) for (i=0; i <= FONTID_LAST; i++)
if (h<dat->fontInfo[i].fontHeight+2) h=dat->fontInfo[i].fontHeight+2;
}
-
+#if defined(_UNICODE)
dat->hwndRenameEdit = CreateWindowEx(0, _T("RichEdit20W"),contact->szText,WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOHSCROLL,x,y,clRect.right-x,h,hwnd,NULL,g_hInst,NULL);
{
if ((contact->type == CLCIT_CONTACT && cfg::eCache[contact->extraCacheEntry].dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
@@ -556,7 +556,9 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) SetWindowText(dat->hwndRenameEdit, contact->szText);
}
}
-
+#else
+ dat->hwndRenameEdit = CreateWindow(_T("EDIT"),contact->szText,WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOHSCROLL,x,y,clRect.right-x,h,hwnd,NULL,g_hInst,NULL);
+#endif
//dat->hwndRenameEdit = CreateWindow(_T("EDIT"), contact->szText, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, x, y, clRect.right - x, dat->rowHeight, hwnd, NULL, g_hInst, NULL);
OldRenameEditWndProc = (WNDPROC) SetWindowLongPtr(dat->hwndRenameEdit, GWLP_WNDPROC, (LONG_PTR) RenameEditSubclassProc);
SendMessage(dat->hwndRenameEdit, WM_SETFONT, (WPARAM) (contact->type == CLCIT_GROUP ? dat->fontInfo[FONTID_GROUPS].hFont : dat->fontInfo[FONTID_CONTACTS].hFont), 0);
diff --git a/plugins/Clist_nicer/SRC/clistevents.cpp b/plugins/Clist_nicer/SRC/clistevents.cpp index 93b90c34ce..953877c27d 100644 --- a/plugins/Clist_nicer/SRC/clistevents.cpp +++ b/plugins/Clist_nicer/SRC/clistevents.cpp @@ -283,12 +283,14 @@ struct CListEvent* AddEvent(CLISTEVENT *cle) if (nmi) {
TCHAR szBuffer[128];
TCHAR* szStatus = pcli->pfnGetStatusModeDescription(cfg::getWord(p->cle.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
-
+#if defined(_UNICODE)
TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
_snwprintf(szBuffer, SIZEOF(szBuffer), L"%s: %s (%s)", szwProto, szName, szStatus);
-
+#else
+ _snprintf(szBuffer, SIZEOF(szBuffer), "%s: %s (%s)", szProto, szName, szStatus);
+#endif
szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
diff --git a/plugins/Clist_nicer/SRC/clistmod.cpp b/plugins/Clist_nicer/SRC/clistmod.cpp index 5e551d4b87..e6f88e51ee 100644 --- a/plugins/Clist_nicer/SRC/clistmod.cpp +++ b/plugins/Clist_nicer/SRC/clistmod.cpp @@ -72,13 +72,11 @@ int IconFromStatusMode(const char *szProto, int status, HANDLE hContact, HICON * }
if(status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE && phIcon != NULL) {
- if(szProto && cfg::dat.IcoLib_Avail) {
+ if(szProto) {
char szBuf[128];
mir_snprintf(szBuf, 128, "%s_conn", szProto);
*phIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)szBuf);
}
- else if(szProto)
- *phIcon = cfg::dat.hIconConnecting;;
}
return saveIconFromStatusMode(szFinalProto, finalStatus, hContact);
}
diff --git a/plugins/Clist_nicer/SRC/clistopts.cpp b/plugins/Clist_nicer/SRC/clistopts.cpp index 338886fce9..dcb628243a 100644 --- a/plugins/Clist_nicer/SRC/clistopts.cpp +++ b/plugins/Clist_nicer/SRC/clistopts.cpp @@ -72,7 +72,6 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
- CheckDlgButton(hwndDlg, IDC_SHOWBUTTONBAR, cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS);
CheckDlgButton(hwndDlg, IDC_SHOWBOTTOMBUTTONS, cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS);
CheckDlgButton(hwndDlg, IDC_CLISTSUNKEN, cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN);
CheckDlgButton(hwndDlg, IDC_EVENTAREAAUTOHIDE, cfg::dat.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY);
@@ -185,7 +184,6 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP __setFlag(CLUI_FRAME_EVENTAREASUNKEN, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREASUNKEN));
__setFlag(CLUI_FRAME_AUTOHIDENOTIFY, IsDlgButtonChecked(hwndDlg, IDC_EVENTAREAAUTOHIDE));
- __setFlag(CLUI_FRAME_SHOWTOPBUTTONS, IsDlgButtonChecked(hwndDlg, IDC_SHOWBUTTONBAR));
__setFlag(CLUI_FRAME_SHOWBOTTOMBUTTONS, IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTTOMBUTTONS));
__setFlag(CLUI_FRAME_CLISTSUNKEN, IsDlgButtonChecked(hwndDlg, IDC_CLISTSUNKEN));
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp index 43e459a6c0..efe6989d81 100644 --- a/plugins/Clist_nicer/SRC/clui.cpp +++ b/plugins/Clist_nicer/SRC/clui.cpp @@ -93,7 +93,6 @@ void FLT_SnapToEdges(HWND hwnd); void DestroyTrayMenu(HMENU hMenu);
extern LONG g_cxsmIcon, g_cysmIcon;
-extern HANDLE hSoundHook;
extern HANDLE hIcoLibChanged;
extern HANDLE hExtraImageListRebuilding, hExtraImageApplying;
@@ -107,45 +106,7 @@ static HBITMAP hbmLockedPoint = 0, hbmOldLockedPoint = 0; HICON overlayicons[10];
-struct CluiTopButton top_buttons[] = {
- 0, 0, 0, IDC_TBTOPMENU, IDI_TBTOPMENU, 0, "CLN_topmenu", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 1, LPGENT("Show menu"),
- 0, 0, 0, IDC_TBHIDEOFFLINE, IDI_HIDEOFFLINE, 0, "CLN_online", NULL, 0, 2, LPGENT("Show / hide offline contacts"),
- 0, 0, 0, IDC_TBHIDEGROUPS, IDI_HIDEGROUPS, 0, "CLN_groups", NULL, 0, 4, LPGENT("Toggle group mode"),
- 0, 0, 0, IDC_TBFINDANDADD, IDI_FINDANDADD, 0, "CLN_findadd", NULL, TOPBUTTON_PUSH, 8, LPGENT("Find and add contacts"),
- 0, 0, 0, IDC_TBACCOUNTS, IDI_TBACCOUNTS, 0, "CLN_accounts", NULL, TOPBUTTON_PUSH, 8192, LPGENT("Accounts"),
- 0, 0, 0, IDC_TBOPTIONS, IDI_TBOPTIONS, 0, "CLN_options", NULL, TOPBUTTON_PUSH, 16, LPGENT("Open preferences"),
- 0, 0, 0, IDC_TBSOUND, IDI_SOUNDSON, IDI_SOUNDSOFF, "CLN_sound", "CLN_soundsoff", 0, 32, LPGENT("Toggle sounds"),
- 0, 0, 0, IDC_TBMINIMIZE, IDI_MINIMIZE, 0, "CLN_minimize", NULL, TOPBUTTON_PUSH, 64, LPGENT("Minimize contact list"),
- 0, 0, 0, IDC_TBTOPSTATUS, 0, 0, "CLN_topstatus", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 128, LPGENT("Status menu"),
- 0, 0, 0, IDC_TABSRMMSLIST, IDI_TABSRMMSESSIONLIST, 0, "CLN_slist", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 256, LPGENT("tabSRMM session list"),
- 0, 0, 0, IDC_TABSRMMMENU, IDI_TABSRMMMENU, 0, "CLN_menu", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 512, LPGENT("tabSRMM Menu"),
-
- 0, 0, 0, IDC_TBSELECTVIEWMODE, IDI_CLVM_SELECT, 0, "CLN_CLVM_select", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 1024, LPGENT("Select view mode"),
- 0, 0, 0, IDC_TBCONFIGUREVIEWMODE, IDI_CLVM_OPTIONS, 0, "CLN_CLVM_options", NULL, TOPBUTTON_PUSH, 2048, LPGENT("Setup view modes"),
- 0, 0, 0, IDC_TBCLEARVIEWMODE, IDI_DELETE, 0, "CLN_CLVM_reset", NULL, TOPBUTTON_PUSH, 4096, LPGENT("Clear view mode"),
-
- 0, 0, 0, IDC_TBGLOBALSTATUS, 0, 0, "", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 0, LPGENT("Set status modes"),
- 0, 0, 0, IDC_TBMENU, IDI_MINIMIZE, 0, "", NULL, TOPBUTTON_PUSH | TOPBUTTON_SENDONDOWN, 0, LPGENT("Open main menu"),
- (HWND) - 1, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static struct IconDesc myIcons[] = {
- "CLN_online", LPGEN("Toggle show online/offline"), -IDI_HIDEOFFLINE,
- "CLN_groups", LPGEN("Toggle groups"), -IDI_HIDEGROUPS,
- "CLN_findadd", LPGEN("Find contacts"), -IDI_FINDANDADD,
- "CLN_options", LPGEN("Open preferences"), -IDI_TBOPTIONS,
- "CLN_sound", LPGEN("Toggle sounds"), -IDI_SOUNDSON,
- "CLN_minimize", LPGEN("Minimize contact list"), -IDI_MINIMIZE,
- "CLN_slist", LPGEN("Show tabSRMM session list"), -IDI_TABSRMMSESSIONLIST,
- "CLN_menu", LPGEN("Show tabSRMM menu"), -IDI_TABSRMMMENU,
- "CLN_soundsoff", LPGEN("Sounds are off"), -IDI_SOUNDSOFF,
- "CLN_CLVM_select", LPGEN("Select view mode"), -IDI_CLVM_SELECT,
- "CLN_CLVM_reset", LPGEN("Reset view mode"), -IDI_DELETE,
- "CLN_CLVM_options", LPGEN("Configure view modes"), -IDI_CLVM_OPTIONS,
- "CLN_topmenu", LPGEN("Show menu"), -IDI_TBTOPMENU,
- "CLN_accounts", LPGEN("Setup accounts"), -IDI_TBACCOUNTS,
- NULL, NULL, 0
-};
+HWND hTbMenu, hTbGlobalStatus;
/*
* simple service for testing purpose
@@ -170,7 +131,6 @@ static void Tweak_It(COLORREF clr) static void LayoutButtons(HWND hwnd, RECT *rc)
{
- int i;
RECT rect;
BYTE rightButton = 1, leftButton = 0;
BYTE left_offset = cfg::dat.bCLeft - (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? 3 : 0);
@@ -185,48 +145,12 @@ 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(top_buttons[15].hwnd, 0, 2 + left_offset, rect.bottom - cfg::dat.statusBarHeight - BUTTON_HEIGHT_D - 1,
- BUTTON_WIDTH_D * 3, BUTTON_HEIGHT_D + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
- SetWindowPos(top_buttons[14].hwnd, 0, left_offset + (3 * BUTTON_WIDTH_D) + 3, rect.bottom - cfg::dat.statusBarHeight - BUTTON_HEIGHT_D - 1,
- rect.right - delta - (3 * BUTTON_WIDTH_D + 5), BUTTON_HEIGHT_D + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
- return;
- }
+ 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);
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd == 0)
- continue;
- if (top_buttons[i].id == IDC_TBMENU) {
- SetWindowPos(top_buttons[i].hwnd, 0, 2 + left_offset, rect.bottom - cfg::dat.statusBarHeight - BUTTON_HEIGHT_D - 1,
- BUTTON_WIDTH_D * 3, BUTTON_HEIGHT_D + 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);
- } else if (top_buttons[i].id == IDC_TBGLOBALSTATUS) {
- SetWindowPos(top_buttons[i].hwnd, 0, left_offset + (3 * BUTTON_WIDTH_D) + 3, rect.bottom - cfg::dat.statusBarHeight - BUTTON_HEIGHT_D - 1,
- rect.right - delta - (3 * BUTTON_WIDTH_D + 5), BUTTON_HEIGHT_D + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
- }
- if (!(top_buttons[i].visibilityOrder & cfg::dat.toolbarVisibility))
- continue;
- if (top_buttons[i].id == IDC_TBTOPSTATUS || top_buttons[i].id == IDC_TBMINIMIZE || top_buttons[i].id == IDC_TABSRMMMENU || top_buttons[i].id == IDC_TABSRMMSLIST) {
- SetWindowPos(top_buttons[i].hwnd, 0, rect.right - right_offset - 2 - (rightButton * (cfg::dat.dwButtonWidth + 1)), 2 + cfg::dat.bCTop, cfg::dat.dwButtonWidth, cfg::dat.dwButtonHeight - 2,
- SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
- rightButton++;
- continue;
- } else {
- SetWindowPos(top_buttons[i].hwnd, 0, left_offset + 3 + (leftButton * (cfg::dat.dwButtonWidth + 1)), 2 + cfg::dat.bCTop, cfg::dat.dwButtonWidth, cfg::dat.dwButtonHeight - 2,
- SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW);
- leftButton++;
- }
- }
}
static int FS_FontsChanged(WPARAM wParam, LPARAM lParam)
@@ -316,13 +240,11 @@ static int CluiModulesLoaded(WPARAM wParam, LPARAM lParam) static Update upd = {0};
static const char *szPrefix = "clist_nicer_plus ";
-
- static char *component = "CList Nicer+ (Unicode)";
+ static char *component = "CList Nicer+";
static char szCurrentVersion[30];
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";
-
// updater plugin support
upd.cbSize = sizeof(upd);
@@ -339,11 +261,8 @@ static int CluiModulesLoaded(WPARAM wParam, LPARAM lParam) CallService(MS_UPDATE_REGISTER, 0, (LPARAM)&upd);
MTG_OnmodulesLoad(wParam, lParam);
- if (ServiceExists(MS_FONT_REGISTER)) {
- cfg::dat.bFontServiceAvail = TRUE;
- FS_RegisterFonts();
- HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
- }
+ FS_RegisterFonts();
+ HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
return 0;
}
@@ -401,28 +320,32 @@ static void InitIcoLib() sid.flags = SIDF_PATH_TCHAR;
sid.pszSection = LPGEN("CList - Nicer/Default");
sid.ptszDefaultFile = szFilename;
- i = 0;
- do {
- if (myIcons[i].szName == NULL)
- break;
- sid.pszName = myIcons[i].szName;
- sid.pszDescription = myIcons[i].szDesc;
- sid.iDefaultIndex = myIcons[i].uId;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
- } while (++i);
+ sid.pszName = "CLN_CLVM_select";
+ sid.pszDescription = LPGEN("Select view mode");
+ sid.iDefaultIndex = -IDI_CLVM_SELECT;
+ Skin_AddIcon(&sid);
+ sid.pszName = "CLN_CLVM_reset";
+ sid.pszDescription = LPGEN("Reset view mode");
+ sid.iDefaultIndex = -IDI_DELETE;
+ Skin_AddIcon(&sid);
+ sid.pszName = "CLN_CLVM_options";
+ sid.pszDescription = LPGEN("Configure view modes");
+ sid.iDefaultIndex = -IDI_CLVM_OPTIONS;
+ Skin_AddIcon(&sid);
+
sid.pszName = "CLN_visible";
sid.pszDescription = LPGEN("Contact on visible list");
sid.iDefaultIndex = -IDI_CLVISIBLE;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ Skin_AddIcon(&sid);
sid.pszName = "CLN_invisible";
sid.pszDescription = LPGEN("Contact on invisible list or blocked");
sid.iDefaultIndex = -IDI_CLINVISIBLE;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ Skin_AddIcon(&sid);
sid.pszName = "CLN_chatactive";
sid.pszDescription = LPGEN("Chat room/IRC channel activity");
sid.iDefaultIndex = -IDI_OVL_FREEFORCHAT;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ Skin_AddIcon(&sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("CList - Nicer/Overlay Icons");
@@ -431,7 +354,7 @@ static void InitIcoLib() sid.pszName = szBuffer;
sid.ptszDescription = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), GSMDF_TCHAR);
sid.iDefaultIndex = -i;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ Skin_AddIcon(&sid);
}
sid.ptszSection = LPGENT("CList - Nicer/Connecting Icons");
ProtoEnumAccounts( &p_count, &accs );
@@ -444,7 +367,7 @@ static void InitIcoLib() mir_sntprintf(szDescr, 128, TranslateT("%s Connecting"), accs[i]->tszAccountName );
sid.ptszDescription = szDescr;
sid.iDefaultIndex = -IDI_PROTOCONNECTING;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ Skin_AddIcon(&sid);
}
}
@@ -454,6 +377,28 @@ static int IcoLibChanged(WPARAM wParam, LPARAM lParam) return 0;
}
+void CreateButtonBar(HWND hWnd)
+{
+// if (!hTbMenu)
+ {
+ hTbMenu = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU) IDC_TBMENU, g_hInst, NULL);
+ SetWindowText(hTbMenu, TranslateT("Menu"));
+ SendMessage(hTbMenu, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+ SendMessage(hTbMenu, BM_SETASMENUACTION, 1, 0);
+ SendMessage(hTbMenu, BUTTONADDTOOLTIP, (WPARAM) TranslateTS(LPGENT("Open main menu")), BATF_UNICODE);
+ }
+
+// if (!hTbGlobalStatus)
+ {
+ hTbGlobalStatus = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU) IDC_TBGLOBALSTATUS, g_hInst, NULL);
+ SetWindowText(hTbGlobalStatus, TranslateT("Offline"));
+ SendMessage(hTbGlobalStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_STATUS_OFFLINE));
+ SendMessage(hTbGlobalStatus, BM_SETASMENUACTION, 1, 0);
+ SendMessage(hTbGlobalStatus, BUTTONADDTOOLTIP, (WPARAM) TranslateTS(LPGENT("Set status modes")), BATF_UNICODE);
+ }
+
+}
+
/*
* if mode != 0 we do first time init, otherwise only reload the extra icon stuff
*/
@@ -491,52 +436,14 @@ void ConfigureEventArea(HWND hwnd) void ConfigureFrame()
{
- int i;
- int showCmd;
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd == 0)
- continue;
- switch (top_buttons[i].id) {
- case IDC_TBMENU:
- case IDC_TBGLOBALSTATUS:
- ShowWindow(top_buttons[i].hwnd, cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? SW_SHOW : SW_HIDE);
- break;
- default:
- if (cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS) {
- showCmd = (top_buttons[i].visibilityOrder & cfg::dat.toolbarVisibility) ? SW_SHOW : SW_HIDE;
- CheckMenuItem(cfg::dat.hMenuButtons, 50000 + i, MF_BYCOMMAND | (showCmd == SW_SHOW ? MF_CHECKED : MF_UNCHECKED));
- } else
- showCmd = SW_HIDE;
- ShowWindow(top_buttons[i].hwnd, showCmd);
- break;
- }
- }
+ int show = cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? SW_SHOW : SW_HIDE;
+ ShowWindow(hTbMenu,show);
+ ShowWindow(hTbGlobalStatus,show);
}
void IcoLibReloadIcons()
{
- int i;
- HICON hIcon;
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
-
- if ((top_buttons[i].id == IDC_TABSRMMMENU || top_buttons[i].id == IDC_TABSRMMSLIST) && !cfg::dat.tabSRMM_Avail)
- continue;
-
- if (top_buttons[i].id == IDC_TBMENU || top_buttons[i].id == IDC_TBGLOBALSTATUS || top_buttons[i].id == IDC_TBTOPSTATUS)
- continue;
- hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) top_buttons[i].szIcoLibIcon);
- if (top_buttons[i].hwnd && IsWindow(top_buttons[i].hwnd)) {
- SendMessage(top_buttons[i].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
- InvalidateRect(top_buttons[i].hwnd, NULL, TRUE);
- }
- }
cfg::dat.hIconVisible = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) "CLN_visible");
cfg::dat.hIconInvisible = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) "CLN_invisible");
cfg::dat.hIconChatactive = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) "CLN_chatactive");
@@ -557,92 +464,6 @@ void IcoLibReloadIcons() SendMessage(g_hwndViewModeFrame, WM_USER + 100, 0, 0);
}
-
-static void SetButtonStyle()
-{
- int i;
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd == 0 || top_buttons[i].id == IDC_TBGLOBALSTATUS || top_buttons[i].id == IDC_TBMENU)
- continue;
- SendMessage(top_buttons[i].hwnd, BUTTONSETASFLATBTN, 0, cfg::dat.dwFlags & CLUI_FRAME_BUTTONSFLAT ? 0 : 1);
- SendMessage(top_buttons[i].hwnd, BUTTONSETASFLATBTN + 10, 0, cfg::dat.dwFlags & CLUI_FRAME_BUTTONSCLASSIC ? 0 : 1);
- }
-}
-
-void CreateButtonBar(HWND hWnd)
-{
- int i;
- HICON hIcon;
- HMENU hMenuButtonList = GetSubMenu(cfg::dat.hMenuButtons, 0);
-
- DeleteMenu(hMenuButtonList, 0, MF_BYPOSITION);
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd)
- continue;
-
- if (g_ButtonItems && top_buttons[i].id != IDC_TBGLOBALSTATUS && top_buttons[i].id != IDC_TBMENU)
- continue;
-
- if ((top_buttons[i].id == IDC_TABSRMMMENU || top_buttons[i].id == IDC_TABSRMMSLIST) && !cfg::dat.tabSRMM_Avail)
- continue;
-
- top_buttons[i].hwnd = CreateWindowEx(0, _T("CLCButtonClass"), _T(""), BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU) top_buttons[i].id, g_hInst, NULL);
- if (top_buttons[i].id != IDC_TBMENU && top_buttons[i].id != IDC_TBGLOBALSTATUS)
- AppendMenu(hMenuButtonList, MF_STRING, 50000 + i, TranslateTS(top_buttons[i].szTooltip));
- if (!cfg::dat.IcoLib_Avail) {
- hIcon = top_buttons[i].hIcon = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(top_buttons[i].idIcon), IMAGE_ICON, g_cxsmIcon, g_cysmIcon, LR_SHARED);
- if (top_buttons[i].idAltIcon)
- top_buttons[i].hAltIcon = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(top_buttons[i].idAltIcon), IMAGE_ICON, g_cxsmIcon, g_cysmIcon, LR_SHARED));
- } else {
- hIcon = top_buttons[i].hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) top_buttons[i].szIcoLibIcon);
- if (top_buttons[i].szIcoLibAltIcon)
- top_buttons[i].hAltIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) top_buttons[i].szIcoLibAltIcon);
- }
- if (top_buttons[i].id == IDC_TBMENU) {
- SetWindowText(top_buttons[i].hwnd, TranslateT("Menu"));
- SendMessage(top_buttons[i].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
- } else
- SendMessage(top_buttons[i].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
- if (top_buttons[i].id == IDC_TBGLOBALSTATUS) {
- SetWindowText(top_buttons[i].hwnd, TranslateT("Offline"));
- SendMessage(top_buttons[i].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadSkinnedIcon(SKINICON_STATUS_OFFLINE));
- }
- if (!(top_buttons[i].flags & TOPBUTTON_PUSH))
- SendMessage(top_buttons[i].hwnd, BUTTONSETASPUSHBTN, 0, 0);
- if (top_buttons[i].id != IDC_TBGLOBALSTATUS && top_buttons[i].id != IDC_TBMENU)
- SendMessage(top_buttons[i].hwnd, BUTTONSETASFLATBTN, 0, 0);
-
- if (top_buttons[i].flags & TOPBUTTON_SENDONDOWN)
- SendMessage(top_buttons[i].hwnd, BM_SETASMENUACTION, 1, 0);
-
- SendMessage(top_buttons[i].hwnd, BUTTONADDTOOLTIP, (WPARAM) TranslateTS(top_buttons[i].szTooltip), 0);
- }
- SetButtonStyle();
-}
-
-void SetTBSKinned(int mode)
-{
- int i;
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd == 0 || top_buttons[i].id == IDC_TBGLOBALSTATUS || top_buttons[i].id == IDC_TBMENU)
- continue;
- SendMessage(top_buttons[i].hwnd, BUTTONSETASFLATBTN, 0, 0);
- SendMessage(top_buttons[i].hwnd, BUTTONSETASFLATBTN + 10, 0, 0);
- SendMessage(top_buttons[i].hwnd, BM_SETSKINNED, 0, mode ? MAKELONG(mode, 1) : 0);
- }
- if (!mode)
- SetButtonStyle(); // restore old style
-}
-
void ConfigureCLUIGeometry(int mode)
{
RECT rcStatus;
@@ -653,8 +474,6 @@ void ConfigureCLUIGeometry(int mode) cfg::dat.bCTop = LOBYTE(HIWORD(clmargins));
cfg::dat.bCBottom = HIBYTE(HIWORD(clmargins));
- cfg::dat.dwButtonWidth = cfg::dat.dwButtonHeight = cfg::getByte("CLUI", "TBSize", 19);
-
if (mode) {
if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) {
SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
@@ -664,8 +483,8 @@ void ConfigureCLUIGeometry(int mode) cfg::dat.statusBarHeight = 0;
}
- cfg::dat.topOffset = (cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS ? 2 + cfg::dat.dwButtonHeight : 0) + cfg::dat.bCTop;
- cfg::dat.bottomOffset = (cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? 2 + BUTTON_HEIGHT_D : 0) + cfg::dat.bCBottom;
+ cfg::dat.topOffset = cfg::dat.bCTop;
+ cfg::dat.bottomOffset = (cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? 2 + 21 : 0) + cfg::dat.bCBottom;
if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) {
cfg::dat.topOffset += 2;
@@ -675,19 +494,6 @@ void ConfigureCLUIGeometry(int mode) }
}
-void RefreshButtons()
-{
- int i;
-
- for (i = 0; ; i++) {
- if (top_buttons[i].szTooltip == NULL)
- break;
- if (top_buttons[i].hwnd == 0 || top_buttons[i].id == IDC_TBGLOBALSTATUS || top_buttons[i].id == IDC_TBMENU)
- continue;
- InvalidateRect(top_buttons[i].hwnd, NULL, FALSE);
- }
-}
-
/*
* set the states of defined database action buttons (only if button is a toggle)
*/
@@ -759,39 +565,6 @@ void SetDBButtonStates(HANDLE hPassedContact) }
}
-/*
- * set states of standard buttons (pressed/unpressed
- */
-void SetButtonStates(HWND hwnd)
-{
- BYTE iMode;
- ButtonItem *buttonItem = g_ButtonItems;
-
- iMode = cfg::getByte("CList", "HideOffline", 0);
- if (!g_ButtonItems) {
- SendDlgItemMessage(hwnd, IDC_TBSOUND, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(cfg::dat.soundsOff ? top_buttons[6].hAltIcon : top_buttons[6].hIcon));
- CheckDlgButton(hwnd, IDC_TBHIDEGROUPS, cfg::getByte("CList", "UseGroups", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwnd, IDC_TBHIDEOFFLINE, iMode ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwnd, IDC_TBSOUND, cfg::dat.soundsOff ? BST_UNCHECKED : BST_CHECKED);
- } else {
- while (buttonItem) {
- if (buttonItem->dwFlags & BUTTON_ISINTERNAL) {
- switch (buttonItem->uId) {
- case IDC_TBSOUND:
- SendMessage(buttonItem->hWnd, BM_SETCHECK, cfg::dat.soundsOff ? BST_UNCHECKED : BST_CHECKED, 0);
- break;
- case IDC_TBHIDEOFFLINE:
- SendMessage(buttonItem->hWnd, BM_SETCHECK, iMode ? BST_CHECKED : BST_UNCHECKED, 0);
- break;
- case IDC_TBHIDEGROUPS:
- 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)
{
@@ -873,7 +646,6 @@ void BlitWallpaper(HDC hdc, RECT *rc, RECT *rcPaint, struct ClcData *dat) void ReloadThemedOptions()
{
- cfg::dat.bSkinnedToolbar = cfg::getByte("CLUI", "tb_skinned", 1);
cfg::dat.bSkinnedStatusBar = cfg::getByte("CLUI", "sb_skinned", 0);
cfg::dat.bUsePerProto = cfg::getByte("CLCExt", "useperproto", 0);
cfg::dat.bOverridePerStatusColors = cfg::getByte("CLCExt", "override_status", 0);
@@ -1177,12 +949,7 @@ 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.soundsOff)
- hSoundHook = HookEvent(ME_SKIN_PLAYINGSOUND, ClcSoundHook);
- if (cfg::dat.bSkinnedToolbar)
- SetTBSKinned(1);
ConfigureFrame();
- SetButtonStates(hwnd);
CreateCLC(hwnd);
cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
@@ -1310,17 +1077,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l // rcFrame.bottom -= (g_CluiData.bottomOffset);
rcFrame.bottom++;
rcFrame.bottom -= cfg::dat.statusBarHeight;
- if (cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS && cfg::dat.dwFlags & CLUI_FRAME_BUTTONBARSUNKEN) {
- rc.top = cfg::dat.bCTop;;
- rc.bottom = cfg::dat.dwButtonHeight + 2 + cfg::dat.bCTop;
- rc.left++;
- rc.right--;
- DrawEdge(hdc, &rc, BDR_SUNKENOUTER, BF_RECT);
- }
- if (cfg::dat.bSkinnedToolbar && !(cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN))
- rcFrame.top = 0;
- else
- rcFrame.top += (cfg::dat.topOffset - 1);
+ rcFrame.top += (cfg::dat.topOffset - 1);
//if(g_CluiData.neeedSnap)
// goto skipbg;
@@ -1343,19 +1100,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ClientToScreen(hwnd, &cfg::dat.ptW);
}
skipbg:
- if (cfg::dat.bSkinnedToolbar && cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS) {
- StatusItems_t *item = &StatusItems[ID_EXTBKBUTTONBAR - ID_STATUS_OFFLINE];
- RECT rc = {rcClient.left, 0, rcClient.right, cfg::dat.dwButtonHeight + 2};
-
- if (!item->IGNORED) {
- rc.left += item->MARGIN_LEFT;
- rc.right -= item->MARGIN_RIGHT;
- rc.top += item->MARGIN_TOP;
- rc.bottom -= item->MARGIN_BOTTOM;
- DrawAlpha(hdc, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
- }
- }
BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY);
if (rgn) {
SelectClipRgn(hdc, NULL);
@@ -1805,8 +1549,7 @@ skipbg: goto buttons_done;
}
switch (LOWORD(wParam)) {
- case IDC_TBMENU:
- case IDC_TBTOPMENU: {
+ case IDC_TBMENU: {
RECT rc;
HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
@@ -1814,27 +1557,14 @@ skipbg: 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_TBGLOBALSTATUS:
- case IDC_TBTOPSTATUS: {
+ case IDC_TBGLOBALSTATUS: {
RECT rc;
HMENU hmenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
GetWindowRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc);
TrackPopupMenu(hmenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, rc.top, 0, hwnd, NULL);
return 0;
}
- case IDC_TABSRMMSLIST:
- case IDC_TABSRMMMENU: {
- if (ServiceExists("SRMsg_MOD/GetWindowFlags"))
- CallService("SRMsg_MOD/Show_TrayMenu", 0, LOWORD(wParam) == IDC_TABSRMMSLIST ? 0 : 1);
- return 0;
- }
- case IDC_TBSOUND: {
- 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:
SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_SELECTMODE, lParam);
break;
@@ -1844,15 +1574,6 @@ skipbg: case IDC_TBCONFIGUREVIEWMODE:
SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_CONFIGUREMODES, lParam);
break;
- case IDC_TBFINDANDADD:
- CallService(MS_FINDADD_FINDADD, 0, 0);
- return 0;
- case IDC_TBACCOUNTS:
- CallService(MS_PROTO_SHOWACCMGR, 0, 0);
- break;
- case IDC_TBOPTIONS:
- CallService("Options/OptionsCommand", 0, 0);
- return 0;
}
} else if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), (LPARAM)(HANDLE) NULL))
return 0;
@@ -1865,7 +1586,6 @@ buttons_done: if (CallService(MS_SYSTEM_OKTOEXIT, 0, 0))
DestroyWindow(hwnd);
break;
- case IDC_TBMINIMIZE:
case ID_TRAY_HIDE:
pcli->pfnShowHide(0, 0);
break;
@@ -1875,7 +1595,6 @@ buttons_done: CallService(MS_CLIST_GROUPCREATE, 0, 0);
break;
case POPUP_HIDEOFFLINE:
- case IDC_TBHIDEOFFLINE:
CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
break;
case POPUP_HIDEOFFLINEROOT:
@@ -1887,12 +1606,10 @@ buttons_done: SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
break;
}
- case POPUP_DISABLEGROUPS:
- case IDC_TBHIDEGROUPS: {
+ case POPUP_DISABLEGROUPS: {
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
cfg::writeByte("CList", "UseGroups", (BYTE) newVal);
SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
- CheckDlgButton(hwnd, IDC_TBHIDEGROUPS, newVal ? BST_CHECKED : BST_UNCHECKED);
break;
}
case POPUP_HIDEMIRANDA:
@@ -1908,9 +1625,6 @@ buttons_done: case POPUP_FRAME:
cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN;
break;
- case POPUP_TOOLBAR:
- cfg::dat.dwFlags ^= CLUI_FRAME_SHOWTOPBUTTONS;
- break;
case POPUP_BUTTONS:
cfg::dat.dwFlags ^= CLUI_FRAME_SHOWBOTTOMBUTTONS;
break;
@@ -1941,31 +1655,23 @@ buttons_done: if (dwOldFlags != cfg::dat.dwFlags) {
InvalidateRect(pcli->hwndContactTree, NULL, FALSE);
cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
- if ((dwOldFlags & (CLUI_FRAME_SHOWTOPBUTTONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN)) != (cfg::dat.dwFlags & (CLUI_FRAME_SHOWTOPBUTTONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN))) {
+ if ((dwOldFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN)) != (cfg::dat.dwFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN))) {
ConfigureFrame();
ConfigureCLUIGeometry(1);
}
ConfigureEventArea(pcli->hwndContactList);
- SetButtonStyle();
PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
}
return FALSE;
}
case WM_LBUTTONDOWN: {
- if (cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS || g_ButtonItems) {
+ if (g_ButtonItems) {
POINT ptMouse, pt;
- RECT rcClient;
GetCursorPos(&ptMouse);
pt = ptMouse;
- if (g_ButtonItems)
- return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
- ScreenToClient(hwnd, &ptMouse);
- GetClientRect(hwnd, &rcClient);
- rcClient.bottom = cfg::dat.topOffset;
- if (PtInRect(&rcClient, ptMouse))
- return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
+ return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
break;
}
@@ -2033,69 +1739,6 @@ buttons_done: TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
return 0;
}
- if (cfg::dat.dwFlags & CLUI_FRAME_SHOWTOPBUTTONS) {
- HMENU hMenu;
- int iSelection;
- RECT rcHit;
-
- GetClientRect(hwnd, &rcHit);
- GetCursorPos(&pt);
- ScreenToClient(hwnd, &pt);
- hMenu = cfg::dat.hMenuButtons;
- rcHit.bottom = cfg::dat.dwButtonHeight + cfg::dat.bCTop;
- if (!PtInRect(&rcHit, pt))
- break;
- ClientToScreen(hwnd, &pt);
- EnableMenuItem(hMenu, ID_BUTTONBAR_DECREASEBUTTONSIZE, MF_BYCOMMAND | (cfg::dat.dwButtonHeight <= 17 ? MF_GRAYED : MF_ENABLED));
- EnableMenuItem(hMenu, ID_BUTTONBAR_INCREASEBUTTONSIZE, MF_BYCOMMAND | (cfg::dat.dwButtonHeight >= 24 ? MF_GRAYED : MF_ENABLED));
- CheckMenuItem(hMenu, ID_BUTTONBAR_FLATBUTTONS, MF_BYCOMMAND | ((cfg::dat.dwFlags & CLUI_FRAME_BUTTONSFLAT) ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenu, ID_BUTTONBAR_NOVISUALSTYLES, MF_BYCOMMAND | ((cfg::dat.dwFlags & CLUI_FRAME_BUTTONSCLASSIC) ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenu, ID_BUTTONBAR_DRAWSUNKENFRAME, MF_BYCOMMAND | ((cfg::dat.dwFlags & CLUI_FRAME_BUTTONBARSUNKEN) ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenu, ID_BUTTONBAR_SKINNEDTOOLBAR, MF_BYCOMMAND | (cfg::dat.bSkinnedToolbar ? MF_CHECKED : MF_UNCHECKED));
- CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMenu, 0);
-
- iSelection = TrackPopupMenu(hMenu, TPM_RETURNCMD | TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
- if (iSelection >= 50000) {
- int iIndex = iSelection - 50000;
- cfg::dat.toolbarVisibility ^= top_buttons[iIndex].visibilityOrder;
- cfg::writeDword("CLUI", "TBVisibility", cfg::dat.toolbarVisibility);
- ConfigureFrame();
- SendMessage(hwnd, WM_SIZE, 0, 0);
- InvalidateRect(hwnd, NULL, TRUE);
- break;
- }
- switch (iSelection) {
- case ID_BUTTONBAR_DECREASEBUTTONSIZE:
- case ID_BUTTONBAR_INCREASEBUTTONSIZE:
- cfg::dat.dwButtonHeight += (iSelection == ID_BUTTONBAR_DECREASEBUTTONSIZE ? -1 : 1);
- cfg::dat.dwButtonWidth = cfg::dat.dwButtonHeight;
- cfg::writeByte("CLUI", "TBSize", (BYTE) cfg::dat.dwButtonHeight);
- ConfigureCLUIGeometry(1);
- SendMessage(hwnd, WM_SIZE, 0, 0);
- InvalidateRect(hwnd, NULL, TRUE);
- break;
- case ID_BUTTONBAR_NOVISUALSTYLES:
- cfg::dat.dwFlags ^= CLUI_FRAME_BUTTONSCLASSIC;
- SetButtonStyle();
- break;
- case ID_BUTTONBAR_FLATBUTTONS:
- cfg::dat.dwFlags ^= CLUI_FRAME_BUTTONSFLAT;
- SetButtonStyle();
- break;
- case ID_BUTTONBAR_DRAWSUNKENFRAME:
- cfg::dat.dwFlags ^= CLUI_FRAME_BUTTONBARSUNKEN;
- InvalidateRect(hwnd, NULL, FALSE);
- break;
- case ID_BUTTONBAR_SKINNEDTOOLBAR:
- cfg::dat.bSkinnedToolbar = !cfg::dat.bSkinnedToolbar;
- SetTBSKinned(cfg::dat.bSkinnedToolbar);
- cfg::writeByte("CLUI", "tb_skinned", (BYTE)cfg::dat.bSkinnedToolbar);
- PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
- break;
- }
- cfg::writeDword("CLUI", "Frameflags", cfg::dat.dwFlags);
- return 0;
- }
}
break;
@@ -2136,12 +1779,9 @@ buttons_done: HICON hIcon;
if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE) {
- if (cfg::dat.IcoLib_Avail) {
- char szBuffer[128];
- mir_snprintf(szBuffer, 128, "%s_conn", pd->RealName);
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)szBuffer);
- } else
- hIcon = cfg::dat.hIconConnecting;
+ char szBuffer[128];
+ mir_snprintf(szBuffer, 128, "%s_conn", pd->RealName);
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)szBuffer);
} else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) {
ICQ_CUSTOM_STATUS cst = {0};
char szServiceName[128];
@@ -2248,7 +1888,6 @@ buttons_done: DeleteObject(cfg::dat.bmpBackground);
cfg::dat.bmpBackground = NULL;
}
- DestroyMenu(cfg::dat.hMenuButtons);
FreeProtocolData();
if (hdcLockedPoint) {
SelectObject(hdcLockedPoint, hbmOldLockedPoint);
@@ -2309,9 +1948,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar {
char str[64];
DWORD v = pluginInfo.version;
-
- mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d (Unicode)", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
-
+ mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
mir_snprintf(str, sizeof(str), Translate("Built %s %s"), __DATE__, __TIME__);
SetDlgItemTextA(hwndDlg, IDC_BUILDTIME, str);
@@ -2328,9 +1965,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar DestroyWindow(hwndDlg);
return TRUE;
case IDC_SUPPORT:
-
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-im.org/download/details.php?action=viewfile&id=2365");
-
break;
}
break;
diff --git a/plugins/Clist_nicer/SRC/contact.cpp b/plugins/Clist_nicer/SRC/contact.cpp index f553dd2e40..1d8f90e5c2 100644 --- a/plugins/Clist_nicer/SRC/contact.cpp +++ b/plugins/Clist_nicer/SRC/contact.cpp @@ -328,7 +328,6 @@ 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 ea9f451651..ce3295866b 100644 --- a/plugins/Clist_nicer/SRC/extBackg.cpp +++ b/plugins/Clist_nicer/SRC/extBackg.cpp @@ -28,7 +28,6 @@ extern int g_hottrack; extern HWND g_hwndViewModeFrame;
extern HIMAGELIST himlExtraImages;
-extern struct CluiTopButton top_buttons[];
StatusItems_t *StatusItems = NULL;
ImageItem *g_ImageItems = NULL, *g_glyphItem = NULL;
@@ -39,7 +38,7 @@ COLORREF g_CLUISkinnedBkColorRGB = 0; int ID_EXTBK_LAST = ID_EXTBK_LAST_D;
-void SetTBSKinned(int mode);
+//void SetTBSKinned(int mode);
void ReloadThemedOptions();
void ReloadExtraIcons();
static void SaveCompleteStructToDB(void);
@@ -489,7 +488,6 @@ struct {char *szModule; char *szSetting; unsigned int size; int defaultval;} _ta "CLCExt", "applyindentbg", 1, 0,
"CLCExt", "override_status", 1, 0,
"CLCExt", "useperproto", 1, 0,
- "CLUI", "tb_skinned", 1, 0,
"CLUI", "sb_skinned", 1, 0,
"CLC", "RowGap", 1, 0,
"CLC", "ExIconScale", 1, 0,
@@ -498,7 +496,6 @@ struct {char *szModule; char *szSetting; unsigned int size; int defaultval;} _ta "CLUIFrames", "GapBetweenFrames", 4, 0,
"CLC", "BkColour", 4, RGB(224, 224, 224),
"CLCExt", "EXBK_CenterGroupnames", 1, 0,
- "CLUI", "TBSize", 1, 19,
"CLC", "BkBmpUse", 2, 0,
"CLUI", "clmargins", 4, 0,
// frame stuff
@@ -1190,7 +1187,7 @@ static void BTN_ReadItem(char *itemName, char *file) }
else if(_stricmp(szBuffer, "Custom")) {
int i = 0;
-
+/*
while(top_buttons[i].id) {
if (!_stricmp(top_buttons[i].szIcoLibIcon, szBuffer)) {
tmpItem.uId = top_buttons[i].id;
@@ -1199,6 +1196,7 @@ static void BTN_ReadItem(char *itemName, char *file) }
i++;
}
+*/
}
GetPrivateProfileStringA(itemName, "PassContact", "None", szBuffer, 1000, file);
if(_stricmp(szBuffer, "None")) {
@@ -1210,10 +1208,12 @@ static void BTN_ReadItem(char *itemName, char *file) GetPrivateProfileStringA(itemName, "Tip", "None", szBuffer, 1000, file);
if(strcmp(szBuffer, "None")) {
-
+#if defined(_UNICODE)
MultiByteToWideChar(cfg::dat.langPackCP, 0, szBuffer, -1, tmpItem.szTip, 256);
tmpItem.szTip[255] = 0;
-
+#else
+ mir_snprintf(tmpItem.szTip, 256, "%s", szBuffer);
+#endif
}
else
tmpItem.szTip[0] = 0;
@@ -1235,7 +1235,7 @@ static void BTN_ReadItem(char *itemName, char *file) newItem->nextItem = 0;
curItem->nextItem = newItem;
}
- newItem->hWnd = CreateWindowEx(0, _T("CLCButtonClass"), _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, pcli->hwndContactList, (HMENU)newItem->uId, g_hInst, NULL);
+ 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);
SendMessage(newItem->hWnd, BM_SETBTNITEM, 0, (LPARAM)newItem);
SendMessage(newItem->hWnd, BUTTONSETASFLATBTN, 0, 0);
SendMessage(newItem->hWnd, BUTTONSETASFLATBTN + 10, 0, 0);
@@ -1243,7 +1243,7 @@ static void BTN_ReadItem(char *itemName, char *file) SendMessage(newItem->hWnd, BUTTONSETASPUSHBTN, 0, 0);
if(newItem->szTip[0])
- SendMessage(newItem->hWnd, BUTTONADDTOOLTIP, (WPARAM)newItem->szTip, 0);
+ SendMessage(newItem->hWnd, BUTTONADDTOOLTIP, (WPARAM)newItem->szTip, BATF_UNICODE);
return;
}
@@ -1265,16 +1265,14 @@ void IMG_LoadItems() * rewrite the skin loading in TCHAR manner
*/
-
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
-
DBFreeVariant(&dbv);
if (!PathFileExists(tszFileName))
return;
- IMG_DeleteItems();
+ IMG_DeleteItems();
szSections = reinterpret_cast<char *>(malloc(3002));
ZeroMemory(szSections, 3002);
@@ -1295,21 +1293,8 @@ void IMG_LoadItems() BTN_ReadItem(p, szFileName);
p += (lstrlenA(p) + 1);
}
- if(pcli && pcli->hwndContactList)
- SetButtonStates(pcli->hwndContactList);
free(szSections);
- if(g_ButtonItems) {
- while(top_buttons[i].id) {
- if(top_buttons[i].hwnd != 0 && top_buttons[i].id != IDC_TBGLOBALSTATUS && top_buttons[i].id != IDC_TBMENU) {
- DestroyWindow(top_buttons[i].hwnd);
- top_buttons[i].hwnd = 0;
- }
- i++;
- }
- cfg::dat.dwFlags &= ~CLUI_FRAME_SHOWTOPBUTTONS;
- ConfigureCLUIGeometry(0);
- }
if(g_ImageItems) {
cfg::writeByte("CLCExt", "bskinned", 1);
SetButtonToSkinned();
@@ -1333,10 +1318,13 @@ void LoadPerContactSkins(TCHAR *tszFileName) StatusItems_t *items = NULL, *this_item;
HANDLE hContact;
int i = 1;
- char file[MAX_PATH];
+#if defined(_UNICODE)
+ char file[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, file, MAX_PATH, 0, 0);
file[MAX_PATH - 1] = 0;
-
+#else
+ char *file = tszFileName;
+#endif
ReadItem(&default_item, "%Default", file);
ZeroMemory(szSections, 3000);
@@ -1537,7 +1525,6 @@ void extbk_import(char *file, HWND hwndDlg) Reload3dBevelColors();
ReloadThemedOptions();
- SetTBSKinned(cfg::dat.bSkinnedToolbar);
// refresh
if(hwndDlg && ServiceExists(MS_CLNSE_FILLBYCURRENTSEL))
CallService(MS_CLNSE_FILLBYCURRENTSEL, (WPARAM)hwndDlg, 0);
@@ -1547,16 +1534,7 @@ void extbk_import(char *file, HWND hwndDlg) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
if(oldexIconScale != cfg::dat.exIconScale) {
ImageList_SetIconSize(himlExtraImages, cfg::dat.exIconScale, cfg::dat.exIconScale);
- if(cfg::dat.IcoLib_Avail)
- IcoLibReloadIcons();
- else {
- CLN_LoadAllIcons(0);
- //FYR: may be better to call pfnReloadProtoMenus
- pcli->pfnReloadProtoMenus();
- //FYR: Not necessary. It is already notified in pfnReloadProtoMenus
- //NotifyEventHooks(pcli->hPreBuildStatusMenuEvent, 0, 0);
- ReloadExtraIcons();
- }
+ IcoLibReloadIcons();
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
}
@@ -1568,9 +1546,11 @@ static void ApplyCLUISkin() char szFinalName[MAX_PATH];
if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
-
+#if defined(_UNICODE)
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
-
+#else
+ mir_sntprintf(szFinalName, MAX_PATH, _T("%s"), tszFinalName);
+#endif
if(cfg::getByte("CLUI", "skin_changed", 0)) {
extbk_import(szFinalName, 0);
SaveCompleteStructToDB();
@@ -1640,11 +1620,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
case IDC_UNLOAD:
IMG_DeleteItems();
- CreateButtonBar(pcli->hwndContactList);
- if(cfg::dat.bSkinnedToolbar)
- SetTBSKinned(1);
ConfigureFrame();
- SetButtonStates(pcli->hwndContactList);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
break;
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp index 11d68d0012..0c02af384e 100644 --- a/plugins/Clist_nicer/SRC/init.cpp +++ b/plugins/Clist_nicer/SRC/init.cpp @@ -118,7 +118,7 @@ PLUGININFOEX pluginInfo = {0x8f79b4ee, 0xeb48, 0x4a03, { 0x87, 0x3e, 0x27, 0xbe, 0x6b, 0x7e, 0x9a, 0x25 }} //{8F79B4EE-EB48-4a03-873E-27BE6B7E9A25}
};
-
+#if defined(_UNICODE)
void _DebugTraceW(const wchar_t *fmt, ...)
{
#ifdef _DEBUG
@@ -133,7 +133,7 @@ void _DebugTraceW(const wchar_t *fmt, ...) OutputDebugStringW(debug);
#endif
}
-
+#endif
void _DebugTraceA(const char *fmt, ...)
{
@@ -204,7 +204,6 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) if(cfg::dat.bAvatarServiceAvail)
HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
cfg::dat.tabSRMM_Avail = ServiceExists("SRMsg_MOD/GetWindowFlags") ? TRUE : FALSE;
- cfg::dat.IcoLib_Avail = ServiceExists(MS_SKIN2_ADDICON) ? TRUE : FALSE;
ZeroMemory((void *)overlayicons, sizeof(HICON) * 10);
@@ -235,7 +234,6 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link) mir_getLP( &pluginInfo );
API::onInit();
- LoadCLCButtonModule();
RegisterCLUIFrameClasses();
ZeroMemory((void*) &cfg::dat, sizeof(cfg::dat));
@@ -252,8 +250,6 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link) cfg::maxCacheEntry = iCount;
cfg::init();
- cfg::dat.toolbarVisibility = cfg::getDword("CLUI", "TBVisibility", DEFAULT_TB_VISIBILITY);
- cfg::dat.hMenuButtons = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3);
cfg::dat.hMenuNotify = CreatePopupMenu();
cfg::dat.wNextMenuID = 1;
cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150);
@@ -317,23 +313,17 @@ extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link) himlExtraImages = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 30, 2);
ImageList_SetIconSize(himlExtraImages, cfg::dat.exIconScale, cfg::dat.exIconScale);
- cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_SHOWTOPBUTTONS | CLUI_FRAME_STATUSICONS |
- CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN);
+ 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);
CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szProfilePath);
-
MultiByteToWideChar(CP_ACP, 0, szProfilePath, MAX_PATH, cfg::dat.tszProfilePath, MAX_PATH);
cfg::dat.tszProfilePath[MAX_PATH - 1] = 0;
-
_tcslwr(cfg::dat.tszProfilePath);
- if(cfg::getByte("Skin", "UseSound", 0) != cfg::dat.soundsOff)
- cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
-
// get the clist interface
pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) {
diff --git a/plugins/Clist_nicer/SRC/viewmodes.cpp b/plugins/Clist_nicer/SRC/viewmodes.cpp index a8d48f754e..184466b5a2 100644 --- a/plugins/Clist_nicer/SRC/viewmodes.cpp +++ b/plugins/Clist_nicer/SRC/viewmodes.cpp @@ -898,16 +898,19 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
HWND hwndButton;
- hwndSelector = CreateWindowEx(0, _T("CLCButtonClass"), _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwndSelector = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
- SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), 0);
+ SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_UNICODE);
SendMessage(hwndSelector, BM_SETASMENUACTION, 1, 0);
- hwndButton = CreateWindowEx(0, _T("CLCButtonClass"), _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+
+ hwndButton = CreateWindowEx(0, MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), 0);
- hwndButton = CreateWindowEx(0, _T("CLCButtonClass"), _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ 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);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), 0);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_UNICODE);
+
SendMessage(hwnd, WM_USER + 100, 0, 0);
return FALSE;
}
@@ -936,16 +939,9 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
}
case WM_USER + 100:
- if(cfg::dat.IcoLib_Avail) {
- SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_reset"));
- SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_options"));
- SendMessage(GetDlgItem(hwnd, IDC_SELECTMODE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_select"));
- }
- else {
- SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DELETE), IMAGE_ICON, 16, 16, LR_SHARED));
- SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_CLVM_OPTIONS), IMAGE_ICON, 16, 16, LR_SHARED));
- SendMessage(GetDlgItem(hwnd, IDC_SELECTMODE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_CLVM_SELECT), IMAGE_ICON, 16, 16, LR_SHARED));
- }
+ SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_reset"));
+ SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_options"));
+ SendMessage(GetDlgItem(hwnd, IDC_SELECTMODE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"CLN_CLVM_select"));
{
int bSkinned = cfg::getByte("CLCExt", "bskinned", 0);
int i = 0;
@@ -1062,7 +1058,6 @@ 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", "");
@@ -1257,7 +1252,6 @@ 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);
}
|