summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-08-10 19:38:06 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-08-10 19:38:06 +0300
commit880a38410ca863c3cfb87d6d87df1d6918b3e3bb (patch)
treea95589ffd8da8c2054e40d220a7e9c93df71c251 /plugins/NewStory/src
parentc7302b54440f8ad5dad2c344436656068291ce32 (diff)
fixes #3613 (NewStory: выделение нескольких сообщений без клавиатуры)
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r--plugins/NewStory/src/history_control.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 329b333920..1b9e61c0af 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -621,7 +621,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VSCROLL);
break;
- // History list control messages
+ // History list control messages
case NSM_ADDEVENTS:
if (auto *p = (ADDEVENTS *)wParam) {
data->items.addEvent(p->hContact, p->hFirstEVent, p->eventCount);
@@ -967,6 +967,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return 0;
}
+ data->selStart = idx;
data->SetSelection(idx, idx);
data->SetCaret(idx);
}
@@ -974,6 +975,13 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetFocus(hwnd);
return 0;
+ case WM_LBUTTONUP:
+ pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ idx = data->GetItemFromPixel(pt.y);
+ if (idx >= 0)
+ data->selStart = -1;
+ break;
+
case WM_LBUTTONDBLCLK:
pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
idx = data->GetItemFromPixel(pt.y);
@@ -1004,6 +1012,9 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (idx >= 0) {
auto *pItem = data->LoadItem(idx);
MTextSendMessage(hwnd, pItem->data, msg, wParam, lParam);
+
+ if (data->selStart != -1)
+ data->SetSelection(data->selStart, idx);
}
break;