summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp28
-rw-r--r--plugins/TabSRMM/src/msgs.h2
-rw-r--r--plugins/TabSRMM/src/sendqueue.h2
4 files changed, 20 insertions, 16 deletions
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 7368c7be05..71d4674c6e 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -769,7 +769,7 @@ void CInfoPanel::handleClick(const POINT& pt)
return;
if (!m_isChat) {
- ::KillTimer(m_dat->GetHwnd(), TIMERID_AWAYMSG);
+ m_dat->timerAwayMsg.Stop();
m_dat->m_bAwayMsgTimer = false;
}
HMENU m = constructContextualMenu();
@@ -841,7 +841,7 @@ void CInfoPanel::trackMouse(POINT &pt)
if (m_hoverFlags) {
if (!m_dat->m_bAwayMsgTimer) {
- ::SetTimer(m_dat->GetHwnd(), TIMERID_AWAYMSG, 1000, nullptr);
+ m_dat->timerAwayMsg.Start(1000);
m_dat->m_bAwayMsgTimer = true;
}
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 7a2f921952..fdff2f7f82 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -312,6 +312,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) :
CSuper(g_plugin, iDlgId),
m_pPanel(this),
+ timerAwayMsg(this, 4),
m_btnOk(this, IDOK),
m_btnAdd(this, IDC_ADD),
m_btnQuote(this, IDC_QUOTE),
@@ -329,6 +330,7 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) :
CMsgDialog::CMsgDialog(SESSION_INFO *si) :
CSuper(g_plugin, IDD_CHANNEL, si),
m_pPanel(this),
+ timerAwayMsg(this, 4),
m_btnOk(this, IDOK),
m_btnAdd(this, IDC_ADD),
m_btnQuote(this, IDC_QUOTE),
@@ -1092,6 +1094,20 @@ void CMsgDialog::onFlash(CTimer *)
FlashTab(true);
}
+// timer to control info panel hovering
+void CMsgDialog::onAwayMsg(CTimer *pTimer)
+{
+ pTimer->Stop();
+
+ POINT pt;
+ GetCursorPos(&pt);
+
+ if (m_pPanel.hitTest(pt) != CInfoPanel::HTNIRVANA)
+ ActivateTooltip(0, 0);
+ else
+ m_bAwayMsgTimer = false;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// resizer proc for the "new" layout.
@@ -2727,18 +2743,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
case WM_TIMER:
- // timer to control info panel hovering
- if (wParam == TIMERID_AWAYMSG) {
- KillTimer(m_hwnd, wParam);
- GetCursorPos(&pt);
-
- if (wParam == TIMERID_AWAYMSG && m_pPanel.hitTest(pt) != CInfoPanel::HTNIRVANA)
- ActivateTooltip(0, 0);
- else
- m_bAwayMsgTimer = false;
- break;
- }
-
// timer id for message timeouts is composed like:
// for single message sends: basevalue (TIMERID_MSGSEND) + send queue index
if (wParam >= TIMERID_MSGSEND) {
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 5d25322ab6..b1f0280c09 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -524,6 +524,7 @@ public:
wchar_t *m_wszSearchQuery, *m_wszSearchResult;
SESSION_INFO *m_pLastSession;
+ CTimer timerAwayMsg;
CCtrlButton m_btnOk, m_btnAdd, m_btnQuote, m_btnCancelAdd;
public:
@@ -540,6 +541,7 @@ public:
void onType(CTimer *);
void onFlash(CTimer *);
+ void onAwayMsg(CTimer *);
void onChange_Message(CCtrlEdit *);
diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h
index bf73526477..632622e508 100644
--- a/plugins/TabSRMM/src/sendqueue.h
+++ b/plugins/TabSRMM/src/sendqueue.h
@@ -28,8 +28,6 @@
#define __SENDQUEUE_H
#define TIMERID_MSGSEND 100
-#define TIMERID_AWAYMSG 4
-//#define TIMERID_TOOLTIP 5
#define TIMEOUT_TYPEOFF 10000 // send type off after 10 seconds of inactivity
#define SB_CHAR_WIDTH 45
#define SEND_FLAGS PREF_UNICODE