aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-02-10 13:00:34 +0000
committernyamatongwe <unknown>2003-02-10 13:00:34 +0000
commit0ad889e0899272ec4a0cd464699a2d24d484bf14 (patch)
tree804df84504e08a2a11a750bde4c49ccf1b5a4ad4
parentc241062b2f54248e413a1f805cd5ec4682b53bb9 (diff)
downloadscintilla-mirror-0ad889e0899272ec4a0cd464699a2d24d484bf14.tar.gz
Modified GTK+ version to intercept mouse motion on scrollbars and set cursor
to arrow.
-rw-r--r--gtk/ScintillaGTK.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 7e93a66b2..bcdf78ca7 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -153,6 +153,9 @@ private:
static gint FocusOut(GtkWidget *widget, GdkEventFocus *event);
static void SizeRequest(GtkWidget *widget, GtkRequisition *requisition);
static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation);
+#if GTK_MAJOR_VERSION >= 2
+ static void ScrollOver(GtkWidget *widget, GdkEventMotion *event);
+#endif
static gint Expose(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis);
static gint ExposeMain(GtkWidget *widget, GdkEventExpose *ose);
static void Draw(GtkWidget *widget, GdkRectangle *area);
@@ -489,6 +492,15 @@ void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
#endif
}
+#if GTK_MAJOR_VERSION >= 2
+void ScintillaGTK::ScrollOver(GtkWidget *widget, GdkEventMotion */*event*/) {
+ // Ensure cursor goes back to arrow over scroll bar.
+ GtkWidget *parent = gtk_widget_get_parent(widget);
+ ScintillaGTK *sciThis = ScintillaFromWidget(parent);
+ sciThis->wMain.SetCursor(Window::cursorArrow);
+}
+#endif
+
void ScintillaGTK::Initialise() {
//Platform::DebugPrintf("ScintillaGTK::Initialise\n");
parentClass = reinterpret_cast<GtkWidgetClass *>(
@@ -548,6 +560,12 @@ void ScintillaGTK::Initialise() {
static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));
SetTicking(true);
+#if GTK_MAJOR_VERSION >= 2
+ gtk_signal_connect(GTK_OBJECT(scrollbarv.GetID()),"motion-notify-event",
+ GTK_SIGNAL_FUNC(ScrollOver), NULL);
+ gtk_signal_connect(GTK_OBJECT(scrollbarh.GetID()),"motion-notify-event",
+ GTK_SIGNAL_FUNC(ScrollOver), NULL);
+#endif
}
void ScintillaGTK::Finalise() {