summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/controls.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-10 21:07:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-10 21:07:20 +0000
commit6b1fbf4d40fa3b643aca4e9e82a132cc54f36b76 (patch)
treec9757bf9da76e125d8a8da1ca3d4e8e996ae792f /plugins/TabSRMM/src/controls.cpp
parent1df925a85fe8e7a03698a8a5a7a2e3ee03e2c3a1 (diff)
- SRMM status icons module moved to the core;
- this code removed from Scriver & tabSRMM git-svn-id: http://svn.miranda-ng.org/main/trunk@4416 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/controls.cpp')
-rw-r--r--plugins/TabSRMM/src/controls.cpp79
1 files changed, 12 insertions, 67 deletions
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index eff180cab9..5477979d29 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -923,39 +923,19 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
*/
case WM_USER + 101:
{
+ int list_icons = 0;
struct TWindowData *dat = (struct TWindowData *)lParam;
- RECT rcs;
- int statwidths[5];
- TStatusBarIconNode *current = status_icon_list;
- int list_icons = 0;
- char buff[100];
- DWORD flags;
-
- while (current && dat) {
- flags=current->sid.flags;
- if (current->sid.flags&MBF_OWNERSTATE){
- TStatusBarIconNode *currentSIN = dat->pSINod;
-
- while (currentSIN) {
- if (strcmp(currentSIN->sid.szModule, current->sid.szModule) == 0 && currentSIN->sid.dwId == current->sid.dwId) {
- flags=currentSIN->sid.flags;
- break;
- }
- currentSIN = currentSIN->next;
- }
- }
- else {
- sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
- flags = M->GetByte(dat->hContact, current->sid.szModule, buff, current->sid.flags);
- }
- if (!(flags & MBF_HIDDEN))
+ if (dat) {
+ while ( CallService(MS_MSG_GETNTHICON, (WPARAM)dat->hContact, list_icons))
list_icons++;
- current = current->next;
}
SendMessage(hWnd, WM_SIZE, 0, 0);
+
+ RECT rcs;
GetWindowRect(hWnd, &rcs);
+ int statwidths[5];
statwidths[0] = (rcs.right - rcs.left) - (2 * SB_CHAR_WIDTH + 20) - (52 + ((list_icons) * (PluginConfig.m_smcxicon + 2)));
statwidths[1] = (rcs.right - rcs.left) - (62 + ((list_icons) * (PluginConfig.m_smcxicon + 2)));
statwidths[2] = -1;
@@ -1030,48 +1010,13 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
SendMessage(hWnd, SB_GETRECT, 2, (LPARAM)&rc);
if (dat && PtInRect(&rc, pt)) {
int gap = 2;
- TStatusBarIconNode *current = status_icon_list;
- TStatusBarIconNode *clicked = NULL;
- TStatusBarIconNode *currentSIN = NULL;
-
unsigned int iconNum = (pt.x - rc.left) / (PluginConfig.m_smcxicon + gap);
- unsigned int list_icons = 0;
- char buff[100];
- DWORD flags;
-
- while (current) {
- if (current->sid.flags&MBF_OWNERSTATE&&dat->pSINod){
- TStatusBarIconNode *currentSIN = dat->pSINod;
- flags=current->sid.flags;
- while (currentSIN) {
- if (strcmp(currentSIN->sid.szModule, current->sid.szModule) == 0 && currentSIN->sid.dwId == current->sid.dwId) {
- flags=currentSIN->sid.flags;
- break;
- }
- currentSIN = currentSIN->next;
- }
- }
- else {
- sprintf(buff, "SRMMStatusIconFlags%d", (int)current->sid.dwId);
- flags = M->GetByte(dat->hContact, current->sid.szModule, buff, current->sid.flags);
- }
- if (!(flags & MBF_HIDDEN)) {
- if (list_icons++ == iconNum)
- clicked = current;
- }
- current = current->next;
- }
- if (clicked&&clicked->sid.flags&MBF_OWNERSTATE) {
- currentSIN=dat->pSINod;
- while (currentSIN) {
- if (strcmp(currentSIN->sid.szModule, clicked->sid.szModule) == 0 && currentSIN->sid.dwId == clicked->sid.dwId) {
- clicked=currentSIN;
- break;
- }
- currentSIN = currentSIN->next;
- }
- }
+ int list_icons = 0;
+ StatusIconData *si, *clicked = NULL;
+ while ((si = (StatusIconData*)CallService(MS_MSG_GETNTHICON, (WPARAM)dat->hContact, list_icons)) != NULL)
+ if (list_icons++ == iconNum)
+ clicked = si;
if ((int)iconNum == list_icons && pContainer) {
TCHAR wBuf[512];
@@ -1100,7 +1045,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
}
else {
if (clicked) {
- CallService("mToolTip/ShowTip", (WPARAM)clicked->sid.szTooltip, (LPARAM)&ti);
+ CallService("mToolTip/ShowTip", (WPARAM)clicked->szTooltip, (LPARAM)&ti);
tooltip_active = TRUE;
}
}