summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Scriver/res/resource.rc13
-rw-r--r--plugins/Scriver/src/msgdialog.cpp24
-rw-r--r--plugins/Scriver/src/msglog.cpp488
-rw-r--r--plugins/Scriver/src/msgoptions.cpp16
-rw-r--r--plugins/Scriver/src/msgs.cpp3
-rw-r--r--plugins/Scriver/src/msgs.h22
-rw-r--r--plugins/Scriver/src/resource.h3
-rw-r--r--plugins/Scriver/src/srmm.cpp101
-rw-r--r--plugins/Scriver/src/stdafx.h3
-rw-r--r--src/core/stdmsg/res/resource.rc71
-rw-r--r--src/core/stdmsg/src/msglog.cpp12
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp4
-rw-r--r--src/core/stdmsg/src/resource.h3
-rw-r--r--src/core/stdmsg/src/srmm.cpp1
-rw-r--r--src/core/stdmsg/src/stdafx.h2
15 files changed, 378 insertions, 388 deletions
diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc
index 653c4920a2..4d9b685d7d 100644
--- a/plugins/Scriver/res/resource.rc
+++ b/plugins/Scriver/res/resource.rc
@@ -126,8 +126,8 @@ BEGIN
CONTROL "Show lines between messages",IDC_DRAWLINES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,56,120,10
CONTROL "Indent text",IDC_INDENTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,67,102,10
EDITTEXT IDC_INDENTSIZE,262,66,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
- CONTROL "Spin1",IDC_INDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,290,79,10,12
- CONTROL "Customize fonts and colors",IDC_FONTSCOLORS,"Hyperlink",0x0,8,78,200,8
+ CONTROL "Spin1",IDC_INDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,290,66,10,12
+ CONTROL "Customize fonts and colors",IDC_FONTSCOLORS,"Hyperlink",0x0,8,78,142,8
CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,92,288,68,WS_EX_STATICEDGE
GROUPBOX "Preload",IDC_STATIC,0,166,304,50
CONTROL "Unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,177,138,10
@@ -139,6 +139,7 @@ BEGIN
EDITTEXT IDC_LOADTIMEN,150,200,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
CONTROL "Spin1",IDC_LOADTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,175,200,11,14
LTEXT "minutes",IDC_STMINSOLD,185,202,90,8,WS_DISABLED
+ CONTROL "Automatically copy selected text",IDC_AUTOCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,79,140,10
END
IDD_OPT_MSGTYPE DIALOGEX 0, 0, 283, 252
@@ -313,15 +314,7 @@ BEGIN
IDD_OPT_MSGLOG, DIALOG
BEGIN
- VERTGUIDE, 10
- VERTGUIDE, 19
- VERTGUIDE, 28
- VERTGUIDE, 150
- VERTGUIDE, 156
- VERTGUIDE, 169
- VERTGUIDE, 300
BOTTOMMARGIN, 218
- HORZGUIDE, 199
END
IDD_OPT_MSGTYPE, DIALOG
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 8b9778537f..a3b069b3c4 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-LIST<CMsgDialog> g_arDialogs(10, PtrKeySortT);
-
/////////////////////////////////////////////////////////////////////////////////////////
static CMStringW GetQuotedTextW(wchar_t *text)
@@ -140,8 +138,6 @@ CMsgDialog::CMsgDialog(SESSION_INFO *si) :
void CMsgDialog::Init()
{
- g_arDialogs.insert(this);
-
m_autoClose = CLOSE_ON_CANCEL;
m_szProto = Proto_GetBaseAccountName(m_hContact);
@@ -284,8 +280,6 @@ void CMsgDialog::OnDestroy()
{
NotifyEvent(MSG_WINDOW_EVT_CLOSING);
- g_arDialogs.remove(this);
-
if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON)
NotifyTyping(PROTOTYPE_SELFTYPING_OFF);
@@ -756,24 +750,6 @@ INT_PTR CALLBACK CMsgDialog::FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- int result = m_pDlg.InputAreaShortcuts(m_rtf.GetHwnd(), msg, wParam, lParam);
- if (result != -1)
- return result;
-
- switch (msg) {
- case WM_MEASUREITEM:
- Menu_MeasureItem(lParam);
- return TRUE;
-
- case WM_DRAWITEM:
- return Menu_DrawItem(lParam);
- }
-
- return CSuper::WndProc(msg, wParam, lParam);
-}
-
LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
{
int result = InputAreaShortcuts(m_message.GetHwnd(), msg, wParam, lParam);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index 139fd3eef0..6b4b2266b7 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -696,262 +696,304 @@ void FreeMsgLogIcons(void)
}
/////////////////////////////////////////////////////////////////////////////////////////
+// CLogWindow - built-in log window
-void CLogWindow::Attach()
+class CLogWindow : public CRtfLogWindow
{
- CSuper::Attach();
-
- uint32_t dwExStyle = GetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE);
- SetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE, (m_pDlg.m_bUseRtl) ? dwExStyle | WS_EX_LEFTSCROLLBAR : dwExStyle & ~WS_EX_LEFTSCROLLBAR);
-
- // Workaround to make Richedit display RTL messages correctly
- PARAFORMAT2 pf2;
- memset(&pf2, 0, sizeof(pf2));
- pf2.cbSize = sizeof(pf2);
- pf2.dwMask = PFM_RTLPARA | PFM_OFFSETINDENT | PFM_RIGHTINDENT;
- pf2.wEffects = PFE_RTLPARA;
- pf2.dxStartIndent = 30;
- pf2.dxRightIndent = 30;
- m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
-
- pf2.dwMask = PFM_RTLPARA;
- pf2.wEffects = 0;
- m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
-
- m_rtf.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_LINK | ENM_KEYEVENTS);
- m_rtf.SendMsg(EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
- m_rtf.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_rtf.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
- m_rtf.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
- m_rtf.SendMsg(EM_LIMITTEXT, 0x7FFFFFFF, 0);
- m_rtf.SendMsg(EM_HIDESELECTION, TRUE, 0);
- m_rtf.SendMsg(EM_AUTOURLDETECT, TRUE, 0);
-}
-
-void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend)
-{
- CHARRANGE oldSel, sel;
- m_rtf.SetDraw(false);
- m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldSel);
-
- LogStreamData streamData = {};
- streamData.hContact = m_pDlg.m_hContact;
- streamData.hDbEvent = hDbEventFirst;
- streamData.hDbEventLast = m_pDlg.m_hDbEventLast;
- streamData.dlgDat = &m_pDlg;
- streamData.eventsToInsert = count;
- streamData.isFirst = bAppend ? m_rtf.GetRichTextLength() == 0 : 1;
- streamData.gdat = &g_dat;
-
- EDITSTREAM stream = {};
- stream.pfnCallback = LogStreamInEvents;
- stream.dwCookie = (DWORD_PTR)&streamData;
- sel.cpMin = 0;
-
- POINT scrollPos;
- bool bottomScroll = (GetFocus() != m_rtf.GetHwnd());
- if (bottomScroll && (GetWindowLongPtr(m_rtf.GetHwnd(), GWL_STYLE) & WS_VSCROLL)) {
- SCROLLINFO si = {};
- si.cbSize = sizeof(si);
- si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
- GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si);
- bottomScroll = (si.nPos + (int)si.nPage) >= si.nMax;
- }
- if (!bottomScroll)
- m_rtf.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&scrollPos);
-
- FINDTEXTEXA fi;
- if (bAppend) {
- GETTEXTLENGTHEX gtxl = { 0 };
- gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
- gtxl.codepage = 1200;
- fi.chrg.cpMin = m_rtf.SendMsg(EM_GETTEXTLENGTHEX, (WPARAM)&gtxl, 0);
- sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
- }
- else {
+ typedef CRtfLogWindow CSuper;
+
+public:
+ CLogWindow(CMsgDialog &pDlg) :
+ CSuper(pDlg)
+ {}
+
+ void Attach() override
+ {
+ CSuper::Attach();
+
+ uint32_t dwExStyle = GetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE);
+ SetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE, (m_pDlg.m_bUseRtl) ? dwExStyle | WS_EX_LEFTSCROLLBAR : dwExStyle & ~WS_EX_LEFTSCROLLBAR);
+
+ // Workaround to make Richedit display RTL messages correctly
+ PARAFORMAT2 pf2;
+ memset(&pf2, 0, sizeof(pf2));
+ pf2.cbSize = sizeof(pf2);
+ pf2.dwMask = PFM_RTLPARA | PFM_OFFSETINDENT | PFM_RIGHTINDENT;
+ pf2.wEffects = PFE_RTLPARA;
+ pf2.dxStartIndent = 30;
+ pf2.dxRightIndent = 30;
+ m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
+
+ pf2.dwMask = PFM_RTLPARA;
+ pf2.wEffects = 0;
+ m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
+
+ m_rtf.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_LINK | ENM_KEYEVENTS);
+ m_rtf.SendMsg(EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
+ m_rtf.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_rtf.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
+ m_rtf.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
+ m_rtf.SendMsg(EM_LIMITTEXT, 0x7FFFFFFF, 0);
+ m_rtf.SendMsg(EM_HIDESELECTION, TRUE, 0);
+ m_rtf.SendMsg(EM_AUTOURLDETECT, TRUE, 0);
+ }
+
+ void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override
+ {
+ CHARRANGE oldSel, sel;
m_rtf.SetDraw(false);
- m_rtf.SetTextA("");
+ m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldSel);
+
+ LogStreamData streamData = {};
+ streamData.hContact = m_pDlg.m_hContact;
+ streamData.hDbEvent = hDbEventFirst;
+ streamData.hDbEventLast = m_pDlg.m_hDbEventLast;
+ streamData.dlgDat = &m_pDlg;
+ streamData.eventsToInsert = count;
+ streamData.isFirst = bAppend ? m_rtf.GetRichTextLength() == 0 : 1;
+ streamData.gdat = &g_dat;
+
+ EDITSTREAM stream = {};
+ stream.pfnCallback = LogStreamInEvents;
+ stream.dwCookie = (DWORD_PTR)&streamData;
sel.cpMin = 0;
- sel.cpMax = m_rtf.GetRichTextLength();
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
- fi.chrg.cpMin = 0;
- m_pDlg.m_isMixed = 0;
- }
- m_rtf.SendMsg(EM_STREAMIN, bAppend ? SFF_SELECTION | SF_RTF : SFF_SELECTION | SF_RTF, (LPARAM)&stream);
- if (bottomScroll) {
- sel.cpMin = sel.cpMax = -1;
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
- }
- else {
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&oldSel);
- m_rtf.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&scrollPos);
- }
+ POINT scrollPos;
+ bool bottomScroll = (GetFocus() != m_rtf.GetHwnd());
+ if (bottomScroll && (GetWindowLongPtr(m_rtf.GetHwnd(), GWL_STYLE) & WS_VSCROLL)) {
+ SCROLLINFO si = {};
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
+ GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si);
+ bottomScroll = (si.nPos + (int)si.nPage) >= si.nMax;
+ }
+ if (!bottomScroll)
+ m_rtf.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&scrollPos);
+
+ FINDTEXTEXA fi;
+ if (bAppend) {
+ GETTEXTLENGTHEX gtxl = { 0 };
+ gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
+ gtxl.codepage = 1200;
+ fi.chrg.cpMin = m_rtf.SendMsg(EM_GETTEXTLENGTHEX, (WPARAM)&gtxl, 0);
+ sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ }
+ else {
+ m_rtf.SetDraw(false);
+ m_rtf.SetTextA("");
+ sel.cpMin = 0;
+ sel.cpMax = m_rtf.GetRichTextLength();
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ fi.chrg.cpMin = 0;
+ m_pDlg.m_isMixed = 0;
+ }
+
+ m_rtf.SendMsg(EM_STREAMIN, bAppend ? SFF_SELECTION | SF_RTF : SFF_SELECTION | SF_RTF, (LPARAM)&stream);
+ if (bottomScroll) {
+ sel.cpMin = sel.cpMax = -1;
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ }
+ else {
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&oldSel);
+ m_rtf.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&scrollPos);
+ }
+
+ if (g_dat.smileyAddInstalled) {
+ SMADD_RICHEDIT3 smre;
+ smre.cbSize = sizeof(SMADD_RICHEDIT3);
+ smre.hwndRichEditControl = m_rtf.GetHwnd();
- if (g_dat.smileyAddInstalled) {
- SMADD_RICHEDIT3 smre;
- smre.cbSize = sizeof(SMADD_RICHEDIT3);
- smre.hwndRichEditControl = m_rtf.GetHwnd();
+ MCONTACT hContact = db_mc_getSrmmSub(m_pDlg.m_hContact);
+ smre.Protocolname = (hContact != 0) ? Proto_GetBaseAccountName(hContact) : m_pDlg.m_szProto;
- MCONTACT hContact = db_mc_getSrmmSub(m_pDlg.m_hContact);
- smre.Protocolname = (hContact != 0) ? Proto_GetBaseAccountName(hContact) : m_pDlg.m_szProto;
+ if (fi.chrg.cpMin > 0) {
+ sel.cpMin = fi.chrg.cpMin;
+ sel.cpMax = -1;
+ smre.rangeToReplace = &sel;
+ }
+ else smre.rangeToReplace = nullptr;
- if (fi.chrg.cpMin > 0) {
- sel.cpMin = fi.chrg.cpMin;
- sel.cpMax = -1;
- smre.rangeToReplace = &sel;
+ smre.disableRedraw = TRUE;
+ smre.hContact = m_pDlg.m_hContact;
+ smre.flags = 0;
+ CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&smre);
}
- else smre.rangeToReplace = nullptr;
- smre.disableRedraw = TRUE;
- smre.hContact = m_pDlg.m_hContact;
- smre.flags = 0;
- CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&smre);
- }
+ m_rtf.SetDraw(true);
+ if (bottomScroll) {
+ ScrollToBottom();
+ RedrawWindow(m_rtf.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
+ }
- m_rtf.SetDraw(true);
- if (bottomScroll) {
- ScrollToBottom();
- RedrawWindow(m_rtf.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
+ m_pDlg.m_hDbEventLast = streamData.hDbEventLast;
}
- m_pDlg.m_hDbEventLast = streamData.hDbEventLast;
-}
+ void LogEvents(struct LOGINFO *lin, bool bRedraw) override
+ {
+ auto *si = m_pDlg.m_si;
+ if (m_rtf.GetHwnd() == nullptr || lin == nullptr || si == nullptr)
+ return;
-void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw)
-{
- auto *si = m_pDlg.m_si;
- if (m_rtf.GetHwnd() == nullptr || lin == nullptr || si == nullptr)
- return;
+ if (!bRedraw && (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) && m_pDlg.m_bFilterEnabled && !(m_pDlg.m_iLogFilterFlags & lin->iType))
+ return;
- if (!bRedraw && (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) && m_pDlg.m_bFilterEnabled && !(m_pDlg.m_iLogFilterFlags & lin->iType))
- return;
+ LOGSTREAMDATA streamData;
+ memset(&streamData, 0, sizeof(streamData));
+ streamData.hwnd = m_rtf.GetHwnd();
+ streamData.si = si;
+ streamData.lin = lin;
+ streamData.bStripFormat = FALSE;
+ streamData.isFirst = bRedraw ? 1 : m_rtf.GetRichTextLength() == 0;
- LOGSTREAMDATA streamData;
- memset(&streamData, 0, sizeof(streamData));
- streamData.hwnd = m_rtf.GetHwnd();
- streamData.si = si;
- streamData.lin = lin;
- streamData.bStripFormat = FALSE;
- streamData.isFirst = bRedraw ? 1 : m_rtf.GetRichTextLength() == 0;
+ EDITSTREAM stream = {};
+ stream.pfnCallback = Srmm_LogStreamCallback;
+ stream.dwCookie = (DWORD_PTR)&streamData;
- EDITSTREAM stream = {};
- stream.pfnCallback = Srmm_LogStreamCallback;
- stream.dwCookie = (DWORD_PTR)&streamData;
+ SCROLLINFO scroll;
+ scroll.cbSize = sizeof(SCROLLINFO);
+ scroll.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
+ GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &scroll);
- SCROLLINFO scroll;
- scroll.cbSize = sizeof(SCROLLINFO);
- scroll.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
- GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &scroll);
+ POINT point = {};
+ m_rtf.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&point);
- POINT point = {};
- m_rtf.SendMsg(EM_GETSCROLLPOS, 0, (LPARAM)&point);
+ // do not scroll to bottom if there is a selection
+ CHARRANGE oldsel, sel, newsel;
+ m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldsel);
+ if (oldsel.cpMax != oldsel.cpMin)
+ m_rtf.SetDraw(false);
- // do not scroll to bottom if there is a selection
- CHARRANGE oldsel, sel, newsel;
- m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldsel);
- if (oldsel.cpMax != oldsel.cpMin)
- m_rtf.SetDraw(false);
+ // set the insertion point at the bottom
+ sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&sel);
- // set the insertion point at the bottom
- sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
- m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&sel);
+ // fix for the indent... must be a M$ bug
+ if (sel.cpMax == 0)
+ bRedraw = TRUE;
- // fix for the indent... must be a M$ bug
- if (sel.cpMax == 0)
- bRedraw = TRUE;
+ // should the event(s) be appended to the current log
+ WPARAM wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
- // should the event(s) be appended to the current log
- WPARAM wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
+ // get the number of pixels per logical inch
+ bool bFlag = false;
+ if (bRedraw) {
+ m_rtf.SetDraw(false);
+ bFlag = true;
+ }
- // get the number of pixels per logical inch
- bool bFlag = false;
- if (bRedraw) {
- m_rtf.SetDraw(false);
- bFlag = true;
- }
-
- // stream in the event(s)
- streamData.lin = lin;
- streamData.bRedraw = bRedraw;
- m_rtf.SendMsg(EM_STREAMIN, wp, (LPARAM)&stream);
-
- // do smileys
- if (g_dat.smileyAddInstalled && (bRedraw || (lin->ptszText && lin->iType != GC_EVENT_JOIN && lin->iType != GC_EVENT_NICK && lin->iType != GC_EVENT_ADDSTATUS && lin->iType != GC_EVENT_REMOVESTATUS))) {
- newsel.cpMax = -1;
- newsel.cpMin = sel.cpMin;
- if (newsel.cpMin < 0)
- newsel.cpMin = 0;
-
- SMADD_RICHEDIT3 sm = { sizeof(sm) };
- sm.hwndRichEditControl = m_rtf.GetHwnd();
- sm.Protocolname = si->pszModule;
- sm.rangeToReplace = bRedraw ? nullptr : &newsel;
- sm.flags = 0;
- sm.disableRedraw = TRUE;
- sm.hContact = m_pDlg.m_hContact;
- CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm);
- }
-
- // scroll log to bottom if the log was previously scrolled to bottom, else restore old position
- if (bRedraw || (UINT)scroll.nPos >= (UINT)scroll.nMax - scroll.nPage - 5 || scroll.nMax - scroll.nMin - scroll.nPage < 50)
- ScrollToBottom();
- else
- m_rtf.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&point);
+ // stream in the event(s)
+ streamData.lin = lin;
+ streamData.bRedraw = bRedraw;
+ m_rtf.SendMsg(EM_STREAMIN, wp, (LPARAM)&stream);
+
+ // do smileys
+ if (g_dat.smileyAddInstalled && (bRedraw || (lin->ptszText && lin->iType != GC_EVENT_JOIN && lin->iType != GC_EVENT_NICK && lin->iType != GC_EVENT_ADDSTATUS && lin->iType != GC_EVENT_REMOVESTATUS))) {
+ newsel.cpMax = -1;
+ newsel.cpMin = sel.cpMin;
+ if (newsel.cpMin < 0)
+ newsel.cpMin = 0;
+
+ SMADD_RICHEDIT3 sm = { sizeof(sm) };
+ sm.hwndRichEditControl = m_rtf.GetHwnd();
+ sm.Protocolname = si->pszModule;
+ sm.rangeToReplace = bRedraw ? nullptr : &newsel;
+ sm.flags = 0;
+ sm.disableRedraw = TRUE;
+ sm.hContact = m_pDlg.m_hContact;
+ CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm);
+ }
- // do we need to restore the selection
- if (oldsel.cpMax != oldsel.cpMin) {
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&oldsel);
- m_rtf.SetDraw(true);
- InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE);
- }
+ // scroll log to bottom if the log was previously scrolled to bottom, else restore old position
+ if (bRedraw || (UINT)scroll.nPos >= (UINT)scroll.nMax - scroll.nPage - 5 || scroll.nMax - scroll.nMin - scroll.nPage < 50)
+ ScrollToBottom();
+ else
+ m_rtf.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&point);
- // need to invalidate the window
- if (bFlag) {
- sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
- m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
- m_rtf.SetDraw(true);
- InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE);
+ // do we need to restore the selection
+ if (oldsel.cpMax != oldsel.cpMin) {
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&oldsel);
+ m_rtf.SetDraw(true);
+ InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE);
+ }
+
+ // need to invalidate the window
+ if (bFlag) {
+ sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength();
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ m_rtf.SetDraw(true);
+ InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE);
+ }
}
-}
-void CLogWindow::ScrollToBottom()
-{
- if (GetWindowLongPtr(m_rtf.GetHwnd(), GWL_STYLE) & WS_VSCROLL) {
- SCROLLINFO si = { sizeof(si) };
- si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
- if (GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si)) {
- if (m_rtf.GetHwnd() != GetFocus()) {
- si.fMask = SIF_POS;
- si.nPos = si.nMax - si.nPage + 1;
- SetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si, TRUE);
-
- PostMessage(m_rtf.GetHwnd(), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0);
+ void ScrollToBottom() override
+ {
+ if (GetWindowLongPtr(m_rtf.GetHwnd(), GWL_STYLE) & WS_VSCROLL) {
+ SCROLLINFO si = { sizeof(si) };
+ si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
+ if (GetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si)) {
+ if (m_rtf.GetHwnd() != GetFocus()) {
+ si.fMask = SIF_POS;
+ si.nPos = si.nMax - si.nPage + 1;
+ SetScrollInfo(m_rtf.GetHwnd(), SB_VERT, &si, TRUE);
+
+ PostMessage(m_rtf.GetHwnd(), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0);
+ }
}
}
}
-}
-void CLogWindow::UpdateOptions()
-{
- if (m_pDlg.isChat())
- m_rtf.SendMsg(EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground);
- else
- m_rtf.SendMsg(EM_SETBKGNDCOLOR, 0, g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
-
- PARAFORMAT2 pf2;
- memset(&pf2, 0, sizeof(pf2));
- pf2.cbSize = sizeof(pf2);
- pf2.dwMask = PFM_OFFSET;
- pf2.dxOffset = (g_dat.flags.bIndentText) ? g_dat.indentSize * 1440 / g_dat.logPixelSX : 0;
- m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
- m_rtf.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_rtf.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
-
- Clear();
-}
+ void UpdateOptions() override
+ {
+ if (m_pDlg.isChat())
+ m_rtf.SendMsg(EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground);
+ else
+ m_rtf.SendMsg(EM_SETBKGNDCOLOR, 0, g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
+
+ PARAFORMAT2 pf2;
+ memset(&pf2, 0, sizeof(pf2));
+ pf2.cbSize = sizeof(pf2);
+ pf2.dwMask = PFM_OFFSET;
+ pf2.dxOffset = (g_dat.flags.bIndentText) ? g_dat.indentSize * 1440 / g_dat.logPixelSX : 0;
+ m_rtf.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
+ m_rtf.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_rtf.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
+
+ Clear();
+ }
+
+ INT_PTR WndProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ {
+ int result = m_pDlg.InputAreaShortcuts(m_rtf.GetHwnd(), msg, wParam, lParam);
+ if (result != -1)
+ return result;
+
+ switch (msg) {
+ case WM_MEASUREITEM:
+ Menu_MeasureItem(lParam);
+ return TRUE;
+
+ case WM_DRAWITEM:
+ return Menu_DrawItem(lParam);
+
+ case WM_LBUTTONUP:
+ if (g_plugin.bAutoCopy) {
+ CHARRANGE sel;
+ SendMessage(m_rtf.GetHwnd(), EM_EXGETSEL, 0, (LPARAM)&sel);
+ if (sel.cpMin != sel.cpMax) {
+ SendMessage(m_rtf.GetHwnd(), WM_COPY, 0, 0);
+ sel.cpMin = sel.cpMax;
+ SendMessage(m_rtf.GetHwnd(), EM_EXSETSEL, 0, (LPARAM)&sel);
+ }
+ SetFocus(m_pDlg.m_message.GetHwnd());
+ }
+ break;
+ }
+
+ return CSuper::WndProc(msg, wParam, lParam);
+ }
+};
-CSrmmLogWindow *logBuilder(CMsgDialog &pDlg)
+CSrmmLogWindow* logBuilder(CMsgDialog &pDlg)
{
return new CLogWindow(pDlg);
}
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 8ddb352a08..226307dcd2 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -498,7 +498,7 @@ class CLogOptionsDlg : public CBaseOptionDlg
{
CCtrlSpin spinCount, spinTime, spinIndent;
CCtrlCheck chkLoadUnread, chkLoadCount, chkLoadTime;
- CCtrlCheck chkShowIcons, chkShowTime, chkShowSecs, chkShowDate, chkLongDate, chkRelativeDate;
+ CCtrlCheck chkShowIcons, chkShowTime, chkShowSecs, chkShowDate, chkLongDate, chkRelativeDate, chkAutoCopy;
CCtrlCheck chkGroupMsg, chkIndentText, chkHideNames, chkMarkFollowups, chkMsgOnNewline, chkDrawLines;
CCtrlRichEdit m_rtf;
CCtrlHyperlink m_fonts;
@@ -536,21 +536,22 @@ public:
CBaseOptionDlg(IDD_OPT_MSGLOG),
m_rtf(this, IDC_SRMM_LOG),
m_fonts(this, IDC_FONTSCOLORS),
+ chkLoadTime(this, IDC_LOADTIME),
+ chkLoadCount(this, IDC_LOADCOUNT),
+ chkLoadUnread(this, IDC_LOADUNREAD),
chkShowTime(this, IDC_SHOWTIMES),
chkShowSecs(this, IDC_SHOWSECONDS),
chkShowDate(this, IDC_SHOWDATES),
chkLongDate(this, IDC_USELONGDATE),
- chkRelativeDate(this, IDC_USERELATIVEDATE),
+ chkAutoCopy(this, IDC_AUTOCOPY),
chkGroupMsg(this, IDC_GROUPMESSAGES),
- chkMarkFollowups(this, IDC_MARKFOLLOWUPS),
+ chkHideNames(this, IDC_HIDENAMES),
chkDrawLines(this, IDC_DRAWLINES),
chkShowIcons(this, IDC_SHOWLOGICONS),
chkIndentText(this, IDC_INDENTTEXT),
- chkHideNames(this, IDC_HIDENAMES),
+ chkRelativeDate(this, IDC_USERELATIVEDATE),
+ chkMarkFollowups(this, IDC_MARKFOLLOWUPS),
chkMsgOnNewline(this, IDC_MESSAGEONNEWLINE),
- chkLoadTime(this, IDC_LOADTIME),
- chkLoadCount(this, IDC_LOADCOUNT),
- chkLoadUnread(this, IDC_LOADUNREAD),
spinTime(this, IDC_LOADTIMESPIN, 12 * 60),
spinCount(this, IDC_LOADCOUNTSPIN, 100),
spinIndent(this, IDC_INDENTSPIN, 999)
@@ -560,6 +561,7 @@ public:
CreateLink(chkShowTime, g_plugin.bShowTime);
CreateLink(chkShowSecs, g_plugin.bShowSeconds);
CreateLink(chkShowDate, g_plugin.bShowDate);
+ CreateLink(chkAutoCopy, g_plugin.bAutoCopy);
CreateLink(chkLongDate, g_plugin.bLongDate);
CreateLink(chkGroupMsg, g_plugin.bGroupMessages);
CreateLink(chkShowIcons, g_plugin.bShowIcons);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 8302c903ce..498dfe43e3 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -486,9 +486,6 @@ static int OnModulesLoaded(WPARAM, LPARAM)
int OnSystemPreshutdown(WPARAM, LPARAM)
{
- for (auto &it : g_arDialogs.rev_iter())
- it->CloseTab();
-
WindowList_Broadcast(g_dat.hParentWindowList, WM_CLOSE, 0, 0);
return 0;
}
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index 679a0eaa6b..3daa951eea 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -24,28 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SRMM_MSGS_H
/////////////////////////////////////////////////////////////////////////////////////////
-// CLogWindow - built-in log window
-
-class CLogWindow : public CRtfLogWindow
-{
- typedef CRtfLogWindow CSuper;
-
-public:
- CLogWindow(CMsgDialog &pDlg) :
- CSuper(pDlg)
- {
- }
-
- void Attach() override;
- void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override;
- void LogEvents(struct LOGINFO *, bool) override;
- void ScrollToBottom() override;
- void UpdateOptions() override;
-
- INT_PTR WndProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
#define MSGERROR_CANCEL 0
#define MSGERROR_RETRY 1
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h
index 51c25fa42e..888a2f4974 100644
--- a/plugins/Scriver/src/resource.h
+++ b/plugins/Scriver/src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by C:\Users\georg\DiskW\miranda-ng\plugins\Scriver\res\resource.rc
+// Used by W:\miranda-ng\plugins\Scriver\res\resource.rc
//
#define VS_VERSION_INFO 1
#define IDD_MSGWIN 100
@@ -138,6 +138,7 @@
#define IDC_TRANSPARENCYTEXT1 1627
#define IDC_TRANSPARENCYTEXT2 1628
#define IDC_DRAWLINES 1629
+#define IDC_AUTOCOPY 1630
#define IDC_SAVEDRAFTS 1631
#define IDC_POPLIST 1632
#define IDC_LIMITNAMESLEN 1633
diff --git a/plugins/Scriver/src/srmm.cpp b/plugins/Scriver/src/srmm.cpp
index a57dfc860b..242673aefa 100644
--- a/plugins/Scriver/src/srmm.cpp
+++ b/plugins/Scriver/src/srmm.cpp
@@ -47,55 +47,56 @@ PLUGININFOEX pluginInfoEx = {
CMPlugin::CMPlugin() :
PLUGIN<CMPlugin>(SRMM_MODULE, pluginInfoEx),
- bCascade(SRMM_MODULE, "Cascade", 1),
- bAutoMin(SRMM_MODULE, "AutoMin", 0),
- bTopmost(SRMM_MODULE, "Topmost", 0),
- bDelTemp(SRMM_MODULE, "DeleteTempCont", 0),
- bTypingNew(SRMM_MODULE, "DefaultTyping", 1),
- bAutoClose(SRMM_MODULE, "AutoClose", 0),
- bAutoPopup(SRMM_MODULE, "AutoPopupMsg", 0),
- bSaveDrafts(SRMM_MODULE, "SaveDrafts", 0),
- bTypingUnknown(SRMM_MODULE, "UnknownTyping", 0),
- bHideContainer(SRMM_MODULE, "HideContainers", 0),
- bStayMinimized(SRMM_MODULE, "StayMinimized", 0),
- bSavePerContact(SRMM_MODULE, "SavePerContact", 0),
-
- bShowAvatar(SRMM_MODULE, "AvatarEnable", 1),
- bShowProgress(SRMM_MODULE, "ShowProgress", 0),
- bShowIcons(SRMM_MODULE, "ShowLogIcon", 1),
- bShowTime(SRMM_MODULE, "ShowTime", 1),
- bShowSeconds(SRMM_MODULE, "ShowSeconds", 1),
- bShowDate(SRMM_MODULE, "ShowDate", 0),
- bLongDate(SRMM_MODULE, "UseLongDate", 0),
- bRelativeDate(SRMM_MODULE, "UseRelativeDate", 0),
- bDrawLines(SRMM_MODULE, "DrawLines", 0),
- bHideNames(SRMM_MODULE, "HideNames", 1),
- bIndentText(SRMM_MODULE, "IndentText", 0),
- bGroupMessages(SRMM_MODULE, "GroupMessages", 0),
- bMarkFollowups(SRMM_MODULE, "MarkFollowUps", 0),
- bMsgOnNewline(SRMM_MODULE, "MessageOnNewLine", 0),
- bUseTransparency(SRMM_MODULE, "UseTransparency", 0),
-
- bShowToolBar(SRMM_MODULE, "ShowButtonLine", 1),
- bShowInfoBar(SRMM_MODULE, "ShowInfoBar", 1),
- bShowTitleBar(SRMM_MODULE, "ShowTitleBar", 1),
- bShowStatusBar(SRMM_MODULE, "ShowStatusBar", 1),
-
- bUseTabs(SRMM_MODULE, "UseTabs", 1),
- bLimitTabs(SRMM_MODULE, "LimitTabs", 0),
- bLimitChatTabs(SRMM_MODULE, "LimitChatsTabs", 0),
- bLimitNames(SRMM_MODULE, "LimitNamesOnTabs", 1),
- bHideOneTab(SRMM_MODULE, "HideOneTab", 1),
- bTabsAtBottom(SRMM_MODULE, "TabsPosition", 0),
- bSeparateChats(SRMM_MODULE, "SeparateChatsContainers", 0),
- bTabCloseButton(SRMM_MODULE, "TabCloseButton", 0),
- bSwitchToActive(SRMM_MODULE, "SwitchToActiveTab", 0),
-
- bShowTyping(SRMM_MODULE, "ShowTyping", 1),
- bShowTypingWin(SRMM_MODULE, "ShowTypingWin", 1),
- bShowTypingTray(SRMM_MODULE, "ShowTypingTray", 0),
- bShowTypingClist(SRMM_MODULE, "ShowTypingClist", 1),
- bShowTypingSwitch(SRMM_MODULE, "ShowTypingSwitch", 1),
+ bCascade(SRMM_MODULE, "Cascade", true),
+ bAutoMin(SRMM_MODULE, "AutoMin", false),
+ bAutoCopy(SRMM_MODULE, "AutoCopy", true),
+ bTopmost(SRMM_MODULE, "Topmost", false),
+ bDelTemp(SRMM_MODULE, "DeleteTempCont", false),
+ bTypingNew(SRMM_MODULE, "DefaultTyping", true),
+ bAutoClose(SRMM_MODULE, "AutoClose", false),
+ bAutoPopup(SRMM_MODULE, "AutoPopupMsg", false),
+ bSaveDrafts(SRMM_MODULE, "SaveDrafts", false),
+ bTypingUnknown(SRMM_MODULE, "UnknownTyping", false),
+ bHideContainer(SRMM_MODULE, "HideContainers", false),
+ bStayMinimized(SRMM_MODULE, "StayMinimized", false),
+ bSavePerContact(SRMM_MODULE, "SavePerContact", false),
+
+ bShowAvatar(SRMM_MODULE, "AvatarEnable", true),
+ bShowProgress(SRMM_MODULE, "ShowProgress", false),
+ bShowIcons(SRMM_MODULE, "ShowLogIcon", true),
+ bShowTime(SRMM_MODULE, "ShowTime", true),
+ bShowSeconds(SRMM_MODULE, "ShowSeconds", true),
+ bShowDate(SRMM_MODULE, "ShowDate", false),
+ bLongDate(SRMM_MODULE, "UseLongDate", false),
+ bRelativeDate(SRMM_MODULE, "UseRelativeDate", false),
+ bDrawLines(SRMM_MODULE, "DrawLines", false),
+ bHideNames(SRMM_MODULE, "HideNames", true),
+ bIndentText(SRMM_MODULE, "IndentText", false),
+ bGroupMessages(SRMM_MODULE, "GroupMessages", false),
+ bMarkFollowups(SRMM_MODULE, "MarkFollowUps", false),
+ bMsgOnNewline(SRMM_MODULE, "MessageOnNewLine", false),
+ bUseTransparency(SRMM_MODULE, "UseTransparency", false),
+
+ bShowToolBar(SRMM_MODULE, "ShowButtonLine", true),
+ bShowInfoBar(SRMM_MODULE, "ShowInfoBar", true),
+ bShowTitleBar(SRMM_MODULE, "ShowTitleBar", true),
+ bShowStatusBar(SRMM_MODULE, "ShowStatusBar", true),
+
+ bUseTabs(SRMM_MODULE, "UseTabs", true),
+ bLimitTabs(SRMM_MODULE, "LimitTabs", false),
+ bLimitChatTabs(SRMM_MODULE, "LimitChatsTabs", false),
+ bLimitNames(SRMM_MODULE, "LimitNamesOnTabs", true),
+ bHideOneTab(SRMM_MODULE, "HideOneTab", true),
+ bTabsAtBottom(SRMM_MODULE, "TabsPosition", false),
+ bSeparateChats(SRMM_MODULE, "SeparateChatsContainers", false),
+ bTabCloseButton(SRMM_MODULE, "TabCloseButton", false),
+ bSwitchToActive(SRMM_MODULE, "SwitchToActiveTab", false),
+
+ bShowTyping(SRMM_MODULE, "ShowTyping", true),
+ bShowTypingWin(SRMM_MODULE, "ShowTypingWin", true),
+ bShowTypingTray(SRMM_MODULE, "ShowTypingTray", false),
+ bShowTypingClist(SRMM_MODULE, "ShowTypingClist", true),
+ bShowTypingSwitch(SRMM_MODULE, "ShowTypingSwitch", true),
iLimitNames(SRMM_MODULE, "LimitNamesLength", 20),
iLimitTabs(SRMM_MODULE, "LimitTabsNum", 10),
@@ -146,7 +147,9 @@ int CMPlugin::Load()
int CMPlugin::Unload()
{
UnregisterSrmmLog(hLogger);
+
if (pTaskbarInterface)
pTaskbarInterface->Release();
+
return OnUnloadModule();
}
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h
index 7f1fc6a98e..731e44ad23 100644
--- a/plugins/Scriver/src/stdafx.h
+++ b/plugins/Scriver/src/stdafx.h
@@ -72,7 +72,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
HANDLE hLogger;
- CMOption<uint8_t> bSavePerContact, bCascade, bStayMinimized, bAutoMin, bSaveDrafts, bDelTemp, bHideContainer, bAutoPopup;
+ CMOption<uint8_t> bSavePerContact, bCascade, bStayMinimized, bAutoMin, bSaveDrafts, bDelTemp, bHideContainer, bAutoPopup, bAutoCopy;
CMOption<uint8_t> bUseTransparency, bTopmost, bAutoClose, bTypingNew, bTypingUnknown;
CMOption<uint8_t> bShowTitleBar, bShowStatusBar, bShowToolBar, bShowInfoBar;
CMOption<uint8_t> bShowAvatar, bShowProgress, bShowIcons, bShowTime, bShowSeconds, bShowDate, bLongDate, bRelativeDate;
@@ -141,6 +141,5 @@ CSrmmLogWindow *logBuilder(CMsgDialog &pDlg);
#include "chat.h"
extern GlobalMessageData g_dat;
-extern LIST<CMsgDialog> g_arDialogs;
#endif
diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc
index 6da7098b6f..caf2ea092c 100644
--- a/src/core/stdmsg/res/resource.rc
+++ b/src/core/stdmsg/res/resource.rc
@@ -34,10 +34,8 @@ BEGIN
LTEXT "Automatically popup window when:",IDC_STATIC,7,7,141,13
CONTROL "",IDC_POPLIST,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NOHSCROLL | TVS_NONEVENHEIGHT | WS_BORDER | WS_TABSTOP,199,6,98,42
CONTROL "Don't steal focus",IDC_DONOTSTEALFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,21,130,10
-
LTEXT "Maximum number of flashes (0 = indefinite)",IDC_STATIC,7,35,141,8
EDITTEXT IDC_NFLASHES,150,33,25,12,ES_AUTOHSCROLL | ES_NUMBER
-
CONTROL "Close the message window on send",IDC_AUTOCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,50,289,10
CONTROL "Minimize the message window on send",IDC_AUTOMIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,62,289,10
CONTROL "Use the contact's status icon as the window icon",IDC_STATUSWIN,
@@ -51,15 +49,13 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,124,287,10
CONTROL "Enable avatar support in the message window",IDC_AVATARSUPPORT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,137,289,10
-
CONTROL "Limit avatar height to",IDC_LIMITAVATARH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,151,126,10
EDITTEXT IDC_AVATARHEIGHT,150,150,28,13,ES_AUTOHSCROLL
LTEXT "pixels",IDC_STATIC,183,152,35,8
-
CONTROL "Show 'Send' button",IDC_SHOWSENDBTN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,166,135,10
CONTROL "Show character count",IDC_CHARCOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,179,135,10
- CONTROL "Show toolbar buttons on top row",IDC_SHOWBUTTONLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,192,139,10
-
+ CONTROL "Show toolbar buttons on top row",IDC_SHOWBUTTONLINE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,192,139,10
LTEXT "Show warning when message has not been received after",IDC_STATIC,8,208,211,8
EDITTEXT IDC_SECONDS,223,206,25,12,ES_AUTOHSCROLL
LTEXT "seconds",IDC_STATIC,253,208,44,8
@@ -93,27 +89,28 @@ BEGIN
CONTROL "",IDC_AVATAR,"Button",BS_OWNERDRAW | NOT WS_VISIBLE,1,127,6,13
END
-IDD_OPT_MSGLOG DIALOGEX 0, 0, 311, 164
+IDD_OPT_MSGLOG DIALOGEX 0, 0, 311, 171
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Message window event log",IDC_STMSGLOGGROUP,4,5,303,94
- CONTROL "Show icons",IDC_SHOWLOGICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,17,154,10
- CONTROL "Show names",IDC_SHOWNAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,29,154,10
- CONTROL "Show timestamp",IDC_SHOWTIMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,41,154,10
- CONTROL "Show seconds",IDC_SHOWSECS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,53,143,10
- CONTROL "Show dates",IDC_SHOWDATES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,65,143,10
- CONTROL "Show formatting",IDC_SHOWFORMATTING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,77,126,10
- GROUPBOX "Load history events",IDC_STATIC,4,101,303,58
- CONTROL "Load unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,113,138,10
- CONTROL "Load number of previous events",IDC_LOADCOUNT,"Button",BS_AUTORADIOBUTTON,8,125,138,10
- EDITTEXT IDC_LOADCOUNTN,151,124,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
- CONTROL "Spin1",IDC_LOADCOUNTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,174,147,11,14
- CONTROL "Load previous events less than",IDC_LOADTIME,"Button",BS_AUTORADIOBUTTON,8,137,141,10
- EDITTEXT IDC_LOADTIMEN,151,136,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
- CONTROL "Spin1",IDC_LOADTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,174,163,11,14
- LTEXT "minutes old",IDC_STMINSOLD,189,138,82,8,WS_DISABLED
+ GROUPBOX "Message window event log",IDC_STMSGLOGGROUP,4,5,303,101
+ CONTROL "Show icons",IDC_SHOWLOGICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,17,280,10
+ CONTROL "Show names",IDC_SHOWNAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,29,280,10
+ CONTROL "Show timestamp",IDC_SHOWTIMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,41,280,10
+ CONTROL "Show seconds",IDC_SHOWSECS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,53,268,10
+ CONTROL "Show dates",IDC_SHOWDATES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,65,268,10
+ CONTROL "Show formatting",IDC_SHOWFORMATTING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,77,280,10
+ GROUPBOX "Load history events",IDC_STATIC,4,110,303,52
+ CONTROL "Load unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,122,138,10
+ CONTROL "Load number of previous events",IDC_LOADCOUNT,"Button",BS_AUTORADIOBUTTON,8,134,138,10
+ EDITTEXT IDC_LOADCOUNTN,151,133,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
+ CONTROL "Spin1",IDC_LOADCOUNTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,185,132,11,14
+ CONTROL "Load previous events less than",IDC_LOADTIME,"Button",BS_AUTORADIOBUTTON,8,146,141,10
+ EDITTEXT IDC_LOADTIMEN,151,145,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
+ CONTROL "Spin1",IDC_LOADTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,184,144,11,14
+ LTEXT "minutes old",IDC_STMINSOLD,189,147,82,8,WS_DISABLED
+ CONTROL "Automatically copy selected text",IDC_AUTOCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,90,280,10
END
IDD_OPT_TABS DIALOGEX 0, 0, 283, 80
@@ -216,6 +213,7 @@ BEGIN
CONTROL "",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,183,178,11,14
END
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@@ -252,11 +250,7 @@ BEGIN
IDD_OPT_MSGLOG, DIALOG
BEGIN
- VERTGUIDE, 10
- VERTGUIDE, 148
- VERTGUIDE, 156
- VERTGUIDE, 169
- VERTGUIDE, 300
+ BOTTOMMARGIN, 162
END
IDD_OPT_MSGTYPE, DIALOG
@@ -266,22 +260,6 @@ BEGIN
TOPMARGIN, 7
END
- IDD_CHANNEL, DIALOG
- BEGIN
- RIGHTMARGIN, 251
- VERTGUIDE, 8
- VERTGUIDE, 172
- VERTGUIDE, 182
- VERTGUIDE, 237
- HORZGUIDE, 8
- HORZGUIDE, 23
- HORZGUIDE, 70
- HORZGUIDE, 96
- HORZGUIDE, 102
- HORZGUIDE, 108
- HORZGUIDE, 121
- END
-
IDD_CONTAINER, DIALOG
BEGIN
END
@@ -519,6 +497,11 @@ BEGIN
0
END
+IDD_OPT_MSGLOG AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index f97f361bb6..149b4ef18a 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -617,6 +617,18 @@ INT_PTR CLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
+ case WM_LBUTTONUP:
+ if (g_plugin.bAutoCopy) {
+ m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&sel);
+ if (sel.cpMin != sel.cpMax) {
+ m_rtf.SendMsg(WM_COPY, 0, 0);
+ sel.cpMin = sel.cpMax;
+ m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel);
+ }
+ SetFocus(m_pDlg.m_message.GetHwnd());
+ }
+ break;
+
case WM_KEYDOWN:
bool isShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0;
bool isCtrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 2a645aee61..2988457505 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -301,7 +301,7 @@ class COptionLogDlg : public CDlgBase
HBRUSH hBkgColourBrush;
CCtrlCheck chkLoadUnread, chkLoadCount, chkLoadTime, chkDate, chkTime, chkSecs, chkIcons;
- CCtrlCheck chkShowNames, chkFormat;
+ CCtrlCheck chkShowNames, chkFormat, chkAutoCopy;
CCtrlSpin spinCount, spinTime;
public:
@@ -312,6 +312,7 @@ public:
chkTime(this, IDC_SHOWTIMES),
chkIcons(this, IDC_SHOWLOGICONS),
chkFormat(this, IDC_SHOWFORMATTING),
+ chkAutoCopy(this, IDC_AUTOCOPY),
chkLoadTime(this, IDC_LOADTIME),
chkShowNames(this, IDC_SHOWNAMES),
chkLoadCount(this, IDC_LOADCOUNT),
@@ -328,6 +329,7 @@ public:
CreateLink(chkTime, g_plugin.bShowTime);
CreateLink(chkIcons, g_plugin.bShowIcons);
CreateLink(chkFormat, g_plugin.bShowFormat);
+ CreateLink(chkAutoCopy, g_plugin.bAutoCopy);
CreateLink(chkShowNames, g_plugin.bShowNames);
}
diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h
index dd65d2d386..457d5b3e3b 100644
--- a/src/core/stdmsg/src/resource.h
+++ b/src/core/stdmsg/src/resource.h
@@ -53,6 +53,7 @@
#define IDI_INCOMING 276
#define IDI_OUTGOING 277
#define IDI_EXCL 282
+#define IDC_AUTOCOPY 1001
#define IDC_SPLITTERX 1003
#define IDC_AUTOCLOSE 1004
#define IDC_AUTOMIN 1005
@@ -60,7 +61,7 @@
#define IDC_SPLITTERY 1008
#define IDC_CHECKBOXES 1018
#define IDC_NICKLISTBKG 1021
-#define IDC_NICKROW 1024
+#define IDC_NICKROW 1022
#define IDC_LOGLIMIT 1024
#define IDC_NICKROW2 1025
#define IDC_SHOWNAMES 1026
diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp
index 0731ff17ae..f76b4b8c85 100644
--- a/src/core/stdmsg/src/srmm.cpp
+++ b/src/core/stdmsg/src/srmm.cpp
@@ -60,6 +60,7 @@ CMPlugin::CMPlugin() :
bCascade(SRMM_MODULE, "Cascade", true),
bAutoMin(SRMM_MODULE, "AutoMin", false),
+ bAutoCopy(SRMM_MODULE, "AutoCopy", true),
bAutoClose(SRMM_MODULE, "AutoClose", false),
bShowNames(SRMM_MODULE, "ShowNames", false),
bShowFormat(SRMM_MODULE, "ShowFormatting", true),
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index 130dc2e4a3..8e2b93764c 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -156,7 +156,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
CMOption<bool> bShowButtons, bSendButton, bShowTyping, bShowTypingWin, bShowTypingTray, bShowTypingClist;
CMOption<bool> bShowIcons, bShowTime, bShowDate, bShowAvatar, bShowNames, bShowSecs, bShowReadChar;
CMOption<bool> bAutoClose, bAutoMin, bTypingNew, bTypingUnknown, bCtrlSupport, bShowFormat;
- CMOption<bool> bSavePerContact, bDoNotStealFocus, bCascade, bDeleteTempCont, bUseStatusWinIcon;
+ CMOption<bool> bSavePerContact, bDoNotStealFocus, bCascade, bDeleteTempCont, bUseStatusWinIcon, bAutoCopy;
CMOption<bool> bLimitAvatarHeight;
CMOption<uint16_t> iAvatarHeight;