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));
}
I really have not looked deep into the code to see what the functions do... so no guarantee for whatever...