My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 22 attachment: ctrl_click_to_middle_mb.patch (2.7 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# HG changeset patch
# User CoDEmanX
# Date 1307696873 -7200
# Node ID 1c81436f13c965bf56adfd6818046393b03b4954
# Parent 1871b7032b286e5fbf1d495b8dec9a7590cb3f51
Select word on Ctrl-Click - changed to middle mouse button click

diff -r 1871b7032b28 -r 1c81436f13c9 pnwtl/textview.cpp
--- a/pnwtl/textview.cpp Fri Jun 10 11:04:03 2011 +0200
+++ b/pnwtl/textview.cpp Fri Jun 10 11:07:53 2011 +0200
@@ -955,7 +955,7 @@
bHandled = true;
HRESULT ret = DefWindowProc(uMsg, wParam, lParam);

- if ((wParam & (MK_CONTROL | MK_SHIFT)) == 0)
+ if ((wParam & (MK_CONTROL | MK_SHIFT | MK_MBUTTON)) == 0)
{
smartHighlight();
}
@@ -963,25 +963,25 @@
return ret;
}

+HRESULT CTextView::OnMButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ long pos = PositionFromPointClose(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+ if(pos < 0)
+ return DefWindowProc(uMsg, wParam, lParam);
+
+ int wordStart = WordStartPosition(pos, true);
+ int wordEnd = WordEndPosition(pos, true);
+
+ SetSelectionStart(wordStart);
+ SetSelectionEnd(wordEnd);
+
+ bHandled = TRUE;
+ return 0;
+}
+
HRESULT CTextView::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
- if(wParam & MK_CONTROL)
- {
- long pos = PositionFromPointClose(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
- if(pos < 0)
- return DefWindowProc(uMsg, wParam, lParam);
-
- int wordStart = WordStartPosition(pos, true);
- int wordEnd = WordEndPosition(pos, true);
-
- SetSelectionStart(wordStart);
- SetSelectionEnd(wordEnd);
-
- bHandled = TRUE;
- return 0;
- }
- else
- return DefWindowProc(uMsg, wParam, lParam);
+ return DefWindowProc(uMsg, wParam, lParam);
}

HRESULT CTextView::OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
diff -r 1871b7032b28 -r 1c81436f13c9 pnwtl/textview.h
--- a/pnwtl/textview.h Fri Jun 10 11:04:03 2011 +0200
+++ b/pnwtl/textview.h Fri Jun 10 11:07:53 2011 +0200
@@ -50,6 +50,7 @@
MESSAGE_HANDLER(WM_VSCROLL, OnVScroll)
MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
+ MESSAGE_HANDLER(WM_MBUTTONDOWN, OnMButtonDown)

COMMAND_ID_HANDLER(ID_EDIT_INDENT, OnIndent)
COMMAND_ID_HANDLER(ID_EDIT_UNINDENT, OnUnindent)
@@ -142,6 +143,7 @@
HRESULT OnVScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
HRESULT OnMouseWheel(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
HRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
+ HRESULT OnMButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);

////////////////////////////////////////////////////////////////
// Command Handlers
Powered by Google Project Hosting