diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-10 14:46:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-10 14:46:58 +0000 |
commit | 101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff (patch) | |
tree | a846c60f7c2a7df17b694deba92e7f6df3bbb882 /plugins | |
parent | a3fdadd09f12f6b246b11a5156bf6f0358e9a5f8 (diff) |
bitmap operations were removed from TopToolBar and replaced with IcoLib
git-svn-id: http://svn.miranda-ng.org/main/trunk@379 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
87 files changed, 1043 insertions, 1719 deletions
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp index 79cea6c27f..e63e2090fc 100644 --- a/plugins/Alarms/alarms.cpp +++ b/plugins/Alarms/alarms.cpp @@ -200,12 +200,13 @@ HBITMAP LoadBmpFromIcon(int IdRes) return hBmp;
}
-static int InitTopToolbarButton(WPARAM wParam, LPARAM lParam) {
+static int InitTopToolbarButton(WPARAM wParam, LPARAM lParam)
+{
TTBButton ttb = {0};
ttb.cbSize = sizeof(ttb);
- ttb.hbBitmapUp = LoadBmpFromIcon(IDI_TBUP); //LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CLOCK));
- ttb.hbBitmapDown = LoadBmpFromIcon(IDI_TBDN); //LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CLOCK));
+ ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBUP));
+ ttb.hIconDn = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBDN));
ttb.pszServiceDown = MODULE "/NewAlarm";
ttb.dwFlags = TTBBF_VISIBLE;// | TTBBF_DRAWBORDER;
ttb.name = Translate("Set Alarm");
diff --git a/plugins/Clist_nicer/SRC/CLCButton.cpp b/plugins/Clist_nicer/SRC/CLCButton.cpp index 5b3401f068..290484c62f 100644 --- a/plugins/Clist_nicer/SRC/CLCButton.cpp +++ b/plugins/Clist_nicer/SRC/CLCButton.cpp @@ -23,56 +23,34 @@ extern LONG g_cxsmIcon, g_cysmIcon; extern StatusItems_t *StatusItems;
extern ImageItem *g_glyphItem;
-static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+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;
+ 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];
+ ButtonItem *buttonItem;
+ LONG lastGlyphMetrics[4];
} MButtonCtrl;
-static HWND hwndToolTips = NULL;
-
-int UnloadTSButtonModule(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
-int LoadCLCButtonModule(void)
-{
- WNDCLASSEX wc;
-
- ZeroMemory(&wc, sizeof(wc));
- 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;
-}
// Used for our own cheap TrackMouseEvent
#define BUTTON_POLLID 100
@@ -99,613 +77,630 @@ 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;
- }
+ 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;
+ 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);
- }
+ 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 *>(malloc(sizeof(MButtonCtrl)));
- if (bct == NULL)
- return FALSE;
- bct->hwnd = hwndDlg;
- bct->stateId = PBS_NORMAL;
- bct->focus = 0;
- bct->hFont = reinterpret_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT));
- bct->arrow = NULL;
- bct->defbutton = 0;
- bct->hIcon = bct->hIconPrivate = 0;
- bct->iIcon = 0;
- bct->hIml = 0;
- bct->hBitmap = NULL;
- bct->pushBtn = 0;
- bct->pbState = 0;
- bct->hThemeButton = NULL;
- bct->hThemeToolbar = NULL;
- bct->cHot = 0;
- bct->flatBtn = 0;
- bct->bThemed = FALSE;
- bct->bSkinned = bct->bSendOnDown = 0;
- bct->buttonItem = NULL;
- LoadTheme(bct);
- SetWindowLongPtr(hwndDlg, 0, (LONG_PTR) bct);
- if (((CREATESTRUCTA *) 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; // DONT! fall thru
- }
- 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;
+ 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;
- 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:
- {
- TOOLINFO ti;
-
- if (!(char*) wParam)
- break;
- 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);
- }
- 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);
- }
- 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);
+ }
+ 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/Console/Console.c b/plugins/Console/Console.c index 7d08659a8b..eea28e711f 100644 --- a/plugins/Console/Console.c +++ b/plugins/Console/Console.c @@ -122,8 +122,6 @@ static int Openfile(TCHAR *outputFile, int selection); ////////////////////////////////////////////////////////////////////////////////
#ifdef TTB
-static HBITMAP BmpUp = NULL;
-static HBITMAP BmpDn = NULL;
static HANDLE hTTBButt = 0;
static INT_PTR HideConsoleButt(WPARAM wParam,LPARAM lParam)
@@ -149,12 +147,9 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) CreateServiceFunction("Console/Hide", HideConsoleButt);
CreateServiceFunction("Console/Show", ShowConsoleButt);
- BmpUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_UP));
- BmpDn = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_DOWN));
-
ttbb.cbSize = sizeof(ttbb);
- ttbb.hbBitmapUp = BmpUp;
- ttbb.hbBitmapDown = BmpDn;
+ ttbb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE_UP));
+ ttbb.hIconDn = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE_DOWN));
ttbb.dwFlags=(state?TTBBF_PUSHED:0)|TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP;
ttbb.pszServiceDown = "Console/Show";
ttbb.pszServiceUp = "Console/Hide";
@@ -1485,11 +1480,6 @@ void ShutdownConsole(void) for(i = 0; i < SIZEOF(hIcons); i++) {
if (hIcons[i]) DestroyIcon(hIcons[i]);
}
-
-#ifdef TBB
- if (BmpUp) DeleteObject(BmpUp);
- if (BmpDn) DeleteObject(BmpDn);
-#endif
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Console/Console.opt b/plugins/Console/Console.opt Binary files differdeleted file mode 100644 index 8c2c90007d..0000000000 --- a/plugins/Console/Console.opt +++ /dev/null diff --git a/plugins/Console/Console.plg b/plugins/Console/Console.plg deleted file mode 100644 index 60b675e88e..0000000000 --- a/plugins/Console/Console.plg +++ /dev/null @@ -1,49 +0,0 @@ -<html>
-<body>
-<pre>
-<h1>Build Log</h1>
-<h3>
---------------------Configuration: Console - Win32 Release Unicode--------------------
-</h3>
-<h3>Command Lines</h3>
-Creating command line "rc.exe /l 0x409 /fo"Release_Unicode/resource.res" /i "..\..\include" /d "NDEBUG" "D:\Sources\svn.miranda.im\console\trunk\resource.rc""
-Creating temporary file "C:\Temp\RSPB728.tmp" with contents
-[
-/nologo /MD /W3 /GX /Zi /O2 /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c
-"D:\Sources\svn.miranda.im\console\trunk\Commonheaders.c"
-"D:\Sources\svn.miranda.im\console\trunk\Console.c"
-]
-Creating command line "cl.exe @C:\Temp\RSPB728.tmp"
-Creating temporary file "C:\Temp\RSPB729.tmp" with contents
-[
-/nologo /MD /W3 /Zi /Ox /Og /Gf /Gy /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /Fr"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c
-"D:\Sources\svn.miranda.im\console\trunk\init.c"
-]
-Creating command line "cl.exe @C:\Temp\RSPB729.tmp"
-Creating temporary file "C:\Temp\RSPB72A.tmp" with contents
-[
-kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"Release_Unicode/Console.pdb" /map:"Release_Unicode/Console.map" /debug /machine:IX86 /out:"Release_Unicode\Plugins\Console.dll" /implib:".\Release/Console.lib"
-.\Release\Commonheaders.obj
-.\Release\Console.obj
-.\Release\init.obj
-.\Release_Unicode\resource.res
-]
-Creating command line "link.exe @C:\Temp\RSPB72A.tmp"
-<h3>Output Window</h3>
-Compiling resources...
-Compiling...
-Commonheaders.c
-Console.c
-Generating Code...
-Compiling...
-init.c
-Linking...
- Creating library .\Release/Console.lib and object .\Release/Console.exp
-
-
-
-<h3>Results</h3>
-Console.dll - 0 error(s), 0 warning(s)
-</pre>
-</body>
-</html>
diff --git a/plugins/Console/res/console_dn.bmp b/plugins/Console/res/console_dn.bmp Binary files differdeleted file mode 100644 index 33bb07c0f2..0000000000 --- a/plugins/Console/res/console_dn.bmp +++ /dev/null diff --git a/plugins/Console/res/console_dn.ico b/plugins/Console/res/console_dn.ico Binary files differnew file mode 100644 index 0000000000..be752114a7 --- /dev/null +++ b/plugins/Console/res/console_dn.ico diff --git a/plugins/Console/res/console_up.bmp b/plugins/Console/res/console_up.bmp Binary files differdeleted file mode 100644 index 2cdbb8d0cc..0000000000 --- a/plugins/Console/res/console_up.bmp +++ /dev/null diff --git a/plugins/Console/res/console_up.ico b/plugins/Console/res/console_up.ico Binary files differnew file mode 100644 index 0000000000..2c8198b29c --- /dev/null +++ b/plugins/Console/res/console_up.ico diff --git a/plugins/Console/resource.h b/plugins/Console/resource.h index e0b9ed225a..a8947819a4 100644 --- a/plugins/Console/resource.h +++ b/plugins/Console/resource.h @@ -2,8 +2,8 @@ // Microsoft Visual C++ generated include file.
// Used by resource.rc
//
-#define IDB_CONSOLE_UP 100
-#define IDB_CONSOLE_DOWN 101
+#define IDI_CONSOLE_UP 100
+#define IDI_CONSOLE_DOWN 101
#define IDD_MSG 111
#define IDD_CONSOLE 112
#define IDD_LOG 113
diff --git a/plugins/Console/resource.rc b/plugins/Console/resource.rc index c67981d6d4..55f6382d2f 100644 --- a/plugins/Console/resource.rc +++ b/plugins/Console/resource.rc @@ -180,14 +180,8 @@ IDI_OUT ICON "Res\\out.ico" IDI_ARROW ICON "Res\\arrow.ico"
IDI_INFO ICON "Res\\info.ico"
IDI_EMPTY ICON "Res\\empty.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_CONSOLE_UP BITMAP "res\\console_up.bmp"
-IDB_CONSOLE_DOWN BITMAP "res\\console_dn.bmp"
+IDI_CONSOLE_UP ICON "Res\\console_up.ico"
+IDI_CONSOLE_DOWN ICON "Res\\console_dn.ico"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 5628f68de8..f67a3f965b 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -3,20 +3,17 @@ #define M_TOPTOOLBAR_H
//button flags
-#define TTBBF_DISABLED 1
-#define TTBBF_VISIBLE 2
-#define TTBBF_PUSHED 4
-#define TTBBF_SHOWTOOLTIP 8
-#define TTBBF_DRAWBORDER 16//draw border for bitmap,bitmap must be WxH 16x12
-#define TTBBF_ISSEPARATOR 32
-
-//for internal launch buttons
+#define TTBBF_DISABLED 1
+#define TTBBF_VISIBLE 2
+#define TTBBF_PUSHED 4
+#define TTBBF_SHOWTOOLTIP 8
+#define TTBBF_DRAWBORDER 16
+#define TTBBF_ISSEPARATOR 32
#define TTBBF_ISLBUTTON 64
+#define TTBBF_ICONBYHANDLE 128
typedef struct {
int cbSize;
- HBITMAP hbBitmapUp;
- HBITMAP hbBitmapDown;
char *pszServiceUp;
char *pszServiceDown;
DWORD dwFlags;
@@ -25,26 +22,18 @@ typedef struct { LPARAM lParamDown;
WPARAM wParamDown;
char *name;
-
-} TTBButton, * lpTTBButton;
-
-typedef struct {
- int cbSize;
- HBITMAP hbBitmapUp;
- HBITMAP hbBitmapDown;
- char *pszServiceUp;
- char *pszServiceDown;
- DWORD dwFlags;
- LPARAM lParamUp;
- WPARAM wParamUp;
- LPARAM lParamDown;
- WPARAM wParamDown;
- char *name;
- HICON hIconUp,hIconDn;
+ union {
+ HICON hIconUp;
+ HANDLE hIconHandleUp;
+ };
+ union {
+ HICON hIconDn;
+ HANDLE hIconHandleDn;
+ };
char *tooltipUp;
char *tooltipDn;
-
-} TTBButtonV2, * lpTTBButtonV2;
+}
+ TTBButton, * lpTTBButton;
//=== EVENTS ===
/*
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp index ca89e587f9..f5fbfd6d20 100644 --- a/plugins/ListeningTo/listeningto.cpp +++ b/plugins/ListeningTo/listeningto.cpp @@ -34,8 +34,6 @@ Boston, MA 02111-1307, USA. #define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable"
#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle"
-#define ICON_NAME "LISTENING_TO_ICON"
-
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -60,8 +58,8 @@ struct UTF8_INTERFACE utfi; static std::vector<HANDLE> hHooks;
static std::vector<HANDLE> hServices;
-static HANDLE hEnableStateChangedEvent = NULL;
-HANDLE hExtraIcon = NULL;
+static HANDLE hEnableStateChangedEvent;
+HANDLE hExtraIcon, hIcon1, hIcon2;
static HANDLE hMainMenuGroup = NULL;
static HANDLE hListeningInfoChangedEvent = NULL;
@@ -74,7 +72,6 @@ static DWORD lastInfoSetTime = 0; std::vector<ProtocolInfo> proto_itens;
-
int ModulesLoaded(WPARAM wParam, LPARAM lParam);
int PreShutdown(WPARAM wParam, LPARAM lParam);
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam);
@@ -117,47 +114,24 @@ TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai); // Functions ////////////////////////////////////////////////////////////////////////////
-
-
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
return TRUE;
}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
pluginInfo.cbSize = sizeof(PLUGININFOEX);
return &pluginInfo;
}
-
static const MUUID interfaces[] = { MIID_LISTENINGTO, MIID_LAST };
extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
-/*
-BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
-{
- // Find the windows
- char class_name[1024];
- if (GetClassNameA(hwnd, class_name, sizeof(class_name)))
- {
- class_name[sizeof(class_name)-1] = '\0';
-OutputDebugStringA(class_name);
-OutputDebugStringA(" -> ");
- GetWindowTextA(hwnd, class_name, 1024);
-OutputDebugStringA(class_name);
-OutputDebugStringA("\n");
- }
-
- return TRUE;
-}
-*/
-
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink = link;
@@ -352,10 +326,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) // add our modules to the KnownModules list
CallService("DBEditorpp/RegisterSingleModule", (WPARAM) MODULE_NAME, 0);
- IcoLib_Register(ICON_NAME, _T("Contact List"), _T("Listening to"), IDI_LISTENINGTO);
+ hIcon1 = IcoLib_Register("listening_to_icon", _T("Contact List"), _T("Listening to"), IDI_LISTENINGTO);
+ hIcon2 = IcoLib_Register("listening_off_icon", _T("Contact List"), _T("Listening to"), IDI_LISTENINGOFF);
// Extra icon support
- hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", ICON_NAME);
+ hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", "listening_to_icon");
if (hExtraIcon != NULL)
{
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
@@ -390,8 +365,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.position = 500080000;
mi.pszPopupName = (char*) -1;
mi.pszName = "Listening to";
- mi.flags = CMIF_ROOTPOPUP;
- mi.hIcon = IcoLib_LoadIcon(ICON_NAME);
+ mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = hIcon1;
hMainMenuGroup = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &mi);
@@ -594,11 +569,11 @@ int TopToolBarLoaded(WPARAM wParam, LPARAM lParam) TTBButton ttb = {0};
ttb.cbSize = sizeof(ttb);
- ttb.hbBitmapUp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TTB_UP_DISABLED));
- ttb.hbBitmapDown = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TTB_UP_ENABLED));
+ ttb.hIconHandleDn = hIcon2;
+ ttb.hIconHandleUp = hIcon1;
ttb.pszServiceUp = MS_LISTENINGTO_TTB;
ttb.pszServiceDown = MS_LISTENINGTO_TTB;
- ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | (enabled ? TTBBF_PUSHED : 0);
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ICONBYHANDLE | TTBBF_SHOWTOOLTIP | (enabled ? TTBBF_PUSHED : 0);
ttb.name = Translate("Enable/Disable sending Listening To info (to all protocols)");
hTTB = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb, 0);
@@ -1076,11 +1051,11 @@ void HasNewListeningInfo() int ClistExtraListRebuild(WPARAM wParam, LPARAM lParam)
{
- HICON hIcon = IcoLib_LoadIcon(ICON_NAME);
+ HICON hIcon = Skin_GetIconByHandle(hIcon1);
hExtraImage = (HANDLE) CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM) hIcon, 0);
- IcoLib_ReleaseIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
@@ -1089,7 +1064,7 @@ void SetExtraIcon(HANDLE hContact, BOOL set) {
if (hExtraIcon != NULL)
{
- ExtraIcon_SetIcon(hExtraIcon, hContact, set ? ICON_NAME : NULL);
+ ExtraIcon_SetIcon(hExtraIcon, hContact, set ? "listening_to_icon" : NULL);
}
else if (opts.show_adv_icon && hExtraImage != NULL)
{
@@ -1248,5 +1223,3 @@ TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai) {
VARIABLES_PARSE_BODY(ptszPlayer);
}
-
-
diff --git a/plugins/ListeningTo/res/listening_off.ico b/plugins/ListeningTo/res/listening_off.ico Binary files differnew file mode 100644 index 0000000000..bdacbb028a --- /dev/null +++ b/plugins/ListeningTo/res/listening_off.ico diff --git a/plugins/ListeningTo/res/ttb_disabled.bmp b/plugins/ListeningTo/res/ttb_disabled.bmp Binary files differdeleted file mode 100644 index df1a9abde5..0000000000 --- a/plugins/ListeningTo/res/ttb_disabled.bmp +++ /dev/null diff --git a/plugins/ListeningTo/res/ttb_enabled.bmp b/plugins/ListeningTo/res/ttb_enabled.bmp Binary files differdeleted file mode 100644 index 98467fb6e5..0000000000 --- a/plugins/ListeningTo/res/ttb_enabled.bmp +++ /dev/null diff --git a/plugins/ListeningTo/resource.h b/plugins/ListeningTo/resource.h index 3f35843a69..d4084c98b4 100644 --- a/plugins/ListeningTo/resource.h +++ b/plugins/ListeningTo/resource.h @@ -5,9 +5,8 @@ #define IDD_OPTIONS 119
#define IDD_PLAYERS 120
#define IDD_FORMAT 121
-#define IDB_TTB_UP_DISABLED 122
-#define IDB_TTB_UP_ENABLED 123
-#define IDI_LISTENINGTO 124
+#define IDI_LISTENINGTO 122
+#define IDI_LISTENINGOFF 123
#define IDC_DELAY 1001
#define IDC_WINCOLORS 1002
#define IDC_DEFAULTCOLORS 1003
@@ -81,7 +80,7 @@ #define IDC_STATIC -1
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
diff --git a/plugins/ListeningTo/resource.rc b/plugins/ListeningTo/resource.rc index 893cf39de6..49f777458d 100644 --- a/plugins/ListeningTo/resource.rc +++ b/plugins/ListeningTo/resource.rc @@ -116,7 +116,7 @@ END //
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_OPTIONS, DIALOG
BEGIN
@@ -147,14 +147,6 @@ END /////////////////////////////////////////////////////////////////////////////
//
-// Bitmap
-//
-
-IDB_TTB_UP_DISABLED BITMAP "res\\ttb_disabled.bmp"
-IDB_TTB_UP_ENABLED BITMAP "res\\ttb_enabled.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
// Icon
//
@@ -180,19 +172,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""resource.h""\r\n"
"#include ""winresrc.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -214,4 +206,3 @@ END /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 7f17238cf2..afebbe75e3 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -211,7 +211,7 @@ static int IconsChanged(WPARAM wParam,LPARAM lParam){ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItemHistory,(LPARAM)&mi);
if (hTTButton >= 0) {
- TTBButtonV2 btn = {0};
+ TTBButton btn = {0};
btn.cbSize = sizeof(btn);
btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
btn.lParamUp = 1;
@@ -230,7 +230,7 @@ static int IconsChanged(WPARAM wParam,LPARAM lParam){ static int TTBLoaded(WPARAM wParam,LPARAM lParam){
if (hTTButton < 0) {
- TTBButtonV2 btn = {0};
+ TTBButton btn = {0};
btn.cbSize = sizeof(btn);
btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
btn.lParamUp = 1;
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp index af3a21f501..cbb77d8491 100644 --- a/plugins/RecentContacts/RecentContacts.cpp +++ b/plugins/RecentContacts/RecentContacts.cpp @@ -14,16 +14,11 @@ int hLangpack = 0; MM_INTERFACE mmi;
LIST_INTERFACE li;
-HANDLE hMenu = NULL;
-HANDLE hPrebuildMenu = NULL;
-HANDLE hSystemModulesLoaded = NULL;
-HANDLE hTopToolbarLoaded = NULL;
-HANDLE hTopToolbarButtonShowList = NULL;
-HANDLE hMsgWndEvent = NULL;
-HANDLE hWindowList = NULL;
-HANDLE hMenuItemRemove = NULL;
-HANDLE hOptInitialise = NULL;
-HANDLE hContactSetting = NULL;
+HANDLE hTopToolbarButtonShowList;
+HANDLE hMsgWndEvent;
+HANDLE hWindowList;
+HANDLE hMenuItemRemove;
+HANDLE hIcon;
const INT_PTR boo = 0;
LIST<void> ServiceList(10,boo), HookList(10,boo);
@@ -466,10 +461,8 @@ int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam) if (ServiceExists(MS_TTB_ADDBUTTON)) {
TTBButton ttbb = { 0 };
ttbb.cbSize = sizeof(ttbb);
- ttbb.hbBitmapUp =
- ttbb.hbBitmapDown = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CMD_SHOWLASTUSED));
- ttbb.pszServiceUp =
- ttbb.pszServiceDown = msLastUC_ShowList;
+ ttbb.hIconHandleDn = ttbb.hIconHandleDn = hIcon;
+ ttbb.pszServiceUp = ttbb.pszServiceDown = msLastUC_ShowList;
ttbb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP|TTBBF_DRAWBORDER;
ttbb.name = Translate(msLastUC_ShowListName);
@@ -540,7 +533,7 @@ static void iconsInit(void) sid.pszDescription = LPGEN("Main icon");
sid.pszName = "recent_main";
sid.iDefaultIndex = -IDI_SHOWRECENT;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIcon = Skin_AddIcon(&sid);
}
static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam)
diff --git a/plugins/RecentContacts/RecentContacts.ico b/plugins/RecentContacts/RecentContacts.ico Binary files differindex 765c18bb73..25efdf36ab 100644 --- a/plugins/RecentContacts/RecentContacts.ico +++ b/plugins/RecentContacts/RecentContacts.ico diff --git a/plugins/RecentContacts/resource.h b/plugins/RecentContacts/resource.h index 93dc6a4a6f..59e47a934a 100644 --- a/plugins/RecentContacts/resource.h +++ b/plugins/RecentContacts/resource.h @@ -4,10 +4,8 @@ //
#define IDD_LASTUC_OPT 9
#define IDI_FOLDER 101
-#define IDB_FOLDER 102
-#define IDI_CMD_BROWSE 103
+#define IDI_CMD_BROWSE 102
#define IDI_SHOWRECENT 103
-#define IDB_CMD_SHOWLASTUSED 104
#define IDD_LASTUC_DIALOG 105
#define IDC_LIST1 1000
#define IDC_CONTACTS_LIST 1000
@@ -16,7 +14,7 @@ #define IDC_DATETIME 1005
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
diff --git a/plugins/RecentContacts/resource.rc b/plugins/RecentContacts/resource.rc index 7656a189e4..463d9f0a76 100644 --- a/plugins/RecentContacts/resource.rc +++ b/plugins/RecentContacts/resource.rc @@ -23,26 +23,19 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT /////////////////////////////////////////////////////////////////////////////
//
-// Bitmap
-//
-
-IDB_CMD_SHOWLASTUSED BITMAP "RecentContacts.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
// Dialog
//
IDD_LASTUC_DIALOG DIALOGEX 0, 0, 150, 200
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Recent Contacts"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "",IDC_CONTACTS_LIST,"SysListView32",LVS_REPORT |
- LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS |
- LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
+ CONTROL "",IDC_CONTACTS_LIST,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS |
+ LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
WS_TABSTOP,0,0,150,200
END
@@ -65,18 +58,18 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -133,7 +126,7 @@ IDI_SHOWRECENT ICON "RecentContacts.ico" //
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_LASTUC_OPT, DIALOG
BEGIN
@@ -161,4 +154,3 @@ END /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/SimpleStatusMsg/main.cpp b/plugins/SimpleStatusMsg/main.cpp index 47a3e38eb0..44beb6312e 100644 --- a/plugins/SimpleStatusMsg/main.cpp +++ b/plugins/SimpleStatusMsg/main.cpp @@ -1625,7 +1625,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d static int AddTopToolbarButton(WPARAM wParam, LPARAM lParam)
{
- TTBButtonV2 ttbb = {0};
+ TTBButton ttbb = {0};
ttbb.cbSize = sizeof(ttbb);
ttbb.hIconUp = ttbb.hIconDn = LoadIconEx("csmsg");
diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc b/plugins/StatusPlugins/StartupStatus/StartupStatus.rc index fd2f96e9f3..8f41f36229 100644 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc +++ b/plugins/StatusPlugins/StartupStatus/StartupStatus.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -53,8 +53,7 @@ END IDI_TTBDOWN ICON "res\\ttbDown.ico"
IDI_TTBUP ICON "res\\ttbUp.ico"
-IDB_TTBDOWN BITMAP "res\\ttbDown.bmp"
-IDB_TTBUP BITMAP "res\\ttbUp.bmp"
+
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
@@ -69,4 +68,3 @@ IDB_TTBUP BITMAP "res\\ttbUp.bmp" /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 6422091cc6..91b437f7ed 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -33,8 +33,6 @@ static int CountSettings(const char *szSetting,LPARAM lParam); static int DeleteSetting(const char *szSetting,LPARAM lParam);
static int ClearDatabase(char* filter);
-int LoadMainOptions();
-
/////////////////////////////////////////////////////////////////////////////////////////
static TSettingsList* GetCurrentProtoSettings()
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index c6f4298f19..339733b31a 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -366,7 +366,7 @@ static int UnregisterHotKeys() return 0;
}
-int ReinitProfileModule()
+int LoadMainOptions()
{
if (ServiceExists(MS_TTB_ADDBUTTON)) {
RemoveTopToolbarButtons();
@@ -376,17 +376,15 @@ int ReinitProfileModule() RemoveTopToolbarButtons();
CreateTopToolbarButtons(0,0);
}
+
UnregisterHotKeys();
RegisterHotKeys();
-
return 0;
}
int LoadProfileModule()
{
hLoadAndSetProfileService = CreateServiceFunction(MS_SS_LOADANDSETPROFILE, LoadAndSetProfile);
- hTBModuleLoadedHook = HookEvent(ME_TB_MODULELOADED, CreateToolbarButtons);
-
RegisterButtons();
return 0;
}
@@ -394,10 +392,11 @@ int LoadProfileModule() int InitProfileModule()
{
hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButtons);
- ReinitProfileModule();
+ hTBModuleLoadedHook = HookEvent(ME_TB_MODULELOADED, CreateToolbarButtons);
hPrebuildProfilesMenu = HookEvent( ME_CLIST_PREBUILDSTATUSMENU, CreateMainMenuItems);
- CreateMainMenuItems(0,0);
+ CreateMainMenuItems(0,0);
+ RegisterHotKeys();
return 0;
}
diff --git a/plugins/StatusPlugins/StartupStatus/res/ttbDown.bmp b/plugins/StatusPlugins/StartupStatus/res/ttbDown.bmp Binary files differdeleted file mode 100644 index 91f95e240b..0000000000 --- a/plugins/StatusPlugins/StartupStatus/res/ttbDown.bmp +++ /dev/null diff --git a/plugins/StatusPlugins/StartupStatus/res/ttbUp.bmp b/plugins/StatusPlugins/StartupStatus/res/ttbUp.bmp Binary files differdeleted file mode 100644 index 5b684407a5..0000000000 --- a/plugins/StatusPlugins/StartupStatus/res/ttbUp.bmp +++ /dev/null diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 13b58e2e52..c9ad54ebb7 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -284,12 +284,6 @@ static VOID CALLBACK SetStatusTimed(HWND hwnd,UINT message, UINT_PTR idEvent,DWO CallService(MS_CS_SETSTATUSEX, (WPARAM)&startupSettings, 0);
}
-int LoadMainOptions()
-{
- ReinitProfileModule();
- return 0;
-}
-
static int Exit(WPARAM wParam, LPARAM lParam)
{
DeinitProfilesModule();
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h index 19ff57e76f..c1e8e69bb8 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.h +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h @@ -159,7 +159,6 @@ void RegisterButtons(); int LoadProfileModule();
int InitProfileModule();
-int ReinitProfileModule();
int DeinitProfilesModule();
#endif //__STARTUPSTATUSHEADER
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index 7a12697c52..9b8ab6c475 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -53,35 +53,34 @@ int RemoveTopToolbarButtons() int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam)
{
- TTBButton ttb;
- int i, profileCount;
- DBVARIANT dbv;
- char setting[80];
-
- profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0);
+ int profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0);
ttbButtons = ( HANDLE* )realloc(ttbButtons, profileCount*sizeof(HANDLE));
- ZeroMemory(&ttb,sizeof(ttb));
- ZeroMemory(&dbv,sizeof(dbv));
+
+ TTBButton ttb = { 0 };
ttb.cbSize = sizeof(ttb);
- ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP;
- ttb.hbBitmapDown = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_TTBDOWN));
- ttb.hbBitmapUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_TTBUP));
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ICONBYHANDLE;
ttb.pszServiceDown = ttb.pszServiceUp = MS_SS_LOADANDSETPROFILE;
- for (i=0;i<profileCount;i++) {
- char profileName[128];
- INT_PTR ttbAddResult = -1;
-
+ for (int i=0; i < profileCount; i++) {
+ char setting[80];
_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
- if (!DBGetContactSettingByte(NULL, MODULENAME, setting, FALSE)) continue;
+ if (!DBGetContactSettingByte(NULL, MODULENAME, setting, FALSE))
+ continue;
+
+ DBVARIANT dbv;
_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_PROFILENAME);
- if (DBGetContactSetting(NULL, MODULENAME, setting, &dbv)) continue;
+ if (DBGetContactSetting(NULL, MODULENAME, setting, &dbv))
+ continue;
+
+ char profileName[128];
strncpy(profileName, dbv.pszVal, sizeof(profileName)-1);
ttb.name = profileName;
+ ttb.hIconHandleDn = hTtbDown;
+ ttb.hIconHandleUp = hTtbUp;
ttb.wParamDown = ttb.wParamUp = i;
- ttbAddResult = CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb, 0);
+ INT_PTR ttbAddResult = CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb, 0);
if (ttbAddResult != -1) {
ttbButtons[ttbButtonCount] = (HANDLE)ttbAddResult;
- // this tooltip makes miranda crash if changed > 3 times or so
+
CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,ttbButtons[ttbButtonCount]), (LPARAM)profileName);
DBFreeVariant(&dbv);
ttbButtonCount += 1;
@@ -182,10 +181,10 @@ void RegisterButtons() sid.pszDescription = "Pressed toolbar icon";
sid.iDefaultIndex = -IDI_TTBDOWN;
sid.flags = SIDF_PATH_TCHAR;
- hTtbDown = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hTtbDown = Skin_AddIcon(&sid);
sid.pszName = "StartupStatus/TtbUp";
sid.pszDescription = "Released toolbar icon";
sid.iDefaultIndex = -IDI_TTBUP;
- hTtbUp = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hTtbUp = Skin_AddIcon(&sid);
}
diff --git a/plugins/StatusPlugins/resource.h b/plugins/StatusPlugins/resource.h index 38bdf18a3b..3fbeccde84 100644 --- a/plugins/StatusPlugins/resource.h +++ b/plugins/StatusPlugins/resource.h @@ -9,8 +9,6 @@ #define IDD_CMDLOPTIONS 106
#define IDD_ADDPROFILE 109
#define IDD_OPT_STARTUPSTATUS 110
-#define IDB_TTBDOWN 111
-#define IDB_TTBUP 112
#define IDD_PUOPT_KEEPSTATUS 113
#define IDD_OPT_AUTOAWAYMSG 114
#define IDI_TICK 117
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp index 8412f5410e..4860f13e09 100644 --- a/plugins/Svc_dbepp/main.cpp +++ b/plugins/Svc_dbepp/main.cpp @@ -153,7 +153,7 @@ BOOL IsCP_UTF8(void) static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
{
- TTBButtonV2 ttbb = {0};
+ TTBButton ttbb = {0};
HICON ico = LoadIcon(hInst,MAKEINTRESOURCE(ICO_DBE_BUTT));
UnhookEvent(hTTBHook);
diff --git a/plugins/TopToolBar/InternalButtons.cpp b/plugins/TopToolBar/InternalButtons.cpp index 5b7fc1db2a..06d4488c94 100644 --- a/plugins/TopToolBar/InternalButtons.cpp +++ b/plugins/TopToolBar/InternalButtons.cpp @@ -223,7 +223,7 @@ int LoadInternalButtons(HWND hwnd) ShowGroups = DBGetContactSettingByte(NULL, "CList", "UseGroups", 2);
SoundsEnabled = DBGetContactSettingByte(NULL, "Skin", "UseSound", 1);
- TTBButtonV2 ttb = { 0 };
+ TTBButton ttb = { 0 };
ttb.cbSize = sizeof(ttb);
ttb.hIconUp = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_SHOWONLINEUP), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_SHOWONLINEDN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
diff --git a/plugins/TopToolBar/TopToolBar.vcxproj b/plugins/TopToolBar/TopToolBar.vcxproj index f71c76676b..0822bd90e2 100644 --- a/plugins/TopToolBar/TopToolBar.vcxproj +++ b/plugins/TopToolBar/TopToolBar.vcxproj @@ -238,36 +238,17 @@ <ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
- <None Include="bmp\bitmap1.bmp" />
- <None Include="bmp\bmp00002.bmp" />
- <None Include="bmp\borderup.bmp" />
- <None Include="bmp\borederdn.bmp" />
- <None Include="bmp\cpaneldn.bmp" />
- <None Include="bmp\cpanelup.bmp" />
+ <None Include="bmp\sep.bmp" />
<None Include="find.ico" />
<None Include="icos\Find_Add Contacts_DN.ico" />
<None Include="icos\Find_Add Contacts_UP.ico" />
- <None Include="bmp\finduser.bmp" />
- <None Include="bmp\finduserdn.bmp" />
- <None Include="bmp\groupdn.bmp" />
<None Include="icos\Groups On_Off_DN.ico" />
<None Include="icos\Groups On_Off_UP.ico" />
- <None Include="bmp\groupup.bmp" />
- <None Include="bmp\launch.bmp" />
- <None Include="bmp\launchdn.bmp" />
- <None Include="bmp\launchup.bmp" />
- <None Include="bmp\menudn.bmp" />
- <None Include="bmp\menuup.bmp" />
<None Include="icos\Minimize Button_DN.ico" />
<None Include="icos\Minimize Button_UP.ico" />
- <None Include="bmp\minimize.bmp" />
- <None Include="bmp\minimizedn.bmp" />
<None Include="icos\notick.ico" />
<None Include="icos\notick1.ico" />
- <None Include="bmp\options.bmp" />
<None Include="icos\Run.ico" />
- <None Include="bmp\searchtest.bmp" />
- <None Include="bmp\sep.bmp" />
<None Include="icos\Show Main Menu_DN.ico" />
<None Include="icos\Show Main Menu_UP.ico" />
<None Include="icos\Show only Online Users_DN.ico" />
@@ -276,9 +257,6 @@ <None Include="icos\Show Options Page_UP.ico" />
<None Include="icos\Sounds Enable_Disable_DN.ico" />
<None Include="icos\Sounds Enable_Disable_UP.ico" />
- <None Include="bmp\soundsdn.bmp" />
- <None Include="bmp\soundsup.bmp" />
- <None Include="bmp\test.bmp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="main.rc">
diff --git a/plugins/TopToolBar/TopToolBar.vcxproj.filters b/plugins/TopToolBar/TopToolBar.vcxproj.filters index 12fb8c451d..43d0d470cc 100644 --- a/plugins/TopToolBar/TopToolBar.vcxproj.filters +++ b/plugins/TopToolBar/TopToolBar.vcxproj.filters @@ -26,24 +26,6 @@ </ClInclude>
</ItemGroup>
<ItemGroup>
- <None Include="bmp\bitmap1.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\bmp00002.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\borderup.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\borederdn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\cpaneldn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\cpanelup.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="find.ico">
<Filter>Resource Files</Filter>
</None>
@@ -53,69 +35,27 @@ <None Include="icos\Find_Add Contacts_UP.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\finduser.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\finduserdn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\groupdn.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="icos\Groups On_Off_DN.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="icos\Groups On_Off_UP.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\groupup.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\launch.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\launchdn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\launchup.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\menudn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\menuup.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="icos\Minimize Button_DN.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="icos\Minimize Button_UP.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\minimize.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\minimizedn.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="icos\notick.ico">
<Filter>Resource Files</Filter>
</None>
<None Include="icos\notick1.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\options.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="icos\Run.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\searchtest.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\sep.bmp">
- <Filter>Resource Files</Filter>
- </None>
<None Include="icos\Show Main Menu_DN.ico">
<Filter>Resource Files</Filter>
</None>
@@ -140,13 +80,7 @@ <None Include="icos\Sounds Enable_Disable_UP.ico">
<Filter>Resource Files</Filter>
</None>
- <None Include="bmp\soundsdn.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\soundsup.bmp">
- <Filter>Resource Files</Filter>
- </None>
- <None Include="bmp\test.bmp">
+ <None Include="bmp\sep.bmp">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
diff --git a/plugins/TopToolBar/bmp/bitmap1.bmp b/plugins/TopToolBar/bmp/bitmap1.bmp Binary files differdeleted file mode 100644 index 573b7d6186..0000000000 --- a/plugins/TopToolBar/bmp/bitmap1.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/bmp00001.bmp b/plugins/TopToolBar/bmp/bmp00001.bmp Binary files differdeleted file mode 100644 index 7c97999188..0000000000 --- a/plugins/TopToolBar/bmp/bmp00001.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/bmp00002.bmp b/plugins/TopToolBar/bmp/bmp00002.bmp Binary files differdeleted file mode 100644 index 6e8e840620..0000000000 --- a/plugins/TopToolBar/bmp/bmp00002.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/borderup.bmp b/plugins/TopToolBar/bmp/borderup.bmp Binary files differdeleted file mode 100644 index 2d7fd71299..0000000000 --- a/plugins/TopToolBar/bmp/borderup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/borederdn.bmp b/plugins/TopToolBar/bmp/borederdn.bmp Binary files differdeleted file mode 100644 index 53809acff3..0000000000 --- a/plugins/TopToolBar/bmp/borederdn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/cpaneldn.bmp b/plugins/TopToolBar/bmp/cpaneldn.bmp Binary files differdeleted file mode 100644 index 2f4e2a95b5..0000000000 --- a/plugins/TopToolBar/bmp/cpaneldn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/cpanelup.bmp b/plugins/TopToolBar/bmp/cpanelup.bmp Binary files differdeleted file mode 100644 index fc3531facd..0000000000 --- a/plugins/TopToolBar/bmp/cpanelup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/findusedn.bmp b/plugins/TopToolBar/bmp/findusedn.bmp Binary files differdeleted file mode 100644 index f21e56fb95..0000000000 --- a/plugins/TopToolBar/bmp/findusedn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/finduser.bmp b/plugins/TopToolBar/bmp/finduser.bmp Binary files differdeleted file mode 100644 index e6a884651b..0000000000 --- a/plugins/TopToolBar/bmp/finduser.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/finduserdn.bmp b/plugins/TopToolBar/bmp/finduserdn.bmp Binary files differdeleted file mode 100644 index 668a92c4b5..0000000000 --- a/plugins/TopToolBar/bmp/finduserdn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/groupdn.bmp b/plugins/TopToolBar/bmp/groupdn.bmp Binary files differdeleted file mode 100644 index 9a106b15ee..0000000000 --- a/plugins/TopToolBar/bmp/groupdn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/groupup.bmp b/plugins/TopToolBar/bmp/groupup.bmp Binary files differdeleted file mode 100644 index 7bc71b6764..0000000000 --- a/plugins/TopToolBar/bmp/groupup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/launch.bmp b/plugins/TopToolBar/bmp/launch.bmp Binary files differdeleted file mode 100644 index 326c0d31c6..0000000000 --- a/plugins/TopToolBar/bmp/launch.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/launchdn.bmp b/plugins/TopToolBar/bmp/launchdn.bmp Binary files differdeleted file mode 100644 index 0e72934853..0000000000 --- a/plugins/TopToolBar/bmp/launchdn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/launchup.bmp b/plugins/TopToolBar/bmp/launchup.bmp Binary files differdeleted file mode 100644 index 22584a7e3b..0000000000 --- a/plugins/TopToolBar/bmp/launchup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/menudn.bmp b/plugins/TopToolBar/bmp/menudn.bmp Binary files differdeleted file mode 100644 index ad93aff878..0000000000 --- a/plugins/TopToolBar/bmp/menudn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/menuup.bmp b/plugins/TopToolBar/bmp/menuup.bmp Binary files differdeleted file mode 100644 index a3a902ae6e..0000000000 --- a/plugins/TopToolBar/bmp/menuup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/minimize.bmp b/plugins/TopToolBar/bmp/minimize.bmp Binary files differdeleted file mode 100644 index 4749fa9369..0000000000 --- a/plugins/TopToolBar/bmp/minimize.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/minimizedn.bmp b/plugins/TopToolBar/bmp/minimizedn.bmp Binary files differdeleted file mode 100644 index f8470a3d6a..0000000000 --- a/plugins/TopToolBar/bmp/minimizedn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/options.bmp b/plugins/TopToolBar/bmp/options.bmp Binary files differdeleted file mode 100644 index 945be884f4..0000000000 --- a/plugins/TopToolBar/bmp/options.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/searchtest.bmp b/plugins/TopToolBar/bmp/searchtest.bmp Binary files differdeleted file mode 100644 index 2b2fda1042..0000000000 --- a/plugins/TopToolBar/bmp/searchtest.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/separator.bmp b/plugins/TopToolBar/bmp/separator.bmp Binary files differdeleted file mode 100644 index fa4a4449f0..0000000000 --- a/plugins/TopToolBar/bmp/separator.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/soundsdn.bmp b/plugins/TopToolBar/bmp/soundsdn.bmp Binary files differdeleted file mode 100644 index 224e299691..0000000000 --- a/plugins/TopToolBar/bmp/soundsdn.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/soundsup.bmp b/plugins/TopToolBar/bmp/soundsup.bmp Binary files differdeleted file mode 100644 index c11e7521fe..0000000000 --- a/plugins/TopToolBar/bmp/soundsup.bmp +++ /dev/null diff --git a/plugins/TopToolBar/bmp/test.bmp b/plugins/TopToolBar/bmp/test.bmp Binary files differdeleted file mode 100644 index b3b4252fef..0000000000 --- a/plugins/TopToolBar/bmp/test.bmp +++ /dev/null diff --git a/plugins/TopToolBar/common.h b/plugins/TopToolBar/common.h index 6e51009e93..7a51636e2a 100644 --- a/plugins/TopToolBar/common.h +++ b/plugins/TopToolBar/common.h @@ -58,10 +58,9 @@ struct TopButtonInt BOOL bPushed;
int dwFlags;
int x, y;
- HBITMAP hbBitmapUp, hbBitmapDown;
- HBITMAP hbDefBitmapUp, hbDefBitmapDown;
HBITMAP hbWBordBitmapUp, hbWBordBitmapDown;
HICON hIconUp, hIconDn;
+ HANDLE hIconHandleUp, hIconHandleDn;
char *pszServiceUp, *pszServiceDown;
char *name;
@@ -72,8 +71,6 @@ struct TopButtonInt LPARAM lParamDown;
WPARAM wParamDown;
WORD arrangedpos;
- TCHAR *UserDefinedbmUp;
- TCHAR *UserDefinedbmDown;
};
struct SortData
@@ -88,14 +85,7 @@ struct SortData //#define BUTTHEIGHT 16
#define SEPWIDTH 3
-struct ButtonOptData
-{
- char *name;
- int pos;
- bool show;
-};
-
-extern bool OptionsOpened, UseIcoLib, StopArrange;
+extern bool OptionsOpened, StopArrange;
extern HWND OptionshWnd;
extern HANDLE hHookTTBModuleLoaded;
extern HINSTANCE hInst;
@@ -155,7 +145,6 @@ int UnInitLBut(); void lockbut();
void ulockbut();
-int applyuserbitmaps( int );
INT_PTR TTBAddButton(WPARAM, LPARAM);
INT_PTR TTBRemoveButton(WPARAM, LPARAM);
diff --git a/plugins/TopToolBar/launchbt.cpp b/plugins/TopToolBar/launchbt.cpp index 3b5678386f..fd0e15d600 100644 --- a/plugins/TopToolBar/launchbt.cpp +++ b/plugins/TopToolBar/launchbt.cpp @@ -82,8 +82,8 @@ INT_PTR InsertLBut(int id) TTBButton ttb = { 0 };
ttb.cbSize = sizeof(ttb);
- ttb.hbBitmapDown = DefLDn;
- ttb.hbBitmapUp = DefLUp;
+ //ttb.hbBitmapDown = DefLDn; !!!!!!!!!!!!!!
+ //ttb.hbBitmapUp = DefLUp; !!!!!!!!!!!!!!
ttb.dwFlags = TTBBF_VISIBLE|TTBBF_ISLBUTTON;
ttb.pszServiceDown = TTB_LAUNCHSERVICE;
ttb.lParamDown = id;
@@ -120,7 +120,7 @@ int LoadAllLButs() memset(LBUTS, 0, sizeof(LBUTS));
for (int i = 0; i < MAXLBUTS; i++) {
memset(buf1, 0, SIZEOF(buf1));
- itoa(i, buf1, 10);
+ _itoa(i, buf1, 10);
AS(fixname, "LBUT", buf1);
id = DBGetContactSettingWord(0, TTB_OPTDIR, AS(buf, fixname, ""), -1);
if (id != -1) {
@@ -145,7 +145,7 @@ int SaveAllLButs() memset(buf, 0, SIZEOF(buf));
for (int i = 0;i<MAXLBUTS;i++) {
- itoa(i, buf1, 10);
+ _itoa(i, buf1, 10);
if (LBUTS[i].hframe != 0) {
AS(fixname, "LBUT", buf1);
DBWriteContactSettingWord(0, TTB_OPTDIR, AS(buf, fixname, ""), i);
diff --git a/plugins/TopToolBar/main.cpp b/plugins/TopToolBar/main.cpp index 04cede70ae..54b7542c24 100644 --- a/plugins/TopToolBar/main.cpp +++ b/plugins/TopToolBar/main.cpp @@ -83,4 +83,4 @@ extern "C" int __declspec(dllexport) Unload(void) DestroyHookableEvent(hHookTTBModuleLoaded);
return 0;
-}
\ No newline at end of file +}
diff --git a/plugins/TopToolBar/main.rc b/plugins/TopToolBar/main.rc index 72857524c4..332f6cac40 100644 --- a/plugins/TopToolBar/main.rc +++ b/plugins/TopToolBar/main.rc @@ -16,10 +16,8 @@ // Neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1251)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -30,36 +28,27 @@ IDD_OPT_BUTORDER DIALOGEX 0, 0, 300, 231 STYLE DS_SETFONT | WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
- GROUPBOX "Buttons Order && Visibility", IDC_STATIC, 10, 0, 150, 180
- CONTROL "Tree1", IDC_BUTTONORDERTREE, "SysTreeView32", TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP, 20, 25, 132, 100
- LTEXT "Buttons order:", IDC_STATIC, 20, 15, 132, 8
- CONTROL 268, IDC_BMPUP, "Static", SS_BITMAP | SS_NOTIFY, 60, 130, 13, 10
- CONTROL 268, IDC_BMPDN, "Static", SS_BITMAP | SS_NOTIFY, 115, 130, 13, 10, WS_EX_TRANSPARENT
- LTEXT "Up:", IDC_STATIC1, 35, 130, 12, 8
- LTEXT "Down:", IDC_STATIC2, 85, 130, 22, 8
- PUSHBUTTON "Default", IDC_DEFAULT, 55, 146, 50, 14
- LTEXT "Click on images to select new bitmaps.", IDC_STATIC3, 15, 165, 140, 8
- PUSHBUTTON "Add Separator", IDC_ADDSEP, 175, 15, 55, 14
- PUSHBUTTON "Del Separator", IDC_REMOVESEP, 235, 15, 55, 14
- PUSHBUTTON "Add Launch", IDC_ADDLBUTTON, 180, 60, 100, 14
- PUSHBUTTON "Del Launch", IDC_DELLBUTTON, 180, 81, 100, 14
- EDITTEXT IDC_ENAME, 195, 100, 85, 14, ES_AUTOHSCROLL
- LTEXT "Name: ", IDC_LBUTTONNAME, 170, 100, 24, 8
- EDITTEXT IDC_EPATH, 195, 121, 85, 14, ES_AUTOHSCROLL
- LTEXT "Path:", IDC_LBUTTONPATH, 170, 121, 18, 8
- PUSHBUTTON "Set", IDC_LBUTTONSET, 205, 140, 50, 14
- EDITTEXT IDC_IMGDIR, 65, 190, 205, 14, ES_AUTOHSCROLL | ES_READONLY
- GROUPBOX "Separator Button", IDC_STATIC, 165, 0, 130, 40
- GROUPBOX "Launch Button", IDC_STATIC, 165, 45, 130, 115
- PUSHBUTTON "...", IDC_OPENIMGDIR, 275, 190, 14, 14
- CONTROL "Image Directory:", IDC_STATIC, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 5, 190, 55, 10
- LTEXT "Button Height:", IDC_STATIC, 11, 210, 46, 8
- EDITTEXT IDC_BUTTHEIGHT, 65, 207, 24, 14, ES_AUTOHSCROLL
- LTEXT "Button Width: ", IDC_STATIC, 99, 210, 46, 8
- EDITTEXT IDC_BUTTWIDTH, 147, 208, 24, 14, ES_AUTOHSCROLL
- CONTROL "Use Miranda Button Class", IDC_USEMIRANDABUTTON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 185, 210, 97, 10
- CONTROL "Use Flat Mode", IDC_USEFLAT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 201, 220, 62, 10
- CONTROL "Use IcoLib (need restart!)", IDC_USEICOLIB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 170, 165, 95, 10
+ GROUPBOX "Buttons Order && Visibility",IDC_STATIC,10,0,150,180
+ CONTROL "Tree1",IDC_BUTTONORDERTREE,"SysTreeView32",TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,18,25,134,148
+ LTEXT "Buttons order:",IDC_STATIC,18,15,132,8
+ PUSHBUTTON "Add Separator",IDC_ADDSEP,175,15,55,14
+ PUSHBUTTON "Del Separator",IDC_REMOVESEP,235,15,55,14
+ PUSHBUTTON "Add Launch",IDC_ADDLBUTTON,180,60,100,14
+ PUSHBUTTON "Del Launch",IDC_DELLBUTTON,180,81,100,14
+ EDITTEXT IDC_ENAME,195,111,85,14,ES_AUTOHSCROLL
+ LTEXT "Name: ",IDC_LBUTTONNAME,170,114,24,8
+ EDITTEXT IDC_EPATH,195,134,85,14,ES_AUTOHSCROLL
+ LTEXT "Path:",IDC_LBUTTONPATH,170,136,18,8
+ PUSHBUTTON "Set",IDC_LBUTTONSET,205,158,50,14
+ GROUPBOX "Separator Button",IDC_STATIC,165,0,130,40
+ GROUPBOX "Launch Button",IDC_STATIC,165,45,130,136
+ LTEXT "Button Height:",IDC_STATIC,11,190,46,8
+ EDITTEXT IDC_BUTTHEIGHT,65,187,24,14,ES_AUTOHSCROLL
+ LTEXT "Button Width: ",IDC_STATIC,11,211,46,8
+ EDITTEXT IDC_BUTTWIDTH,65,209,24,14,ES_AUTOHSCROLL
+ CONTROL "Use Miranda Button Class",IDC_USEMIRANDABUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,196,97,10
+ CONTROL "Use Flat Mode",IDC_USEFLAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,208,62,10
+ CONTROL "Use IcoLib (need restart!)",IDC_USEICOLIB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,184,95,10
END
@@ -92,25 +81,23 @@ END /////////////////////////////////////////////////////////////////////////////
-// Russian resources
+// Russian (Russia) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
-IDD_FRAMEPLUG2 DIALOG 0, 0, 211, 11
+IDD_FRAMEPLUG2 DIALOG 0, 0, 211, 11
STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
BEGIN
- CONTROL 262, IDC_P2ONLINEBUTT, "Static", SS_BITMAP | SS_NOTIFY | NOT WS_VISIBLE, 55, 0, 13, 10
- CONTROL 269, IDC_P2GROUPBUTT, "Static", SS_BITMAP | SS_NOTIFY | NOT WS_VISIBLE, 70, 0, 13, 10
+ CONTROL 262,IDC_P2ONLINEBUTT,"Static",SS_BITMAP | SS_NOTIFY | NOT WS_VISIBLE,55,0,13,10
+ CONTROL 269,IDC_P2GROUPBUTT,"Static",SS_BITMAP | SS_NOTIFY | NOT WS_VISIBLE,70,0,13,10
END
@@ -136,8 +123,6 @@ END // Bitmap
//
-IDB_TESTBITMAP BITMAP "bmp\\test.bmp"
-IDB_OPTIONS BITMAP "bmp\\options.bmp"
IDB_SEP BITMAP "bmp\\sep.bmp"
#ifdef APSTUDIO_INVOKED
@@ -146,18 +131,18 @@ IDB_SEP BITMAP "bmp\\sep.bmp" // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -194,8 +179,8 @@ IDI_MIRANDADN ICON "icos\\Show Main Menu_DN.ico" //
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0, 7, 3, 1
- PRODUCTVERSION 0, 7, 3, 1
+ FILEVERSION 0,7,3,1
+ PRODUCTVERSION 0,7,3,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -225,18 +210,16 @@ BEGIN END
END
-#endif // Russian resources
+#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// English (U.K.) resources
+// English (United Kingdom) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -247,7 +230,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK // remains consistent on all systems.
IDI_NOTICK ICON "icos\\notick.ico"
IDI_TICK ICON "icos\\notick1.ico"
-#endif // English (U.K.) resources
+#endif // English (United Kingdom) resources
/////////////////////////////////////////////////////////////////////////////
@@ -255,10 +238,8 @@ IDI_TICK ICON "icos\\notick1.ico" // English (Canada) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENC)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -270,20 +251,20 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "TopToolBar Background", IDC_STATIC, 4, 4, 227, 124
- LTEXT "Background colour:", IDC_STATIC, 12, 20, 72, 8, NOT WS_GROUP
- CONTROL "", IDC_BKGCOLOUR, "ColourPicker", WS_TABSTOP, 84, 19, 32, 10
- LTEXT "Selection colour:", IDC_STATIC, 12, 36, 72, 8, NOT WS_VISIBLE
- CONTROL "", IDC_SELCOLOUR, "ColourPicker", NOT WS_VISIBLE | WS_TABSTOP, 84, 35, 32, 10
- CONTROL "Use background bitmap", IDC_BITMAP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 12, 53, 161, 10
- EDITTEXT IDC_FILENAME, 22, 67, 184, 12, ES_AUTOHSCROLL
- PUSHBUTTON "...", IDC_BROWSE, 208, 67, 15, 11
- CONTROL "Stretch to width", IDC_STRETCHH, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 22, 84, 100, 10
- CONTROL "Stretch to height", IDC_STRETCHV, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 122, 84, 101, 10
- CONTROL "Tile horizontally", IDC_TILEH, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 22, 97, 100, 10
- CONTROL "Tile vertically", IDC_TILEV, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 122, 97, 101, 10
- CONTROL "Scroll with text", IDC_SCROLL, "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 22, 110, 100, 10
- CONTROL "Stretch proportionally", IDC_PROPORTIONAL, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 122, 110, 101, 10
+ GROUPBOX "TopToolBar Background",IDC_STATIC,4,4,227,124
+ LTEXT "Background colour:",IDC_STATIC,12,20,72,8,NOT WS_GROUP
+ CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,84,19,32,10
+ LTEXT "Selection colour:",IDC_STATIC,12,36,72,8,NOT WS_VISIBLE
+ CONTROL "",IDC_SELCOLOUR,"ColourPicker",NOT WS_VISIBLE | WS_TABSTOP,84,35,32,10
+ CONTROL "Use background bitmap",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,53,161,10
+ EDITTEXT IDC_FILENAME,22,67,184,12,ES_AUTOHSCROLL
+ PUSHBUTTON "...",IDC_BROWSE,208,67,15,11
+ CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,84,100,10
+ CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,84,101,10
+ CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,97,100,10
+ CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,97,101,10
+ CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,22,110,100,10
+ CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,110,101,10
END
@@ -328,3 +309,4 @@ END /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/TopToolBar/resource.h b/plugins/TopToolBar/resource.h index d83b333797..13e4d07678 100644 --- a/plugins/TopToolBar/resource.h +++ b/plugins/TopToolBar/resource.h @@ -44,10 +44,7 @@ #define IDD_FRAMEPLUG2 265
#define IDB_GROUPUP 268
#define IDB_GROUPDN 269
-#define IDC_BMPUP 1000
-#define IDC_BMPDN 1001
#define IDC_BUTTON1 1002
-#define IDC_DEFAULT 1002
#define IDC_ADDSEP 1003
#define IDC_REMOVESEP 1004
#define IDC_ADDLBUTTON 1005
@@ -57,17 +54,12 @@ #define IDC_EPATH 1009
#define IDC_LBUTTONPATH 1011
#define IDC_LBUTTONSET 1012
-#define IDC_IMGDIR 1013
-#define IDC_OPENIMGDIR 1014
#define IDC_BUTTHEIGHT 1015
#define IDC_EDIT2 1016
#define IDC_BUTTWIDTH 1016
#define IDC_USEMIRANDABUTTON 1017
#define IDC_USEFLAT 1018
#define IDC_USEICOLIB 1019
-#define IDC_STATIC1 1020
-#define IDC_STATIC2 1021
-#define IDC_STATIC3 1022
#define IDC_BROWSE 1184
#define IDC_BKGCOLOUR 1269
#define IDC_FILENAME 1271
diff --git a/plugins/TopToolBar/separators.cpp b/plugins/TopToolBar/separators.cpp index cc765b573e..f6ef43e8ab 100644 --- a/plugins/TopToolBar/separators.cpp +++ b/plugins/TopToolBar/separators.cpp @@ -10,15 +10,11 @@ static int SeparatorCnt = 0; int InsertSeparator(int id)
{
- HBITMAP Separator = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_SEP));
-
char buf[255];
wsprintfA(buf, "%s %d", Translate("Separator"), id);
TTBButton ttb = { 0 };
ttb.cbSize = sizeof(ttb);
- ttb.hbBitmapDown = Separator;
- ttb.hbBitmapUp = Separator;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSEPARATOR;
ttb.pszServiceDown = "";
ttb.pszServiceUp = "";
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 9ed23687e3..7c0dae64d5 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -17,7 +17,7 @@ int lastypos = 1; // == == == == == == == options
COLORREF bkColour;
-HBITMAP hBmpBackground;
+HBITMAP hBmpBackground, hBmpSeparator;
int backgroundBmpUse;
static CRITICAL_SECTION csButtonsHook;
@@ -28,31 +28,10 @@ SortData arrangedbuts[MAX_BUTTONS]; int SetButtBitmap(int pos);
-int applyuserbitmaps(int pos)
-{
- int t = IMAGE_BITMAP;
- Buttons[pos].hbBitmapDown = Buttons[pos].hbDefBitmapDown;
- Buttons[pos].hbBitmapUp = Buttons[pos].hbDefBitmapUp;
- if (Buttons[pos].UserDefinedbmDown != NULL) {
- if ( _tcsstr(Buttons[pos].UserDefinedbmDown, _T(".ico")))
- t = IMAGE_ICON;
- Buttons[pos].hbBitmapDown = ( HBITMAP )LoadImage(0, Buttons[pos].UserDefinedbmDown, t, 0, 0, LR_LOADFROMFILE);
- }
-
- if (Buttons[pos].UserDefinedbmUp != NULL) {
- if ( _tcsstr(Buttons[pos].UserDefinedbmUp, _T(".ico")))
- t = IMAGE_ICON;
- Buttons[pos].hbBitmapUp = ( HBITMAP )LoadImage(0, Buttons[pos].UserDefinedbmUp, t, 0, 0, LR_LOADFROMFILE);
- }
-
- return 0;
-}
-
int SetAllBitmaps()
{
lockbut();
for (int i = 0; i < nButtonsCount; i++) {
- applyuserbitmaps(i);
SetButtBitmap(i);
}
ulockbut();
@@ -90,13 +69,6 @@ int DBSaveButtonSettings(int butpos) DBWriteContactSettingString(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpDown"), "");
DBWriteContactSettingString(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpUp"), "");
-
- if (Buttons[butpos].UserDefinedbmDown != NULL)
- DBWriteContactSettingTString(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpDown"), Buttons[butpos].UserDefinedbmDown);
-
- if (Buttons[butpos].UserDefinedbmUp != NULL)
- DBWriteContactSettingTString(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpUp"), Buttons[butpos].UserDefinedbmUp);
-
return 0;
}
@@ -121,18 +93,6 @@ int DBLoadButtonSettings(int butpos) Buttons[butpos].dwFlags = Buttons[butpos].dwFlags & (~TTBBF_VISIBLE);
if ( DBGetContactSettingDword(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_Visible"), oldv) > 0 )
Buttons[butpos].dwFlags |= TTBBF_VISIBLE;
-
- Buttons[butpos].UserDefinedbmDown = DBGetStringT(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpDown"));
- if ( Buttons[butpos].UserDefinedbmDown != NULL && Buttons[butpos].UserDefinedbmDown[0] == 0) {
- mir_free(Buttons[butpos].UserDefinedbmDown);
- Buttons[butpos].UserDefinedbmDown = NULL;
- }
-
- Buttons[butpos].UserDefinedbmUp = DBGetStringT(0, TTB_OPTDIR, AS(buf, Buttons[butpos].name, "_BmpUp"));
- if ( Buttons[butpos].UserDefinedbmUp != NULL && Buttons[butpos].UserDefinedbmUp[0] == 0) {
- mir_free(Buttons[butpos].UserDefinedbmUp);
- Buttons[butpos].UserDefinedbmUp = NULL;
- }
return 0;
}
@@ -192,23 +152,23 @@ INT_PTR TTBRemoveButton(WPARAM wParam, LPARAM lParam) return 0;
}
-static HBITMAP DrawBorderForBitmap(HBITMAP hb, BOOL up)
+static HBITMAP DrawBorderForBitmap(HICON hIcon, BOOL up)
{
- HBITMAP Border, workbmp;
- HDC workdc, destdc, srcdc;
+ ICONINFO ii;
+ GetIconInfo(hIcon, &ii);
- Border = LoadBitmap(hInst, MAKEINTRESOURCE(up?IDB_BORDERUP:IDB_BORDERDN));
- workdc = GetDC(hwndContactList);
- destdc = CreateCompatibleDC(workdc);
- srcdc = CreateCompatibleDC(workdc);
+ HBITMAP Border = LoadBitmap(hInst, MAKEINTRESOURCE(up?IDB_BORDERUP:IDB_BORDERDN));
+ HDC workdc = GetDC(hwndContactList);
+ HDC destdc = CreateCompatibleDC(workdc);
+ HDC srcdc = CreateCompatibleDC(workdc);
- workbmp = CreateBitmap(BUTTWIDTH, BUTTHEIGHT, 1, GetDeviceCaps(workdc, BITSPIXEL), NULL);
+ HBITMAP workbmp = CreateBitmap(BUTTWIDTH, BUTTHEIGHT, 1, GetDeviceCaps(workdc, BITSPIXEL), NULL);
SelectObject(destdc, workbmp);
SelectObject(srcdc, Border);
BitBlt(destdc, 0, 0, BUTTWIDTH, BUTTHEIGHT, srcdc, 0, 0, SRCCOPY);
- SelectObject(srcdc, hb);
+ SelectObject(srcdc, ii.hbmColor);
BitBlt(destdc, 1, 1, BUTTWIDTH-4, BUTTHEIGHT-4, srcdc, 0, 0, SRCCOPY);
DeleteDC(destdc);
@@ -237,7 +197,7 @@ bool nameexists(const char *name) return FALSE;
}
-HICON LoadIconFromLibrary(char *SectName, char *Name, char *Description, HICON hIcon, bool RegisterIt, bool *RegistredOk)
+HICON LoadIconFromLibrary(char *Name, char *Description, HICON hIcon, HANDLE* phIcolib, bool *RegistredOk)
{
if (RegistredOk)
*RegistredOk = FALSE;
@@ -245,22 +205,20 @@ HICON LoadIconFromLibrary(char *SectName, char *Name, char *Description, HICON h if (Name != NULL && *Name != 0) {
char iconame[256];
_snprintf(iconame, SIZEOF(iconame), "toptoolbar_%s", Name);
- if ( ServiceExists(MS_SKIN2_ADDICON)) {
- if (RegisterIt) {
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.pszSection = Translate(SectName);
- sid.pszName = iconame;
- sid.pszDefaultFile = NULL;
- sid.pszDescription = Description;
- sid.hDefaultIcon = hIcon;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- if (RegistredOk)
- *RegistredOk = TRUE;
- }
- return ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconame));
+ if (phIcolib) {
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.pszSection = "Toolbar";
+ sid.pszName = iconame;
+ sid.pszDefaultFile = NULL;
+ sid.pszDescription = Description;
+ sid.hDefaultIcon = hIcon;
+ *phIcolib = Skin_AddIcon(&sid);
+
+ if (RegistredOk)
+ *RegistredOk = TRUE;
}
+ return Skin_GetIcon(iconame);
}
return hIcon;
@@ -296,82 +254,78 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) return -1;
int i = nButtonsCount;
- TTBButtonV2 but = { 0 };
- if (((TTBButton*)wParam)->cbSize == sizeof(TTBButton))
- memcpy(&but, (void*)wParam, sizeof(TTBButton));
-
- if (((TTBButton*)wParam)->cbSize == sizeof(TTBButtonV2))
- memcpy(&but, (void*)wParam, sizeof(TTBButtonV2));
-
- if ( but.name == NULL || nameexists(but.name)) {
+ TTBButton *but = (TTBButton*)wParam;
+ if (but->cbSize != sizeof(TTBButton) || but->name == NULL || nameexists(but->name)) {
ulockbut();
return -1;
}
- Buttons[i].id = nextButtonId++;
- Buttons[i].hbBitmapDown = but.hbBitmapDown;
- Buttons[i].hbBitmapUp = but.hbBitmapUp;
- Buttons[i].hbDefBitmapDown = but.hbBitmapDown;
- Buttons[i].hbDefBitmapUp = but.hbBitmapUp;
+ TopButtonInt& b = Buttons[i];
+ b.id = nextButtonId++;
- if (but.pszServiceDown != NULL) Buttons[i].pszServiceDown = strdup(but.pszServiceDown);
- if (but.pszServiceUp != NULL) Buttons[i].pszServiceUp = strdup(but.pszServiceUp);
- Buttons[i].name = strdup(but.name);
- Buttons[i].dwFlags = but.dwFlags;
-
- if (Buttons[i].dwFlags & TTBBF_DRAWBORDER) {
- Buttons[i].hbWBordBitmapDown = DrawBorderForBitmap(Buttons[i].hbBitmapDown, FALSE);
- Buttons[i].hbWBordBitmapUp = DrawBorderForBitmap(Buttons[i].hbBitmapUp, TRUE);
+ if (but->pszServiceDown != NULL) b.pszServiceDown = _strdup(but->pszServiceDown);
+ if (but->pszServiceUp != NULL) b.pszServiceUp = _strdup(but->pszServiceUp);
+ b.name = _strdup(but->name);
+ b.dwFlags = but->dwFlags;
+
+ if (b.dwFlags & TTBBF_ICONBYHANDLE) {
+ b.hIconHandleDn = but->hIconHandleDn;
+ b.hIconHandleUp = but->hIconHandleUp;
+ b.hIconDn = Skin_GetIconByHandle(b.hIconHandleDn);
+ b.hIconUp = Skin_GetIconByHandle(b.hIconHandleUp);
+ }
+ else {
+ b.hIconDn = but->hIconDn;
+ b.hIconUp = but->hIconUp;
}
- Buttons[i].wParamUp = but.wParamUp;
- Buttons[i].lParamUp = but.lParamUp;
- Buttons[i].wParamDown = but.wParamDown;
- Buttons[i].lParamDown = but.lParamDown;
-
- Buttons[i].dwFlags = but.dwFlags;
+ if (b.dwFlags & TTBBF_DRAWBORDER) {
+ b.hbWBordBitmapDown = DrawBorderForBitmap(b.hIconDn, FALSE);
+ b.hbWBordBitmapUp = DrawBorderForBitmap(b.hIconUp, TRUE);
+ }
- Buttons[i].bPushed = (but.dwFlags&TTBBF_PUSHED)?TRUE:FALSE;
+ b.wParamUp = but->wParamUp;
+ b.lParamUp = but->lParamUp;
+ b.wParamDown = but->wParamDown;
+ b.lParamDown = but->lParamDown;
+
+ b.bPushed = (but->dwFlags & TTBBF_PUSHED) ? TRUE : FALSE;
CreateOneWindow(i);
-
- Buttons[i].hIconUp = but.hIconUp ;
- Buttons[i].hIconDn = but.hIconDn ;
- if (UseIcoLib && (!(Buttons[i].dwFlags & TTBBF_ISSEPARATOR))) {
+ if ( !(b.dwFlags & TTBBF_ISSEPARATOR)) {
char buf[256];
- sprintf(buf, "%s_up", Buttons[i].name);
- Buttons[i].hIconUp = LoadIconFromLibrary("TopToolBar", buf, buf, but.hIconDn, TRUE, NULL);
- sprintf(buf, "%s_dn", Buttons[i].name);
- Buttons[i].hIconDn = LoadIconFromLibrary("TopToolBar", buf, buf, but.hIconUp, TRUE, NULL);
+ sprintf(buf, "%s_up", b.name);
+ b.hIconUp = LoadIconFromLibrary(buf, buf, b.hIconDn, &b.hIconHandleDn, NULL);
+ sprintf(buf, "%s_dn", b.name);
+ b.hIconDn = LoadIconFromLibrary(buf, buf, b.hIconUp, &b.hIconHandleUp, NULL);
}
- Buttons[i].hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
+ b.hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hwndTopToolBar, NULL, hInst,
NULL);
- SetWindowPos(Buttons[i].hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(b.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.lpszText = _T("");
ti.hinst = hInst;
ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS ;
- ti.uId = (UINT_PTR)Buttons[i].hwnd;
- SendMessage(Buttons[i].hwndTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
+ ti.uId = (UINT_PTR)b.hwnd;
+ SendMessage(b.hwndTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
- SendMessage(Buttons[i].hwndTip, TTM_ACTIVATE, (WPARAM)(Buttons[i].dwFlags&TTBBF_SHOWTOOLTIP)?TRUE:FALSE, 0);
+ SendMessage(b.hwndTip, TTM_ACTIVATE, (WPARAM)(b.dwFlags&TTBBF_SHOWTOOLTIP)?TRUE:FALSE, 0);
- SetWindowLongPtr(Buttons[i].hwnd, GWLP_USERDATA, Buttons[i].id);
+ SetWindowLongPtr(b.hwnd, GWLP_USERDATA, b.id);
nButtonsCount++;
- int retval = Buttons[i].id;
+ int retval = b.id;
DBLoadButtonSettings(i);
- applyuserbitmaps(i);
SetButtBitmap(i);
ulockbut();
@@ -538,39 +492,21 @@ int ArrangeButtons() int SetButtBitmap(int pos)
{
- int t = IMAGE_BITMAP;
- TCHAR *curname = (Buttons[pos].bPushed)?(Buttons[pos].UserDefinedbmDown):(Buttons[pos].UserDefinedbmUp);
-
int curstyle = GetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE);
curstyle &= (~SS_BITMAP);
curstyle &= (~SS_ICON);
- if (!UseIcoLib || (Buttons[pos].dwFlags&TTBBF_ISSEPARATOR)) {
- if (curname != NULL) {
- if ( _tcsstr(curname, _T(".ico")))
- t = IMAGE_ICON;
-
- curstyle |= (t == IMAGE_ICON || UseIcoLib) ? SS_ICON : SS_BITMAP;
- SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle);
- }
- else SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle|(Buttons[pos].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
- }
- else if (GetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE)&SS_ICON)
- SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle|SS_ICON);
+ if (Buttons[pos].dwFlags & TTBBF_ISSEPARATOR)
+ SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle | SS_BITMAP);
+ else if (GetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE) & SS_ICON)
+ SetWindowLongPtr(Buttons[pos].hwnd, GWL_STYLE, curstyle | SS_ICON);
- if ( !UseIcoLib || (Buttons[pos].dwFlags & TTBBF_ISSEPARATOR)) {
+ if (Buttons[pos].dwFlags & TTBBF_ISSEPARATOR) {
if (!(Buttons[pos].dwFlags & TTBBF_DRAWBORDER)) {
- if (Buttons[pos].hbBitmapDown == NULL) {
- t = IMAGE_ICON;
- SendMessage(Buttons[pos].hwnd, STM_SETIMAGE, t, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hIconDn):(Buttons[pos].hIconUp)));
- SendMessage(Buttons[pos].hwnd, BM_SETIMAGE, t, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hIconDn):(Buttons[pos].hIconUp)));
- }
- else {
- SendMessage(Buttons[pos].hwnd, STM_SETIMAGE, t, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hbBitmapDown):(Buttons[pos].hbBitmapUp)));
- SendMessage(Buttons[pos].hwnd, BM_SETIMAGE, t, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hbBitmapDown):(Buttons[pos].hbBitmapUp)));
- }
+ SendMessage(Buttons[pos].hwnd, STM_SETIMAGE, IMAGE_ICON, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hIconDn):(Buttons[pos].hIconUp)));
+ SendMessage(Buttons[pos].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hIconDn):(Buttons[pos].hIconUp)));
}
- else SendMessage(Buttons[pos].hwnd, STM_SETIMAGE, t, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hbWBordBitmapDown):(Buttons[pos].hbWBordBitmapUp)));
+ else SendMessage(Buttons[pos].hwnd, STM_SETIMAGE, IMAGE_ICON, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hbWBordBitmapDown):(Buttons[pos].hbWBordBitmapUp)));
}
else SendMessage(Buttons[pos].hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)((Buttons[pos].bPushed)?(Buttons[pos].hIconDn):(Buttons[pos].hIconUp)));
@@ -648,8 +584,6 @@ INT_PTR TTBGetOptions(WPARAM wParam, LPARAM lParam) if (Buttons[pos].bPushed)
lpTTB->dwFlags |= TTBBF_PUSHED;
- lpTTB->hbBitmapDown = Buttons[pos].hbBitmapDown;
- lpTTB->hbBitmapUp = Buttons[pos].hbBitmapUp;
lpTTB->lParamUp = Buttons[pos].lParamUp;
lpTTB->wParamUp = Buttons[pos].wParamUp;
lpTTB->lParamDown = Buttons[pos].lParamDown;
@@ -688,8 +622,8 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) Buttons[pos].dwFlags = lParam;
Buttons[pos].bPushed = (Buttons[pos].dwFlags & TTBBF_PUSHED) ? TRUE : FALSE;
if (Buttons[pos].dwFlags & TTBBF_DRAWBORDER) {
- Buttons[pos].hbWBordBitmapDown = DrawBorderForBitmap(Buttons[pos].hbBitmapDown, FALSE);
- Buttons[pos].hbWBordBitmapUp = DrawBorderForBitmap(Buttons[pos].hbBitmapUp, TRUE);
+ Buttons[pos].hbWBordBitmapDown = DrawBorderForBitmap(Buttons[pos].hIconDn, FALSE);
+ Buttons[pos].hbWBordBitmapUp = DrawBorderForBitmap(Buttons[pos].hIconUp, TRUE);
}
SetButtBitmap(pos);
@@ -726,8 +660,6 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) break;
Buttons[pos].dwFlags = lpTTB->dwFlags;
- Buttons[pos].hbBitmapDown = lpTTB->hbBitmapDown;
- Buttons[pos].hbBitmapUp = lpTTB->hbBitmapUp;
Buttons[pos].lParamUp = lpTTB->lParamUp;
Buttons[pos].wParamUp = lpTTB->wParamUp;
Buttons[pos].lParamDown = lpTTB->lParamDown;
@@ -742,8 +674,8 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) Buttons[pos].pszServiceUp = _strdup(lpTTB->pszServiceUp);
if (Buttons[pos].dwFlags & TTBBF_DRAWBORDER) {
- Buttons[pos].hbWBordBitmapDown = DrawBorderForBitmap(Buttons[pos].hbBitmapDown, FALSE);
- Buttons[pos].hbWBordBitmapUp = DrawBorderForBitmap(Buttons[pos].hbBitmapUp, TRUE);
+ Buttons[pos].hbWBordBitmapDown = DrawBorderForBitmap(Buttons[pos].hIconDn, FALSE);
+ Buttons[pos].hbWBordBitmapUp = DrawBorderForBitmap(Buttons[pos].hIconUp, TRUE);
}
Buttons[pos].bPushed = (Buttons[pos].dwFlags&TTBBF_PUSHED)?TRUE:FALSE;
@@ -987,9 +919,9 @@ int OnIconChange(WPARAM wParam, LPARAM lParam) for (int i = 0; i < nButtonsCount; i++) {
char buf[256];
sprintf(buf, "%s_up", Buttons[i].name);
- Buttons[i].hIconUp = LoadIconFromLibrary("TopToolBar", buf, buf, Buttons[i].hIconUp, FALSE, NULL);
+ Buttons[i].hIconUp = LoadIconFromLibrary(buf, buf, Buttons[i].hIconUp, FALSE, NULL);
sprintf(buf, "%s_dn", Buttons[i].name);
- Buttons[i].hIconDn = LoadIconFromLibrary("TopToolBar", buf, buf, Buttons[i].hIconDn, FALSE, NULL);
+ Buttons[i].hIconDn = LoadIconFromLibrary(buf, buf, Buttons[i].hIconDn, FALSE, NULL);
}
ulockbut();
RecreateWindows();
@@ -1016,9 +948,6 @@ int OnModulesLoad(WPARAM wParam, LPARAM lParam) hwndContactList = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
OptionsOpened = false;
- UseIcoLib = DBGetContactSettingByte(0, TTB_OPTDIR, "UseIcoLib", UseIcoLibDefaultValue);
- if (UseIcoLib)
- arHooks.insert( HookEvent(ME_SKIN2_ICONSCHANGED, OnIconChange));
hFrameTopWindow = addTopToolBarWindow(hwndContactList);
LoadInternalButtons(( HWND )CallService(MS_CLUI_GETHWNDTREE, 0, 0));
@@ -1050,8 +979,10 @@ int LoadToolbarModule() {
InitializeCriticalSection(&csButtonsHook);
StopArrange = TRUE;
+ hBmpSeparator = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_SEP));
arHooks.insert( HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoad));
+ arHooks.insert( HookEvent(ME_SKIN2_ICONSCHANGED, OnIconChange));
arHooks.insert( HookEvent(ME_OPT_INITIALISE, TTBOptInit));
arServices.insert( CreateServiceFunction(MS_TTB_ADDBUTTON, TTBAddButton));
@@ -1078,6 +1009,7 @@ int UnloadToolbarModule() {
SaveAllSeparators();
+ DeleteObject(hBmpSeparator);
DeleteCriticalSection(&csButtonsHook);
return 0;
}
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp index e962321008..dadfe7e305 100644 --- a/plugins/TopToolBar/ttbopt.cpp +++ b/plugins/TopToolBar/ttbopt.cpp @@ -4,7 +4,6 @@ static INT_PTR CALLBACK DlgProcTTBBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
extern int ttbOptionsChanged();
-extern HINSTANCE hInst;
extern TopButtonInt Buttons[MAX_BUTTONS];
extern int nButtonsCount;
@@ -14,124 +13,21 @@ extern SortData arrangedbuts[MAX_BUTTONS]; bool OptionsOpened = false;
HWND OptionshWnd = 0;
+struct ButtonOptData
+{
+ char *name;
+ int pos;
+ bool show;
+};
+
struct OrderData
{
int dragging;
HTREEITEM hDragItem;
};
-TCHAR *SetEndSlash(TCHAR *str)
-{
- if (str == NULL || *str == 0)
- return NULL;
-
- TCHAR *outs = str;
- if (str[_tcslen(str)-1] != '\\') {
- outs = (TCHAR*)calloc( sizeof(TCHAR), _tcslen(str)+3);
- _tcscat(outs, str);
- outs[_tcslen(str)] = '\\';
- }
- return outs;
-}
-
-bool FileExists(TCHAR *fname)
-{
- WIN32_FIND_DATA wfd = { 0 };
- HANDLE h = FindFirstFile(fname, &wfd);
- if (h == INVALID_HANDLE_VALUE)
- return FALSE;
-
- FindClose(h);
- return TRUE;
-}
-
-TCHAR *ReplaceBadChar(TCHAR *str, TCHAR bad, TCHAR toreplace)
-{
- for (int i = 0; str[i] != 0; i++)
- if (str[i] == bad)
- str[i] = toreplace;
-
- return str;
-}
-
-TCHAR *ReplaceAll(TCHAR *str)
-{
- ReplaceBadChar(str, '\\', '_');
- ReplaceBadChar(str, '/', '_');
- ReplaceBadChar(str, '"', '_');
- ReplaceBadChar(str, '?', '_');
- ReplaceBadChar(str, '|', '_');
- ReplaceBadChar(str, '>', '_');
- ReplaceBadChar(str, '<', '_');
- ReplaceBadChar(str, ':', '_');
- ReplaceBadChar(str, '*', '_');
- return str;
-}
-
-void AssignBitmapsFromDir(TCHAR *dir)
-{
- if (dir == NULL || *dir == 0 )
- return;
-
- dir = SetEndSlash(dir);
- lockbut();
- for (int i = 0; i < nButtonsCount; i++) {
- TCHAR curnameUP[512], curnameDN[512], ChangedName[512];
- _tcscpy(ChangedName, _A2T(Buttons[i].name));
- ReplaceAll(ChangedName);
-
- wsprintf(curnameUP, _T("%s%s_UP.bmp"), dir, ChangedName);
- wsprintf(curnameDN, _T("%s%s_DN.bmp"), dir, ChangedName);
-
- if ( FileExists(curnameUP)) {
- if (Buttons[i].UserDefinedbmUp != NULL)
- mir_free(Buttons[i].UserDefinedbmUp);
- Buttons[i].UserDefinedbmUp = mir_tstrdup(curnameUP);
- }
-
- if ( FileExists(curnameDN)) {
- if (Buttons[i].UserDefinedbmDown != NULL)
- mir_free(Buttons[i].UserDefinedbmDown);
- Buttons[i].UserDefinedbmDown = mir_tstrdup(curnameDN);
- }
-
- wsprintf(curnameUP, _T("%s%s_UP.ico"), dir, ChangedName);
- wsprintf(curnameDN, _T("%s%s_DN.ico"), dir, ChangedName);
-
- if ( FileExists(curnameUP)) {
- if (Buttons[i].UserDefinedbmUp != NULL)
- mir_free(Buttons[i].UserDefinedbmUp);
- Buttons[i].UserDefinedbmUp = mir_tstrdup(curnameUP);
- }
-
- if ( FileExists(curnameDN)) {
- if (Buttons[i].UserDefinedbmDown != NULL)
- mir_free(Buttons[i].UserDefinedbmDown);
- Buttons[i].UserDefinedbmDown = mir_tstrdup(curnameDN);
- }
- }
-
- ulockbut();
- SetAllBitmaps();
- SaveAllButtonsOptions();
-}
-
-void ApplyNewDir(HWND hwnd)
-{
- TCHAR buf[512], *buf2;
- GetDlgItemText(hwnd, IDC_IMGDIR, buf, SIZEOF(buf));
- buf2 = DBGetStringT(0, TTB_OPTDIR, "ImgDir");
- if ( buf2 == NULL || lstrcmp(buf, buf2)) {
- DBWriteContactSettingTString(0, TTB_OPTDIR, "ImgDir", buf);
- AssignBitmapsFromDir(buf);
- }
-}
-
int BuildTree(HWND hwndDlg)
{
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPUP), STM_SETIMAGE, IMAGE_BITMAP, 0);
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPDN), STM_SETIMAGE, IMAGE_BITMAP, 0);
-
OrderData *dat = (struct OrderData*)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA);
TVINSERTSTRUCT tvis;
@@ -146,7 +42,7 @@ int BuildTree(HWND hwndDlg) for (int i = 0; i < nButtonsCount; i++) {
ButtonOptData *PD = (ButtonOptData*)malloc(sizeof(ButtonOptData));
PD->name = Buttons[arrangedbuts[i].oldpos].name;
- PD->show = Buttons[arrangedbuts[i].oldpos].dwFlags&TTBBF_VISIBLE?TRUE:FALSE;
+ PD->show = Buttons[arrangedbuts[i].oldpos].dwFlags & TTBBF_VISIBLE?TRUE:FALSE;
PD->pos = arrangedbuts[i].oldpos;
tvis.item.lParam = (LPARAM)PD;
tvis.item.pszText = TranslateTS( mir_a2t( PD->name));
@@ -200,43 +96,8 @@ int SaveTree(HWND hwndDlg) return (TRUE);
}
-void SetImagesForCurrent (HWND hwndDlg, int curselect)
-{
- int t = IMAGE_BITMAP;
-
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPUP), STM_SETIMAGE, t, 0);
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPDN), STM_SETIMAGE, t, 0);
-
- TCHAR *curname = Buttons[curselect].UserDefinedbmUp;
- if (curname != NULL) {
- if ( _tcsstr(curname, _T(".ico")))
- t = IMAGE_ICON;
- int st = WS_CHILDWINDOW | SS_NOTIFY | WS_VISIBLE;
- st |= (t == IMAGE_ICON) ? SS_ICON : SS_BITMAP;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, st);
- }
- else {
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPUP), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
- t = IMAGE_ICON;
- }
-
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPUP), STM_SETIMAGE, t, (Buttons[curselect].hbBitmapUp == NULL) ? (LPARAM)Buttons[curselect].hIconUp : (LPARAM)Buttons[curselect].hbBitmapUp);
-
- curname = Buttons[curselect].UserDefinedbmDown;
- if (curname != NULL) {
- if ( _tcsstr(curname, _T(".ico")))
- t = IMAGE_ICON;
- int st = WS_CHILDWINDOW | SS_NOTIFY | WS_VISIBLE;
- st |= (t == IMAGE_ICON) ? SS_ICON : SS_BITMAP;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, st);
- }
- else {
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BMPDN), GWL_STYLE, WS_CHILDWINDOW|WS_VISIBLE|SS_NOTIFY|(Buttons[curselect].hbBitmapDown == NULL?SS_ICON:SS_BITMAP));
- t = IMAGE_ICON;
- }
-
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPDN), STM_SETIMAGE, t, (Buttons[curselect].hbBitmapDown == NULL) ? (LPARAM)Buttons[curselect].hIconDn : (LPARAM)Buttons[curselect].hbBitmapDown);
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Options window: main
static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -244,54 +105,42 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR switch (msg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- dat = (struct OrderData*)malloc(sizeof(struct OrderData));
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA, (LONG)dat);
- dat->dragging = 0;
+ TranslateDialogDefault(hwndDlg);
+ dat = (struct OrderData*)malloc(sizeof(struct OrderData));
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWLP_USERDATA, (LONG)dat);
+ dat->dragging = 0;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE)|TVS_NOHSCROLL);
- {
- HIMAGELIST himlCheckBoxes;
- himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR4|ILC_MASK, 2, 2);
- ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_NOTICK)));
- ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), himlCheckBoxes, TVSIL_NORMAL);
- }
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), GWL_STYLE)|TVS_NOHSCROLL);
+ {
+ HIMAGELIST himlCheckBoxes;
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR4|ILC_MASK, 2, 2);
+ ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_NOTICK)));
+ ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInst, MAKEINTRESOURCE(IDI_TICK)));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), himlCheckBoxes, TVSIL_NORMAL);
+ }
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPUP), STM_SETIMAGE, IMAGE_BITMAP, 0);
- PostMessage(GetDlgItem(hwndDlg, IDC_BMPDN), STM_SETIMAGE, IMAGE_BITMAP, 0);
- SetDlgItemInt(hwndDlg, IDC_BUTTHEIGHT, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTHEIGHT", 16), FALSE);
- SetDlgItemInt(hwndDlg, IDC_BUTTWIDTH, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTWIDTH", 20), FALSE);
- CheckDlgButton(hwndDlg, IDC_USEMIRANDABUTTON, DBGetContactSettingByte(0, TTB_OPTDIR, "UseMirandaButtonClass", UseMirandaButtonClassDefaultValue));
- CheckDlgButton(hwndDlg, IDC_USEFLAT, DBGetContactSettingByte(0, TTB_OPTDIR, "UseFlatButton", 1));
+ SetDlgItemInt(hwndDlg, IDC_BUTTHEIGHT, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTHEIGHT", 16), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_BUTTWIDTH, DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTWIDTH", 20), FALSE);
+ CheckDlgButton(hwndDlg, IDC_USEMIRANDABUTTON, DBGetContactSettingByte(0, TTB_OPTDIR, "UseMirandaButtonClass", UseMirandaButtonClassDefaultValue));
+ CheckDlgButton(hwndDlg, IDC_USEFLAT, DBGetContactSettingByte(0, TTB_OPTDIR, "UseFlatButton", 1));
- if ( !ServiceExists(MS_SKIN2_ADDICON))
- EnableWindow(GetDlgItem(hwndDlg, IDC_USEICOLIB), FALSE);
+ if ( !ServiceExists(MS_SKIN2_ADDICON))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USEICOLIB), FALSE);
- CheckDlgButton(hwndDlg, IDC_USEICOLIB, ServiceExists(MS_SKIN2_ADDICON)&&DBGetContactSettingByte(0, TTB_OPTDIR, "UseIcoLib", UseIcoLibDefaultValue));
+ CheckDlgButton(hwndDlg, IDC_USEICOLIB, TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USEICOLIB), FALSE);
- BuildTree(hwndDlg);
- OptionsOpened = true;
- EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EPATH), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DELLBUTTON), FALSE);
+ BuildTree(hwndDlg);
+ OptionsOpened = true;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EPATH), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELLBUTTON), FALSE);
- SetDlgItemText(hwndDlg, IDC_IMGDIR, DBGetStringT(0, TTB_OPTDIR, "ImgDir"));
- SendMessage(hwndDlg, WM_COMMAND, 0, 0);
- OptionshWnd = hwndDlg;
- }
+ SendMessage(hwndDlg, WM_COMMAND, 0, 0);
+ OptionshWnd = hwndDlg;
return TRUE;
case WM_COMMAND:
- ShowWindow(GetDlgItem(hwndDlg, IDC_BMPUP), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_BMPDN), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_DEFAULT), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
-
- ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC1), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC2), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC3), IsDlgButtonChecked(hwndDlg, IDC_USEICOLIB)?SW_HIDE:SW_SHOW);
-
EnableWindow(GetDlgItem(hwndDlg, IDC_USEFLAT), IsDlgButtonChecked(hwndDlg, IDC_USEMIRANDABUTTON));
if (HIWORD(wParam) == EN_CHANGE ) {
@@ -303,28 +152,12 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int ctrlid = LOWORD(wParam);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- if (ctrlid == IDC_OPENIMGDIR) {
- TCHAR buf[512];
- BROWSEINFO bi = { 0 };
- bi.hwndOwner = hwndDlg;
- bi.pszDisplayName = buf;
- bi.lpszTitle = TranslateT("Select Directory");
- bi.ulFlags = BIF_RETURNONLYFSDIRS;
- PCIDLIST_ABSOLUTE res = SHBrowseForFolder(&bi);
- if (res != NULL) {
- if (SHGetPathFromIDList(res, buf) == TRUE) {
- SetDlgItemText(hwndDlg, IDC_IMGDIR, buf);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
- }
-
if (ctrlid == IDC_LBUTTONSET) {
int curselect;
TVITEM tvi;
tvi.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE));
- if (tvi.hItem == NULL){break;}
+ if (tvi.hItem == NULL)
+ break;
tvi.mask = TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
@@ -409,93 +242,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
break;
}
-
- if (ctrlid == IDC_DEFAULT) {
- TVITEM tvi;
- tvi.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE));
- if (tvi.hItem == NULL)
- break;
-
- tvi.mask = TVIF_PARAM;
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
-
- int curselect = ((ButtonOptData *)tvi.lParam)->pos;
- lockbut();
-
- if (Buttons[curselect].UserDefinedbmUp != NULL) mir_free(Buttons[curselect].UserDefinedbmUp);
- if (Buttons[curselect].UserDefinedbmDown != NULL) mir_free(Buttons[curselect].UserDefinedbmDown);
- Buttons[curselect].UserDefinedbmUp = NULL;
- Buttons[curselect].UserDefinedbmDown = NULL;
- applyuserbitmaps(curselect);
- SetImagesForCurrent(hwndDlg, curselect);
-
- ulockbut();
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
-
- if ((HIWORD(wParam) == STN_CLICKED || HIWORD(wParam) == STN_DBLCLK)) {
- int ctrlid = LOWORD(wParam);
- if (ctrlid == IDC_BMPUP || ctrlid == IDC_BMPDN) {
- TVITEM tvi;
- tvi.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE));
- if (tvi.hItem == NULL)
- break;
-
- tvi.mask = TVIF_PARAM;
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
- if (tvi.lParam == 0)
- break;
-
- int curselect = ((ButtonOptData *)tvi.lParam)->pos;
-
- TCHAR filename[MAX_PATH], filter[512];
- filename[0] = 0;
- _tcscpy(filter, TranslateT("Bitmap/Icon files"));
- _tcscat(filter, _T(" (*.bmp;*.ico)"));
-
- TCHAR *pfilter = filter+_tcslen(filter)+1;
- _tcscpy(pfilter, _T("*.bmp;*.ico"));
- pfilter += _tcslen(pfilter)+1;
-
- _tcscpy(pfilter, TranslateT("All Files"));
- _tcscat(pfilter, _T("(*)"));
- pfilter = pfilter + _tcslen(pfilter)+1;
-
- _tcscpy(pfilter, _T("*"));
- pfilter = pfilter + _tcslen(pfilter)+1;
- *pfilter = '\0';
-
- OPENFILENAME ofn = {0};
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
- ofn.hInstance = NULL;
- ofn.lpstrFilter = filter;
- ofn.lpstrFile = filename;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- ofn.nMaxFile = sizeof(filename);
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T("bmp");
- ofn.lpstrTitle = (ctrlid == IDC_BMPUP) ? TranslateT("Select Up Bitmap") : TranslateT("Select Down Bitmap");
- if (GetOpenFileName(&ofn)) {
- lockbut();
- if (ctrlid == IDC_BMPUP){
- if (Buttons[curselect].UserDefinedbmUp != NULL)
- mir_free(Buttons[curselect].UserDefinedbmUp);
- Buttons[curselect].UserDefinedbmUp = mir_tstrdup(ofn.lpstrFile);
- }
- if (ctrlid == IDC_BMPDN){
- if (Buttons[curselect].UserDefinedbmDown != NULL)
- mir_free(Buttons[curselect].UserDefinedbmDown);
- Buttons[curselect].UserDefinedbmDown = mir_tstrdup(ofn.lpstrFile);
- }
- applyuserbitmaps(curselect);
- SetImagesForCurrent(hwndDlg, curselect);
-
- ulockbut();
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
}
break;
@@ -513,7 +259,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SaveTree(hwndDlg);
- ApplyNewDir(hwndDlg);
RecreateWindows();
ArrangeButtons();
}
@@ -561,20 +306,10 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvi.hItem = hti;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE), &tvi);
-
lockbut();
- EnableWindow(GetDlgItem(hwndDlg, IDC_BMPUP), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BMPDN), FALSE);
-
- SetImagesForCurrent(hwndDlg, ((ButtonOptData *)tvi.lParam)->pos);
-
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVESEP), FALSE);
- if (Buttons[((ButtonOptData *)tvi.lParam)->pos].dwFlags&TTBBF_ISSEPARATOR)
+ if (Buttons[((ButtonOptData *)tvi.lParam)->pos].dwFlags & TTBBF_ISSEPARATOR)
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVESEP), TRUE);
- else {
- EnableWindow(GetDlgItem(hwndDlg, IDC_BMPUP), TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BMPDN), TRUE);
- }
EnableWindow(GetDlgItem(hwndDlg, IDC_ENAME), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_EPATH), FALSE);
@@ -675,34 +410,8 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
}
-int TTBOptInit(WPARAM wParam, LPARAM lParam)
-{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize = sizeof(odp);
- odp.position = 0;
- odp.hInstance = hInst;
- odp.pszGroup = LPGEN("TopToolBar");
-
- if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TTBBKG);
- odp.pszTitle = LPGEN("TTBBackground");
- odp.pfnDlgProc = DlgProcTTBBkgOpts;
- odp.flags = ODPF_BOLDGROUPS;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
- }
-
- ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.position = -1000000000;
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER);
- odp.pszGroup = LPGEN("TopToolBar");
- odp.pszTitle = LPGEN("Buttons");
- odp.pfnDlgProc = ButOrderOpts;
- odp.flags = ODPF_BOLDGROUPS|ODPF_EXPERTONLY;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
- return 0;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Options window: background
static INT_PTR CALLBACK DlgProcTTBBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -819,3 +528,34 @@ static INT_PTR CALLBACK DlgProcTTBBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
return FALSE;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+int TTBOptInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.cbSize = sizeof(odp);
+ odp.position = 0;
+ odp.hInstance = hInst;
+ odp.pszGroup = LPGEN("TopToolBar");
+
+ if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TTBBKG);
+ odp.pszTitle = LPGEN("TTBBackground");
+ odp.pfnDlgProc = DlgProcTTBBkgOpts;
+ odp.flags = ODPF_BOLDGROUPS;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ }
+
+ ZeroMemory(&odp, sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.position = -1000000000;
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER);
+ odp.pszGroup = LPGEN("TopToolBar");
+ odp.pszTitle = LPGEN("Buttons");
+ odp.pfnDlgProc = ButOrderOpts;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_EXPERTONLY;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ return 0;
+}
diff --git a/plugins/UserInfoEx/Flags/svc_flags.cpp b/plugins/UserInfoEx/Flags/svc_flags.cpp index 58fe8eec24..49435ec5c0 100644 --- a/plugins/UserInfoEx/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/Flags/svc_flags.cpp @@ -266,7 +266,7 @@ static void CALLBACK SetExtraImage(LPARAM lParam) { HICON hIcon=LoadFlag(countryNumber); // Returned HICON SHOULDN'T be destroyed, it is managed by IcoLib
if(hIcon!=NULL) {
phExtraImageList[index]=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON,(WPARAM)hIcon,0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0); /* does NULL check */
+ Skin_ReleaseIcon(hIcon); /* does NULL check */
}
}
iec.hImage=phExtraImageList[index];
@@ -502,7 +502,7 @@ MsgWndData::FlagsIconSet() { /* copy icon as status icon API will call DestroyIcon() on it */
hIcon = LoadFlagIcon(m_contryID);
sid.hIcon = (hIcon!=NULL)?CopyIcon(hIcon):NULL;
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0); /* does NULL check */
+ Skin_ReleaseIcon(hIcon); /* does NULL check */
hIcon = sid.hIcon;
sid.dwId = (DWORD)m_contryID;
sid.hIconDisabled = sid.hIcon/*NULL*/;
@@ -565,14 +565,14 @@ IconList::~IconList() { // const char *pszName; // [Optional] Name of an icon registered with icolib to be used in GUI.
static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/*StatusIconData *sid*/,int ID, int flags, const char* szTooltip)
{
- HICON hIcon = (HICON)CallService(MS_SKIN2_GETICON,(WPARAM)0/* =small 1=big*/,(LPARAM)pszName);
+ HICON hIcon = Skin_GetIcon(pszName);
StatusIconData sid = {0};
sid.cbSize = sizeof(sid);
sid.szModule = (char*)szModul;
sid.dwId = (DWORD)ID;
sid.hIcon = (hIcon!=NULL)?CopyIcon(hIcon):NULL;
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0); /* does NULL check */
+ Skin_ReleaseIcon(hIcon); /* does NULL check */
// sid.hIconDisabled = sid.hIcon/*NULL*/;
sid.flags = 0;
sid.szTooltip = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,ID,0));
diff --git a/plugins/UserInfoEx/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/Flags/svc_flagsicons.cpp index 34fec69c39..a765b8e8f8 100644 --- a/plugins/UserInfoEx/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/Flags/svc_flagsicons.cpp @@ -141,11 +141,11 @@ HICON LoadFlag(int countryNumber) char szId[20],*szCountry;
/* create identifier */
szCountry=(char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber,0);
- if(szCountry==NULL) {
+ if(szCountry == NULL)
szCountry=(char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber=0xFFFF,0);
- }
+
wsprintfA(szId,(countryNumber==0xFFFF)?"%s_0x%X":"%s_%i","flags",countryNumber); /* buffer safe */
- return (HICON)CallService(MS_SKIN2_GETICON,(WPARAM)0/* =small 1=big*/,(LPARAM)szId);
+ return Skin_GetIcon(szId);
}
int CountryNumberToIndex(int countryNumber)
@@ -431,7 +431,7 @@ VOID InitIcons() skid.hDefaultIcon=ImageList_ExtractIcon(NULL, himl, index);
index = CountryNumberToIndex(countries[i].id);
- phIconHandles[index]=(HANDLE)CallService(MS_SKIN2_ADDICON,0,(LPARAM)&skid);
+ phIconHandles[index] = Skin_AddIcon(&skid);
if(skid.hDefaultIcon!=NULL) DestroyIcon(skid.hDefaultIcon);
mir_free(skid.ptszDescription); skid.ptszDescription = NULL;
}
@@ -446,12 +446,11 @@ VOID InitIcons() VOID UninitIcons()
{
- int i;
- char szId[20];
- for(i=0;i<nCountriesCount;++i) {
+ for(int i=0;i<nCountriesCount;++i) {
/* create identifier */
+ char szId[20];
wsprintfA(szId,(countries[i].id==0xFFFF)?"%s0x%X":"%s%i","flags_",countries[i].id); /* buffer safe */
- CallService(MS_SKIN2_REMOVEICON,0,(LPARAM)&szId);
+ Skin_RemoveIcon(szId);
}
mir_free(phIconHandles); /* does NULL check */
}
diff --git a/plugins/UserInfoEx/dlg_anniversarylist.cpp b/plugins/UserInfoEx/dlg_anniversarylist.cpp index a7af16c239..8a41aa0138 100644 --- a/plugins/UserInfoEx/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/dlg_anniversarylist.cpp @@ -1087,26 +1087,16 @@ INT_PTR DlgAnniversaryListShow(WPARAM wParam, LPARAM lParam) *
* @return nothing
**/
+
VOID DlgAnniversaryListOnTopToolBarLoaded()
{
- TTBButton ttb;
- HICON hIcon;
- ICONINFO ii;
-
- hIcon = IcoLib_RegisterIcon(TBB_ICONAME, LPGEN("Anniversary list"),
- SECT_TOOLBAR, IDI_ANNIVERSARY, 0);
- if (hIcon) {
- GetIconInfo(hIcon, &ii);
-
- ZeroMemory(&ttb, sizeof(TTBButton));
- ttb.cbSize = sizeof(TTBButton);
- ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- ttb.pszServiceDown = MS_USERINFO_REMINDER_LIST;
- ttb.hbBitmapUp = ttb.hbBitmapDown = ii.hbmColor;
- ttb.name = Translate("Anniversary list");
-
- CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
- }
+ TTBButton ttb = { 0 };
+ ttb.cbSize = sizeof(ttb);
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ICONBYHANDLE;
+ ttb.pszServiceDown = MS_USERINFO_REMINDER_LIST;
+ ttb.hIconHandleDn = ttb.hIconHandleUp = Skin_GetIconHandle(ICO_COMMON_ANNIVERSARY);
+ ttb.name = "Anniversary list";
+ CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
}
/**
@@ -1119,22 +1109,14 @@ VOID DlgAnniversaryListOnTopToolBarLoaded() **/
VOID DlgAnniversaryListOnToolBarLoaded()
{
- TBButton tbb;
-
- ZeroMemory(&tbb, sizeof(tbb));
- tbb.cbSize = sizeof(tbb);
- tbb.tbbFlags = TBBF_VISIBLE | TBBF_SHOWTOOLTIP;
- tbb.defPos = 2100;
- tbb.pszButtonName =
- tbb.pszButtonID = TBB_IDBTN;
- tbb.pszServiceName = MS_USERINFO_REMINDER_LIST;
- tbb.pszTooltipDn =
- tbb.pszTooltipUp = LPGEN("Anniversary list");
- tbb.hPrimaryIconHandle =
- tbb.hSecondaryIconHandle =
- IcoLib_RegisterIconHandle(TBB_ICONAME, tbb.pszTooltipUp,
- SECT_TOOLBAR, IDI_ANNIVERSARY, 0);
-
+ TBButton tbb = { 0 };
+ tbb.cbSize = sizeof(tbb);
+ tbb.tbbFlags = TBBF_VISIBLE | TBBF_SHOWTOOLTIP;
+ tbb.defPos = 2100;
+ tbb.pszButtonName = tbb.pszButtonID = TBB_IDBTN;
+ tbb.pszServiceName = MS_USERINFO_REMINDER_LIST;
+ tbb.pszTooltipDn = tbb.pszTooltipUp = LPGEN("Anniversary list");
+ tbb.hPrimaryIconHandle = tbb.hSecondaryIconHandle = Skin_GetIconHandle(ICO_COMMON_ANNIVERSARY);
CallService(MS_TB_ADDBUTTON, 0, (LPARAM) &tbb);
}
diff --git a/plugins/UserInfoEx/mir_icolib.cpp b/plugins/UserInfoEx/mir_icolib.cpp index 4e8da429a6..ef5d22e487 100644 --- a/plugins/UserInfoEx/mir_icolib.cpp +++ b/plugins/UserInfoEx/mir_icolib.cpp @@ -210,7 +210,7 @@ static VOID IcoLib_CheckIconPackVersion(LPTSTR szIconPack) **/
HICON IcoLib_GetIcon(LPCSTR pszIcon)
{
- return (pszIcon) ? (HICON)CallService(MS_SKIN2_GETICON, NULL, (LPARAM) pszIcon) : NULL;
+ return (pszIcon) ? Skin_GetIcon(pszIcon) : NULL;
}
/**
@@ -222,7 +222,7 @@ HICON IcoLib_GetIcon(LPCSTR pszIcon) **/
HICON IcoLib_GetIconByHandle(HANDLE hIconItem)
{
- return (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, NULL, (LPARAM) hIconItem);
+ return Skin_GetIconByHandle(hIconItem);
}
/**
@@ -288,54 +288,42 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L {
HANDLE hIconHandle = NULL;
- if (szIconID && szDescription && szSection)
- {
- SKINICONDESC sid;
-
- ZeroMemory(&sid, sizeof(sid));
+ if (szIconID && szDescription && szSection) {
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
sid.ptszDescription = mir_a2t(szDescription);
sid.ptszSection = mir_a2t(szSection);
- if (sid.ptszDescription && sid.ptszSection)
- {
- switch (Size)
- {
- // small icons (16x16)
- case 0:
- {
- sid.cx = GetSystemMetrics(SM_CXSMICON);
- sid.cy = GetSystemMetrics(SM_CYSMICON);
- break;
- }
- // normal icons (32x32)
- case 1:
- {
- sid.cx = GetSystemMetrics(SM_CXICON);
- sid.cy = GetSystemMetrics(SM_CYICON);
- break;
- }
- // custom icon size
- default:
- {
- sid.cx = sid.cy = Size;
- break;
- }
+ if (sid.ptszDescription && sid.ptszSection) {
+ switch (Size) {
+ // small icons (16x16)
+ case 0:
+ sid.cx = GetSystemMetrics(SM_CXSMICON);
+ sid.cy = GetSystemMetrics(SM_CYSMICON);
+ break;
+
+ // normal icons (32x32)
+ case 1:
+ sid.cx = GetSystemMetrics(SM_CXICON);
+ sid.cy = GetSystemMetrics(SM_CYICON);
+ break;
+
+ // custom icon size
+ default:
+ sid.cx = sid.cy = Size;
+ break;
}
sid.ptszDefaultFile = szDefaultFile;
if (sid.ptszDefaultFile && sid.ptszDefaultFile[0])
- {
- sid.iDefaultIndex = ICONINDEX(idIcon);
- }
- else
- {
+ sid.iDefaultIndex = -idIcon;
+ else {
sid.hDefaultIcon = hDefIcon;
sid.iDefaultIndex = -1;
}
- hIconHandle = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconHandle = Skin_AddIcon(&sid);
}
MIR_FREE(sid.ptszDescription);
MIR_FREE(sid.ptszSection);
@@ -404,8 +392,7 @@ VOID IcoLib_LoadModule() ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
- for (i = 0; i < SIZEOF(icoDesc); i++)
- {
+ for (i = 0; i < SIZEOF(icoDesc); i++) {
IcoLib_RegisterIconHandleEx(
icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection,
szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon);
diff --git a/plugins/UserInfoEx/mir_icolib.h b/plugins/UserInfoEx/mir_icolib.h index 632f80b0ec..d5ac62e9fa 100644 --- a/plugins/UserInfoEx/mir_icolib.h +++ b/plugins/UserInfoEx/mir_icolib.h @@ -39,7 +39,6 @@ Last change by : $Author: ing.u.horn $ #define SECT_BUTTONS "UserInfoEx/Buttons"
#define SECT_TREE "UserInfoEx/TreeView"
#define SECT_REMIND "UserInfoEx/Reminder"
-#define SECT_TOOLBAR "ToolBar" // global toolbar section as used by modern clist
// icons
#define ICO_COMMON_IM MODNAME"_common_im"
diff --git a/plugins/UserInfoEx/psp_base.cpp b/plugins/UserInfoEx/psp_base.cpp index 0762178e96..e015131ad6 100644 --- a/plugins/UserInfoEx/psp_base.cpp +++ b/plugins/UserInfoEx/psp_base.cpp @@ -34,7 +34,7 @@ VOID UpDate_CountryIcon(HWND hCtrl, int countryID) { HICON hIcon = LoadFlagIcon(countryID);
HICON hOld = Static_SetIcon(hCtrl, hIcon);
ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hOld, 0);
+ Skin_ReleaseIcon(hOld);
}
/**
diff --git a/plugins/UserInfoEx/svc_email.cpp b/plugins/UserInfoEx/svc_email.cpp index 446556431f..2d74c96e75 100644 --- a/plugins/UserInfoEx/svc_email.cpp +++ b/plugins/UserInfoEx/svc_email.cpp @@ -142,7 +142,7 @@ static INT OnCListRebuildIcons(WPARAM wParam, LPARAM lParam) {
HICON hIcon = IcoLib_GetIcon(ICO_BTN_EMAIL);
ghExtraIconDef = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
diff --git a/plugins/UserInfoEx/svc_gender.cpp b/plugins/UserInfoEx/svc_gender.cpp index 128b9fe97e..433a7664b9 100644 --- a/plugins/UserInfoEx/svc_gender.cpp +++ b/plugins/UserInfoEx/svc_gender.cpp @@ -76,10 +76,10 @@ static INT OnCListRebuildIcons(WPARAM wParam, LPARAM lParam) {
HICON hIcon = IcoLib_GetIcon(ICO_COMMON_FEMALE);
ghExtraIconF = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
hIcon = IcoLib_GetIcon(ICO_COMMON_MALE);
ghExtraIconM = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
diff --git a/plugins/UserInfoEx/svc_homepage.cpp b/plugins/UserInfoEx/svc_homepage.cpp index 856a1fc68d..4d0ac22554 100644 --- a/plugins/UserInfoEx/svc_homepage.cpp +++ b/plugins/UserInfoEx/svc_homepage.cpp @@ -104,7 +104,7 @@ static INT OnCListRebuildIcons(WPARAM wParam, LPARAM lParam) {
HICON hIcon = IcoLib_GetIcon(ICO_BTN_GOTO);
ghExtraIconDef = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
diff --git a/plugins/UserInfoEx/svc_phone.cpp b/plugins/UserInfoEx/svc_phone.cpp index 4ddf2a1e5d..fab967c9a1 100644 --- a/plugins/UserInfoEx/svc_phone.cpp +++ b/plugins/UserInfoEx/svc_phone.cpp @@ -98,10 +98,10 @@ static INT OnCListRebuildIcons(WPARAM wParam, LPARAM lParam) {
HICON hIcon = IcoLib_GetIcon(ICO_BTN_PHONE);
ghExtraIconDef[0] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
hIcon = IcoLib_GetIcon(ICO_BTN_CELLULAR);
ghExtraIconDef[1] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon,0);
+ Skin_ReleaseIcon(hIcon);
return 0;
}
diff --git a/plugins/UserInfoEx/svc_reminder.cpp b/plugins/UserInfoEx/svc_reminder.cpp index 29441a8fc2..41940ac9f4 100644 --- a/plugins/UserInfoEx/svc_reminder.cpp +++ b/plugins/UserInfoEx/svc_reminder.cpp @@ -202,15 +202,12 @@ static HANDLE AddCListExtraIcon(const CEvent &evt) {
hClistIcon = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIco, 0);
if (hClistIcon == (HANDLE)CALLSERVICE_NOTFOUND)
- {
hClistIcon = INVALID_HANDLE_VALUE;
- }
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIco,0);
- }
- else
- {
- hClistIcon = INVALID_HANDLE_VALUE;
+
+ Skin_ReleaseIcon(hIco);
}
+ else hClistIcon = INVALID_HANDLE_VALUE;
+
return hClistIcon;
}
@@ -907,28 +904,18 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw int hTTButton = -1;
VOID SvcReminderOnTopToolBarLoaded()
{
- HICON hIcon = IcoLib_RegisterIcon(TBB_ICONAME, "Check anniversaries", SECT_TOOLBAR, IDI_BIRTHDAY, 0);
- if (hIcon)
- { /* for later merge
- ICONINFO ii;
- TTBButton ttb;
-
- GetIconInfo(hIcon, &ii);
- */
- TTBButtonV2 ttb;
- ZeroMemory(&ttb, sizeof(TTBButtonV2));
- ttb.cbSize = sizeof(TTBButtonV2);
-
- ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- ttb.pszServiceDown = MS_USERINFO_REMINDER_CHECK;
- ttb.name = Translate("Check anniversaries");
- ttb.hIconUp = ttb.hIconDn = hIcon;
- ttb.tooltipUp = ttb.tooltipDn = Translate("Check anniversaries");
+ TTBButton ttb = { 0 };
+ ttb.cbSize = sizeof(ttb);
+
+ ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ICONBYHANDLE;
+ ttb.pszServiceDown = MS_USERINFO_REMINDER_CHECK;
+ ttb.name = "Check anniversaries";
+ ttb.hIconHandleDn = ttb.hIconHandleUp = Skin_GetIconHandle(ICO_COMMON_BIRTHDAY);
+ ttb.tooltipUp = ttb.tooltipDn = "Check anniversaries";
- hTTButton = CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
- if (hTTButton)
- CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_TIPNAME, hTTButton), (LPARAM)(Translate("Check anniversaries")));
- }
+ hTTButton = CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
+ if (hTTButton)
+ CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_TIPNAME, hTTButton), (LPARAM)"Check anniversaries");
}
/**
@@ -952,8 +939,7 @@ VOID SvcReminderOnToolBarLoaded() tbb.pszServiceName = MS_USERINFO_REMINDER_CHECK;
tbb.pszTooltipDn =
tbb.pszTooltipUp = LPGEN("Check anniversaries");
- tbb.hPrimaryIconHandle =
- tbb.hSecondaryIconHandle = IcoLib_RegisterIconHandle(TBB_ICONAME, tbb.pszButtonName, SECT_TOOLBAR, IDI_BIRTHDAY, 0);
+ tbb.hPrimaryIconHandle = tbb.hSecondaryIconHandle = Skin_GetIconHandle(ICO_COMMON_BIRTHDAY);
CallService(MS_TB_ADDBUTTON, 0, (LPARAM) &tbb);
}
diff --git a/plugins/Utils/mir_icons.cpp b/plugins/Utils/mir_icons.cpp index 1fb2c0ef82..bab0674d35 100644 --- a/plugins/Utils/mir_icons.cpp +++ b/plugins/Utils/mir_icons.cpp @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <Windows.h>
#include "mir_icons.h"
@@ -26,8 +27,6 @@ Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
-
-
HICON IcoLib_LoadIcon(const char *iconName, BOOL copy)
{
if (!ServiceExists(MS_SKIN2_GETICON))
@@ -59,13 +58,12 @@ void IcoLib_ReleaseIcon(HICON hIcon) }
-void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id)
+HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id)
{
HICON hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) name);
- if (hIcon != NULL)
- {
+ if (hIcon != NULL) {
CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
- return;
+ return NULL;
}
SKINICONDESC sid = {0};
@@ -77,10 +75,11 @@ void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id) int cx = GetSystemMetrics(SM_CXSMICON);
sid.hDefaultIcon = (HICON) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED);
-
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ HANDLE hRes = Skin_AddIcon(&sid);
if (sid.hDefaultIcon)
DestroyIcon(sid.hDefaultIcon);
+
+ return hRes;
}
diff --git a/plugins/Utils/mir_icons.h b/plugins/Utils/mir_icons.h index 178094c803..e1e1a918a3 100644 --- a/plugins/Utils/mir_icons.h +++ b/plugins/Utils/mir_icons.h @@ -23,16 +23,10 @@ Boston, MA 02111-1307, USA. #define _CRT_SECURE_NO_WARNINGS
-#include <windows.h>
-
-
-void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id);
+HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id);
HICON IcoLib_LoadIcon(const char *iconName, BOOL copy = FALSE);
void IcoLib_ReleaseIcon(const char *iconName);
void IcoLib_ReleaseIcon(HICON hIcon);
-
-
-
#endif // __MIR_ICONS_H__
diff --git a/plugins/WhenWasIt/WhenWasIt.rc b/plugins/WhenWasIt/WhenWasIt.rc index afe6a7cb4a..97acb82865 100644 --- a/plugins/WhenWasIt/WhenWasIt.rc +++ b/plugins/WhenWasIt/WhenWasIt.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -159,7 +159,7 @@ END //
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_OPT_WWI, DIALOG
BEGIN
@@ -243,25 +243,18 @@ IDI_EXPORT_BIRTHDAYS ICON "icons\\export.ico" /////////////////////////////////////////////////////////////////////////////
//
-// Bitmap
-//
-
-IDB_TTB_CHECK BITMAP "icons\\check.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
// Dialog Info
//
IDD_ADD_BIRTHDAY DLGINIT
BEGIN
IDC_COMPATIBILITY, 0x403, 16, 0
-0x7250, 0x746f, 0x636f, 0x6c6f, 0x6d20, 0x646f, 0x6c75, 0x0065,
+0x7250, 0x746f, 0x636f, 0x6c6f, 0x6d20, 0x646f, 0x6c75, 0x0065,
IDC_COMPATIBILITY, 0x403, 19, 0
-0x7355, 0x7265, 0x6544, 0x6174, 0x6c69, 0x2073, 0x6f6d, 0x7564, 0x656c,
-"\000"
+0x7355, 0x7265, 0x6544, 0x6174, 0x6c69, 0x2073, 0x6f6d, 0x7564, 0x656c,
+"\000"
IDC_COMPATIBILITY, 0x403, 17, 0
-0x426d, 0x7269, 0x6874, 0x6164, 0x2079, 0x6f6d, 0x7564, 0x656c, "\000"
+0x426d, 0x7269, 0x6874, 0x6164, 0x2079, 0x6f6d, 0x7564, 0x656c, "\000"
0
END
@@ -279,4 +272,3 @@ END /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/WhenWasIt/hooked_events.cpp b/plugins/WhenWasIt/hooked_events.cpp index 20e9bfc86d..e24e642612 100644 --- a/plugins/WhenWasIt/hooked_events.cpp +++ b/plugins/WhenWasIt/hooked_events.cpp @@ -84,7 +84,6 @@ int UnhookEvents() UnhookEvent(hExtraImageApply);
UnhookEvent(hContactSettingChanged);
UnhookEvent(hTopToolBarModuleLoaded);
- //UnhookEvent(hContactSendMessage);
KillTimers();
@@ -158,8 +157,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) cl.pszName = "Add/change user &birthday";
hmAddChangeBirthday = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &cl);
- if(ServiceExists(MS_HOTKEY_REGISTER))
- {
+ if(ServiceExists(MS_HOTKEY_REGISTER)) {
HOTKEYDESC hotkey = {0};
hotkey.cbSize = sizeof(hotkey);
hotkey.dwFlags = HKD_TCHAR;
@@ -185,13 +183,9 @@ int OnTopToolBarModuleLoaded(WPARAM wParam, LPARAM lParam) ttb.cbSize = sizeof(TTBButton);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszServiceDown = MS_WWI_CHECK_BIRTHDAYS;
- HBITMAP bitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TTB_CHECK));
- ttb.hbBitmapUp = (HBITMAP) bitmap;
- ttb.hbBitmapDown = (HBITMAP) bitmap;
- ttb.name = Translate("Check for birthdays");
+ ttb.hIconUp = ttb.hIconDn = hiCheckMenu;
+ ttb.name = "Check for birthdays";
CallService(MS_TTB_ADDBUTTON, (WPARAM) &ttb, 0);
- //DeleteObject(icon);
-
return 0;
}
diff --git a/plugins/WhenWasIt/icons/check.bmp b/plugins/WhenWasIt/icons/check.bmp Binary files differdeleted file mode 100644 index cf430c8c6d..0000000000 --- a/plugins/WhenWasIt/icons/check.bmp +++ /dev/null diff --git a/plugins/WhenWasIt/resource.h b/plugins/WhenWasIt/resource.h index d04aaf378f..e43831ac79 100644 --- a/plugins/WhenWasIt/resource.h +++ b/plugins/WhenWasIt/resource.h @@ -20,9 +20,7 @@ #define IDI_DTB0 117
#define IDI_DTBMORE 118
#define IDD_ADD_BIRTHDAY 119
-#define IDI_ICON1 120
-#define IDI_ADD 120
-#define IDB_TTB_CHECK 122
+#define IDI_ADD 121
#define IDI_REFRESH_USERDETAILS 123
#define IDI_IMPORT 125
#define IDI_IMPORT_BIRTHDAYS 125
@@ -70,7 +68,7 @@ #define IDC_OPENINBACKGROUND 1047
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
|