diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-12 15:51:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-12 15:51:22 +0000 |
commit | 6dc4fd2f8e7505ee9ed4e58401b1f3b7c3438efd (patch) | |
tree | 1967619a9d24d247f25f361806e29a9bf2dfaa2f /src | |
parent | 9f8496a5ceeaa15fc355877fbf6401f05597383d (diff) |
- fix for drawing status bar icons;
- fix for the Unicode window procedure
git-svn-id: http://svn.miranda-ng.org/main/trunk@11348 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/statusicon.cpp | 16 | ||||
-rw-r--r-- | src/core/stdmsg/src/statusicon.h | 4 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 8bb5a9ce11..e566a650ec 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1562,7 +1562,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(dat->hwndStatus, SB_GETRECT, SendMessage(dat->hwndStatus, SB_GETPARTS, 0, 0) - 1, (LPARAM)&rc);
if (nm->pt.x >= rc.left)
- CheckIconClick(dat->hContact, dat->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
+ CheckStatusIconClick(dat->hContact, dat->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0);
return TRUE;
}
}
diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp index 20932d34ea..0e96ec1235 100644 --- a/src/core/stdmsg/src/statusicon.cpp +++ b/src/core/stdmsg/src/statusicon.cpp @@ -36,25 +36,27 @@ static int OnSrmmIconChanged(WPARAM hContact, LPARAM) return 0;
}
-void DrawStatusIcons(MCONTACT hContact, HDC hDC, RECT r, int gap)
+void DrawStatusIcons(MCONTACT hContact, HDC hDC, const RECT &rc, int gap)
{
- int x = r.left;
+ int x = rc.left;
+ int cx_icon = GetSystemMetrics(SM_CXSMICON);
+ int cy_icon = GetSystemMetrics(SM_CYSMICON);
int nIcon = 0;
StatusIconData *sid;
- while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < r.right) {
+ while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < rc.right) {
HICON hIcon = ((sid->flags & MBF_DISABLED) && sid->hIconDisabled) ? sid->hIconDisabled : sid->hIcon;
SetBkMode(hDC, TRANSPARENT);
- DrawIconEx(hDC, x, (r.top + r.bottom - GetSystemMetrics(SM_CYSMICON)) >> 1, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
+ DrawIconEx(hDC, x, (rc.top + rc.bottom - cy_icon) >> 1, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
- x += GetSystemMetrics(SM_CYSMICON) + gap;
+ x += cx_icon + gap;
}
}
-void CheckIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags)
+void CheckStatusIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int click_flags)
{
- int iconNum = (pt.x - r.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
+ int iconNum = (pt.x - rc.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
StatusIconData *sid = Srmm_GetNthIcon(hContact, iconNum);
if (sid == NULL)
return;
diff --git a/src/core/stdmsg/src/statusicon.h b/src/core/stdmsg/src/statusicon.h index 8afbbfb0bb..8a267917dc 100644 --- a/src/core/stdmsg/src/statusicon.h +++ b/src/core/stdmsg/src/statusicon.h @@ -8,7 +8,7 @@ int InitStatusIcons(); int DeinitStatusIcons();
int GetStatusIconsCount(MCONTACT hContact);
-void DrawStatusIcons(MCONTACT hContact, HDC hdc, RECT r, int gap);
-void CheckIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int flags);
+void DrawStatusIcons(MCONTACT hContact, HDC hdc, const RECT &rc, int gap);
+void CheckStatusIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int flags);
#endif
|