In file included from F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:51:0:
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp: In member function 'bool ScintillaWX::CreateSystemCaret()':
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:737:27: error: 'sci' was not declared in this scope
::ShowCaret(GetHwndOf(sci));
^
F:\wxWidgets-3.0.4\include/wx/msw/private.h:824:42: note: in definition of macro 'GetHwndOf'
#define GetHwndOf(win) ((HWND)((win)->GetHWND()))
^
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp: In member function 'bool ScintillaWX::DestroySystemCaret()':
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:748:31: error: 'sci' was not declared in this scope
::HideCaret(GetHwndOf(sci));
^
F:\wxWidgets-3.0.4\include/wx/msw/private.h:824:42: note: in definition of macro 'GetHwndOf'
#define GetHwndOf(win) ((HWND)((win)->GetHWND()))
[debug]#0 cbEditor::OnScintillaEvent (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3441
[debug]#1 0x035b5a91 in cbEditor::OnEditorModified (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3363
[debug]#2 0x0c454074 in wxAppConsoleBase::HandleEvent (this=0x3187a60, handler=0x1828eb80, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x35b57f4 <cbEditor::OnEditorModified(wxScintillaEvent&)>, event=...) at ../../src/common/appbase.cpp:611
[debug]#3 0x0c4540d0 in wxAppConsoleBase::CallEventHandler (this=0x3187a60, handler=0x1828eb80, functor=..., event=...) at ../../src/common/appbase.cpp:623
[debug]#4 0x0c576f8d in wxEvtHandler::ProcessEventIfMatchesId (entry=..., handler=0x1828eb80, event=...) at ../../src/common/event.cpp:1390
[debug]#5 0x0c577bf8 in wxEvtHandler::SearchDynamicEventTable (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1749
[debug]#6 0x0c57742b in wxEvtHandler::TryHereOnly (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1583
[debug]#7 0x0cd6b70c in wxEvtHandler::TryBeforeAndHere (this=0x1828eb80, event=...) at ../../include/wx/event.h:3671
[debug]#8 0x0c577263 in wxEvtHandler::ProcessEventLocally (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1520
[debug]#9 0x0c577204 in wxEvtHandler::ProcessEvent (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1493
[debug]#10 0x0c7aa42a in wxWindowBase::TryAfter (this=0x201c2120, event=...) at ../../src/common/wincmn.cpp:3427
[debug]#11 0x0c57722f in wxEvtHandler::ProcessEvent (this=0x201c2120, event=...) at ../../src/common/event.cpp:1506
[debug]#12 0x03714135 in wxScintilla::NotifyParent (this=0x201c2120, _scn=0x28db5c) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:5666
[debug]#13 0x0371777d in ScintillaWX::NotifyParent (this=0x204d1ea0, scn=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:498
[debug]#14 0x037d0daa in Editor::NotifyModified (this=0x204d1ea0, mh=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:2706
[debug]#15 0x038130b7 in Document::NotifyModified (this=0x204d2698, mh=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:2331
[debug]#16 0x03812cf6 in Document::DecorationFillRange(int, int, int)@16 (this=0x204d2698, position=39, value=0, fillLength=2101) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:2288
[debug]#17 0x037e609d in Editor::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:7458
[debug]#18 0x037eeb1c in ScintillaBase::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\ScintillaBase.cxx:1086
[debug]#19 0x03718fed in ScintillaWX::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:889
[debug]#20 0x03704e39 in wxScintilla::SendMsg (this=0x201c2120, msg=2505, wp=0, lp=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:260
[debug]#21 0x0370dc2c in wxScintilla::IndicatorClearRange (this=0x201c2120, start=0, lengthClear=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:3800
[debug]#22 0x70a42547 in Highlighter::HighlightOccurrencesOfSelection (this=0x20369c48, ctrl=0x1828eb80) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\highlighter.cpp:314
[debug]#23 0x70a4143b in Highlighter::Call (this=0x20369c48, ctrl=0x1828eb80, event=...) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\highlighter.cpp:54
[debug]#24 0x70a45e57 in OccurrencesHighlighting::OnEditorHook (this=0x18cb41a8, editor=0x1828eb80, event=...) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\occurrenceshighlighting.cpp:352
[debug]#25 0x70a88e10 in EditorHooks::HookFunctor<OccurrencesHighlighting>::Call (this=0x1fe8a860, editor=0x1828eb80, event=...) at include/editor_hooks.h:61
[debug]#26 0x0362567f in EditorHooks::CallHooks (editor=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\editor_hooks.cpp:122
[debug]#27 0x035b648f in cbEditor::OnScintillaEvent (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3464
[debug]#28 0x035b4a4d in cbEditor::OnEditorUpdateUI (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3181
[debug]#29 0x0c454074 in wxAppConsoleBase::HandleEvent (this=0x3187a60, handler=0x1828eb80, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x35b4966 <cbEditor::OnEditorUpdateUI(wxScintillaEvent&)>, event=...) at ../../src/common/appbase.cpp:611
void ScintillaWX::DoRightButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
if (!PointInSelection(pt)) {
CancelModes();
SetEmptySelection(PositionFromLocation(pt));
}
RightButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt));
}
sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
...
case WM_RBUTTONDOWN: {
::SetFocus(MainHWND());
Point pt = Point::FromLong(static_cast<long>(lParam));
if (!PointInSelection(pt)) {
CancelModes();
SetEmptySelection(PositionFromLocation(Point::FromLong(static_cast<long>(lParam))));
}
RightButtonDownWithModifiers(pt, ::GetMessageTime(), ModifierFlags((wParam & MK_SHIFT) != 0,
(wParam & MK_CONTROL) != 0,
Platform::IsKeyDown(VK_MENU)));
}
break;
gint ScintillaGTK::PressThis(GdkEventButton *event) {
....
} else if (event->button == 3) {
if (!PointInSelection(pt))
SetEmptySelection(PositionFromLocation(pt));
if (ShouldDisplayPopup(pt)) {
// PopUp menu
// Convert to screen
int ox = 0;
int oy = 0;
gdk_window_get_origin(PWindow(wMain), &ox, &oy);
ContextMenu(Point(pt.x + ox, pt.y + oy));
} else {
#if PLAT_GTK_MACOSX
bool meta = ctrl;
// GDK reports the Command modifer key as GDK_MOD2_MASK for button events,
// not GDK_META_MASK like in key events.
ctrl = (event->state & GDK_MOD2_MASK) != 0;
#else
bool meta = false;
#endif
RightButtonDownWithModifiers(pt, event->time, ModifierFlags(shift, ctrl, alt, meta));
return FALSE;
}
I'm pretty sure I did this. To the best of my recollection, the right mouse stuff was added in order to be able to handle the new MARGIN_RIGHT_CLICK notification that was added between whatever the previous version of Scintilla was and 3.72.i am really not into the Scintilla code. And i don't know what the MARGIN_RIGHT_CLICK is used for, and if codeblocks uses it. It is quite late now and i wanted to test this so i made this quick and DIRTY patch against the codeblocks code. So far all seems to work as it should.. I can right click without deleting the selection and for this the scrolling works as expected... I can right click and i get all context menus as expected (as far as i was able to test)...
diff --git a/src/sdk/wxscintilla/src/ScintillaWX.cpp b/src/sdk/wxscintilla/src/ScintillaWX.cpp
index 4a56368f1..6ed963fe4 100644
--- a/src/sdk/wxscintilla/src/ScintillaWX.cpp
+++ b/src/sdk/wxscintilla/src/ScintillaWX.cpp
@@ -1069,12 +1069,14 @@ void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, b
}
void ScintillaWX::DoRightButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
+ RightButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt));
+}
+
+void ScintillaWX::DoRightButtonUp(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
if (!PointInSelection(pt)) {
CancelModes();
SetEmptySelection(PositionFromLocation(pt));
}
-
- RightButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt));
}
void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) {
diff --git a/src/sdk/wxscintilla/src/ScintillaWX.h b/src/sdk/wxscintilla/src/ScintillaWX.h
index dae8d453d..ff8a1fd5e 100644
--- a/src/sdk/wxscintilla/src/ScintillaWX.h
+++ b/src/sdk/wxscintilla/src/ScintillaWX.h
@@ -173,6 +173,7 @@ public:
void DoSysColourChange();
void DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
void DoRightButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
+ void DoRightButtonUp(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
void DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl);
void DoLeftButtonMove(Point pt);
void DoMiddleButtonUp(Point pt);
diff --git a/src/sdk/wxscintilla/src/wxscintilla.cpp b/src/sdk/wxscintilla/src/wxscintilla.cpp
index 9c86ae0e5..50ae43d6e 100644
--- a/src/sdk/wxscintilla/src/wxscintilla.cpp
+++ b/src/sdk/wxscintilla/src/wxscintilla.cpp
@@ -5305,6 +5305,8 @@ void wxScintilla::OnMouseLeftUp(wxMouseEvent& evt) {
void wxScintilla::OnMouseRightUp(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition();
+ m_swx->DoRightButtonUp(Point(pt.x, pt.y), m_stopWatch.Time(),
+ evt.ShiftDown(), evt.ControlDown(), evt.AltDown());
m_swx->DoContextMenu(Point(pt.x, pt.y));
}