summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-01-12 18:23:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-01-12 18:23:28 +0300
commit86dd9d64343d699dced924b2d4b18df1c1a0ab73 (patch)
treee5858747aa8950a99b350d05da68ee00c30a38f3 /src
parenta597d2e4ec1083ae1ccf8c11d4bf634e243b7eca (diff)
fixes #3114 completely, even in group chats
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/res/resource.rc18
-rw-r--r--src/mir_app/src/srmm_log_rtf.cpp14
2 files changed, 20 insertions, 12 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc
index d1db48df72..3c07d9ce6f 100644
--- a/src/mir_app/res/resource.rc
+++ b/src/mir_app/res/resource.rc
@@ -1559,20 +1559,20 @@ BEGIN
BEGIN
MENUITEM "Clear lo&g", IDM_CLEAR
MENUITEM SEPARATOR
- MENUITEM "Co&py all", IDM_COPYALL
+ MENUITEM "Copy", IDM_COPY
MENUITEM SEPARATOR
POPUP "Word lookup", GRAYED
BEGIN
- MENUITEM "Google", IDM_SEARCH_GOOGLE
- MENUITEM "Bing", IDM_SEARCH_BING
- MENUITEM "Yandex", IDM_SEARCH_YANDEX
- MENUITEM "Wikipedia (en)", IDM_SEARCH_WIKIPEDIA
+ MENUITEM "Google", IDM_SEARCH_GOOGLE
+ MENUITEM "Bing", IDM_SEARCH_BING
+ MENUITEM "Yandex", IDM_SEARCH_YANDEX
+ MENUITEM "Wikipedia (en)", IDM_SEARCH_WIKIPEDIA
MENUITEM SEPARATOR
- MENUITEM "Google Maps", IDM_SEARCH_GOOGLE_MAPS
- MENUITEM "Google Translate", IDM_SEARCH_GOOGLE_TRANSLATE
+ MENUITEM "Google Maps", IDM_SEARCH_GOOGLE_MAPS
+ MENUITEM "Google Translate", IDM_SEARCH_GOOGLE_TRANSLATE
MENUITEM SEPARATOR
- MENUITEM "Yahoo", IDM_SEARCH_YAHOO
- MENUITEM "Foodnetwork", IDM_SEARCH_FOODNETWORK
+ MENUITEM "Yahoo", IDM_SEARCH_YAHOO
+ MENUITEM "Foodnetwork", IDM_SEARCH_FOODNETWORK
END
END
END
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp
index c6bf86af64..14112511c4 100644
--- a/src/mir_app/src/srmm_log_rtf.cpp
+++ b/src/mir_app/src/srmm_log_rtf.cpp
@@ -276,8 +276,14 @@ INT_PTR CRtfLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
wchar_t *pszWord = (wchar_t *)_alloca(8192);
pszWord[0] = '\0';
+ HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_LOGMENU));
+ HMENU hSubMenu = GetSubMenu(hMenu, 0);
+ TranslateMenu(hSubMenu);
+
// get a word under cursor
if (sel.cpMin == sel.cpMax) {
+ ModifyMenuW(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_STRING, IDM_COPYALL, TranslateT("Copy all"));
+
int iCharIndex = m_rtf.SendMsg(EM_CHARFROMPOS, 0, (LPARAM)&ptl);
if (iCharIndex < 0)
break;
@@ -305,9 +311,6 @@ INT_PTR CRtfLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
}
CHARRANGE all = { 0, -1 };
- HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_LOGMENU));
- HMENU hSubMenu = GetSubMenu(hMenu, 0);
- TranslateMenu(hSubMenu);
m_pDlg.m_bInMenu = true;
int flags = MF_BYPOSITION | (GetRichTextLength(m_rtf.GetHwnd()) == 0 ? MF_GRAYED : MF_ENABLED);
@@ -333,6 +336,11 @@ INT_PTR CRtfLogWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
PostMessage(m_pDlg.m_hwnd, WM_MOUSEACTIVATE, 0, 0);
break;
+ case IDM_COPY:
+ m_rtf.SendMsg(WM_COPY, 0, 0);
+ PostMessage(m_pDlg.m_hwnd, WM_MOUSEACTIVATE, 0, 0);
+ break;
+
case IDM_COPYALL:
m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&sel);
m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&all);