Commit 687b4ebd authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

WOW. I am amazed. I now gtk grab add and if I receive a widget->window

1999-01-19  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/widget-editable-label.c (el_button_press_event): WOW.  I am
	amazed.  I now gtk grab add and if I receive a widget->window
	different than the canvas, I drop the grab and stop editing.
parent 99dff289
1999-01-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/widget-editable-label.c (el_button_press_event): WOW. I am
amazed. I now gtk grab add and if I receive a widget->window
different than the canvas, I drop the grab and stop editing.
1999-01-19 Francisco Bustamante <pancho@nuclecu.unam.mx>
* src/workbook.c (workbook_delete_event) Return TRUE when the
......
1999-01-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/widget-editable-label.c (el_button_press_event): WOW. I am
amazed. I now gtk grab add and if I receive a widget->window
different than the canvas, I drop the grab and stop editing.
1999-01-19 Francisco Bustamante <pancho@nuclecu.unam.mx>
* src/workbook.c (workbook_delete_event) Return TRUE when the
......
SUBDIRS = intl po macros plugins src
appicondir = $(datadir)/pixmaps
appicon_DATA = gnome-gnumeric.png
EXTRA_DIST = \
gnumeric.desktop README HACKING \
gnumeric.keys.in gnumeric.mime $(appicon_DATA)
dist-hook:
mkdir $(distdir)/samples
cp $(srcdir)/samples/*gnumeric $(distdir)/samples
appicondir = $(datadir)/pixmaps
appicon_DATA = gnome-gnumeric.png
Applicationsdir = $(datadir)/apps/Applications
Applications_DATA = gnumeric.desktop
......@@ -17,7 +13,14 @@ Applications_DATA = gnumeric.desktop
Mimedir = $(datadir)/mime-info
Mime_DATA = gnumeric.keys gnumeric.mime
gnewdir = $(datadir)/mc/templates
gnew_DATA = gnumeric.desktop
gnumeric.keys: gnumeric.keys.in Makefile
sed -e 's^\@icondir\@^$(appicondir)^g' < $(srcdir)/gnumeric.keys.in > gnumeric.keys.tmp \
&& mv gnumeric.keys.tmp gnumeric.keys
dist-hook:
mkdir $(distdir)/samples
cp $(srcdir)/samples/*gnumeric $(distdir)/samples
1999-01-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/widget-editable-label.c (el_button_press_event): WOW. I am
amazed. I now gtk grab add and if I receive a widget->window
different than the canvas, I drop the grab and stop editing.
1999-01-19 Francisco Bustamante <pancho@nuclecu.unam.mx>
* src/workbook.c (workbook_delete_event) Return TRUE when the
......
1999-01-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/widget-editable-label.c (el_button_press_event): WOW. I am
amazed. I now gtk grab add and if I receive a widget->window
different than the canvas, I drop the grab and stop editing.
1999-01-19 Francisco Bustamante <pancho@nuclecu.unam.mx>
* src/workbook.c (workbook_delete_event) Return TRUE when the
......
......@@ -114,6 +114,11 @@ el_edit_sync (El *el)
}
static gint
dumpit (GtkWidget *w, GdkEventButton *ev)
{
}
static void
el_start_editing (El *el, const char *text)
{
......@@ -137,6 +142,8 @@ el_start_editing (El *el, const char *text)
gtk_widget_set_uposition (toplevel, 20000, 20000);
gtk_widget_show_all (toplevel);
gtk_grab_add (GTK_WIDGET (el));
/* gtk_editable_select_region (GTK_EDITABLE (el->entry, 0, -1)); */
/*
......@@ -166,6 +173,7 @@ el_stop_editing (El *el)
el->background = NULL;
}
gtk_grab_remove (GTK_WIDGET (el));
GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (el), GTK_CAN_FOCUS);
}
......@@ -219,7 +227,7 @@ el_size_request (GtkWidget *widget, GtkRequisition *requisition)
/* The widget is realized, and we have a text item inside */
font = widget->style->font;
text = GNOME_CANVAS_TEXT (el->text_item)->text;
requisition->width = gdk_string_measure (font, text) + MARGIN * 2;
requisition->height = font->ascent + font->descent + MARGIN * 2;
}
......@@ -234,6 +242,11 @@ el_button_press_event (GtkWidget *widget, GdkEventButton *button)
if (!el->text)
return FALSE;
if (el->entry && button->window != widget->window){
el_stop_editing (el);
return FALSE;
}
if (button->type == GDK_2BUTTON_PRESS){
char *text = GNOME_CANVAS_TEXT (el->text_item)->text;
......
......@@ -114,6 +114,11 @@ el_edit_sync (El *el)
}
static gint
dumpit (GtkWidget *w, GdkEventButton *ev)
{
}
static void
el_start_editing (El *el, const char *text)
{
......@@ -137,6 +142,8 @@ el_start_editing (El *el, const char *text)
gtk_widget_set_uposition (toplevel, 20000, 20000);
gtk_widget_show_all (toplevel);
gtk_grab_add (GTK_WIDGET (el));
/* gtk_editable_select_region (GTK_EDITABLE (el->entry, 0, -1)); */
/*
......@@ -166,6 +173,7 @@ el_stop_editing (El *el)
el->background = NULL;
}
gtk_grab_remove (GTK_WIDGET (el));
GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (el), GTK_CAN_FOCUS);
}
......@@ -219,7 +227,7 @@ el_size_request (GtkWidget *widget, GtkRequisition *requisition)
/* The widget is realized, and we have a text item inside */
font = widget->style->font;
text = GNOME_CANVAS_TEXT (el->text_item)->text;
requisition->width = gdk_string_measure (font, text) + MARGIN * 2;
requisition->height = font->ascent + font->descent + MARGIN * 2;
}
......@@ -234,6 +242,11 @@ el_button_press_event (GtkWidget *widget, GdkEventButton *button)
if (!el->text)
return FALSE;
if (el->entry && button->window != widget->window){
el_stop_editing (el);
return FALSE;
}
if (button->type == GDK_2BUTTON_PRESS){
char *text = GNOME_CANVAS_TEXT (el->text_item)->text;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment