From b9c72b26ddd5d0b68ff3b83218c5e02b31349ba1 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 10 Feb 2003 13:00:34 +0000 Subject: Modified GTK+ version to intercept mouse motion on scrollbars and set cursor to arrow. --- gtk/ScintillaGTK.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gtk') 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( @@ -548,6 +560,12 @@ void ScintillaGTK::Initialise() { static_cast(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() { -- cgit v1.2.3