anjuta r3954 - in trunk: . plugins/editor
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r3954 - in trunk: . plugins/editor
- Date: Sun, 25 May 2008 15:46:34 +0000 (UTC)
Author: sgranjoux
Date: Sun May 25 15:46:34 2008
New Revision: 3954
URL: http://svn.gnome.org/viewvc/anjuta?rev=3954&view=rev
Log:
* plugins/editor/text_editor_cbs.c:
Set line to mouse location when popup-menu is displayed (#530689)
Modified:
trunk/ChangeLog
trunk/plugins/editor/text_editor_cbs.c
Modified: trunk/plugins/editor/text_editor_cbs.c
==============================================================================
--- trunk/plugins/editor/text_editor_cbs.c (original)
+++ trunk/plugins/editor/text_editor_cbs.c Sun May 25 15:46:34 2008
@@ -73,14 +73,29 @@
on_text_editor_text_event (GtkWidget * widget,
GdkEvent * event, gpointer user_data)
{
+ TextEditor *te = TEXT_EDITOR (user_data);
GdkEventButton *bevent;
+
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
if (((GdkEventButton *) event)->button != 3)
return FALSE;
+ if (!text_editor_has_selection (te))
+ {
+ /* Move cursor to set breakpoints at correct line (#530689) */
+ glong pos;
+ gint x = (gint)((GdkEventButton *) event)->x;
+ gint y = (gint)((GdkEventButton *) event)->y;
+
+ pos = scintilla_send_message (SCINTILLA (te->scintilla), SCI_POSITIONFROMPOINT, x, y);
+ if (pos >= 0)
+ {
+ scintilla_send_message (SCINTILLA (te->scintilla), SCI_GOTOPOS, pos, 0);
+ }
+ }
bevent = (GdkEventButton *) event;
bevent->button = 1;
- gtk_menu_popup (GTK_MENU (TEXT_EDITOR (user_data)->popup_menu),
+ gtk_menu_popup (GTK_MENU (te->popup_menu),
NULL, NULL, NULL, NULL,
bevent->button, bevent->time);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]