Commit 6590a4f1 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Arturo Espinosa

Use gnome_canvas_construct() to initialize the canvas.

1998-07-14  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* src/gnumeric-sheet.c (gnumeric_sheet_create): Use
	gnome_canvas_construct() to initialize the canvas.

	* src/item-bar.c (get_col_name): Fixed generation of column names.
	(get_row_name): Rows are numbered from 1, not 0.  Also, assert
	that the row number is less than 65536.
	(item_bar_event): Grab/ungrab the mouse on button press/release.
	(item_bar_event): On motion_notify, only call set_cursor() if we
	are not resizing.
	(item_bar_event): Only take care of enter_notify events if we are
	not resizing.

	* po/es.po configure.in: Added Spanish translation.
parent a1dec123
1998-07-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_create): Use
gnome_canvas_construct() to initialize the canvas.
* src/item-bar.c (get_col_name): Fixed generation of column names.
(get_row_name): Rows are numbered from 1, not 0. Also, assert
that the row number is less than 65536.
(item_bar_event): Grab/ungrab the mouse on button press/release.
(item_bar_event): On motion_notify, only call set_cursor() if we
are not resizing.
(item_bar_event): Only take care of enter_notify events if we are
not resizing.
* po/es.po configure.in: Added Spanish translation.
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
......
1998-07-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_create): Use
gnome_canvas_construct() to initialize the canvas.
* src/item-bar.c (get_col_name): Fixed generation of column names.
(get_row_name): Rows are numbered from 1, not 0. Also, assert
that the row number is less than 65536.
(item_bar_event): Grab/ungrab the mouse on button press/release.
(item_bar_event): On motion_notify, only call set_cursor() if we
are not resizing.
(item_bar_event): Only take care of enter_notify events if we are
not resizing.
* po/es.po configure.in: Added Spanish translation.
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
......
1998-07-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_create): Use
gnome_canvas_construct() to initialize the canvas.
* src/item-bar.c (get_col_name): Fixed generation of column names.
(get_row_name): Rows are numbered from 1, not 0. Also, assert
that the row number is less than 65536.
(item_bar_event): Grab/ungrab the mouse on button press/release.
(item_bar_event): On motion_notify, only call set_cursor() if we
are not resizing.
(item_bar_event): Only take care of enter_notify events if we are
not resizing.
* po/es.po configure.in: Added Spanish translation.
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
......
1998-07-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* src/gnumeric-sheet.c (gnumeric_sheet_create): Use
gnome_canvas_construct() to initialize the canvas.
* src/item-bar.c (get_col_name): Fixed generation of column names.
(get_row_name): Rows are numbered from 1, not 0. Also, assert
that the row number is less than 65536.
(item_bar_event): Grab/ungrab the mouse on button press/release.
(item_bar_event): On motion_notify, only call set_cursor() if we
are not resizing.
(item_bar_event): Only take care of enter_notify events if we are
not resizing.
* po/es.po configure.in: Added Spanish translation.
1998-07-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/item-bar.c (item_bar_event): Do world->canvas cordinate
......
......@@ -20,7 +20,7 @@ AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
dnl ## internationalization support
ALL_LINGUAS="fr ko"
ALL_LINGUAS="es fr ko"
AM_GNU_GETTEXT
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
......
msgid ""
msgstr ""
"Date: 1998-07-13 22:25:48-0500\n"
"From: Federico Mena Quintero,Pregonero # 53,(525)-643-6634,(525)-643-6634, <federico@casiopea.quartic.org>\n"
"Content-Type: text/plain; charset=\n"
"Xgettext-Options: --default-domain=gnumeric --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n"
"Files: src/main.c src/format.c src/workbook.c\n"
#: src/format.c:30
msgid "Sun"
msgstr "Dom"
#: src/format.c:31
msgid "Mon"
msgstr "Lun"
#: src/format.c:32
msgid "Tue"
msgstr "Mar"
#: src/format.c:33
msgid "Wed"
msgstr "Mi"
#: src/format.c:34
msgid "Thu"
msgstr "Jue"
#: src/format.c:35
msgid "Fri"
msgstr "Vie"
#: src/format.c:36
msgid "Sat"
msgstr "Sb"
#: src/format.c:41
msgid "Sunday"
msgstr "Domingo"
#: src/format.c:42
msgid "Monday"
msgstr "Lunes"
#: src/format.c:43
msgid "Tuesday"
msgstr "Martes"
#: src/format.c:44
msgid "Wednesday"
msgstr "Mircoles"
#: src/format.c:45
msgid "Thursday"
msgstr "Jueves"
#: src/format.c:46
msgid "Friday"
msgstr "Viernes"
#: src/format.c:47
msgid "Saturday"
msgstr "Sbado"
#: src/format.c:52
msgid "Jan"
msgstr "Ene"
#: src/format.c:53
msgid "Feb"
msgstr "Feb"
#: src/format.c:54
msgid "Mar"
msgstr "Mar"
#: src/format.c:55
msgid "Apr"
msgstr "Abr"
#: src/format.c:56 src/format.c:72
msgid "May"
msgstr "May"
#: src/format.c:57
msgid "Jun"
msgstr "Jun"
#: src/format.c:58
msgid "Jul"
msgstr "Jul"
#: src/format.c:59
msgid "Aug"
msgstr "Ago"
#: src/format.c:60
msgid "Sep"
msgstr "Sep"
#: src/format.c:61
msgid "Oct"
msgstr "Oct"
#: src/format.c:62
msgid "Nov"
msgstr "Nov"
#: src/format.c:63
msgid "Dec"
msgstr "Dic"
#: src/format.c:68
msgid "January"
msgstr "Enero"
#: src/format.c:69
msgid "Februrary"
msgstr "Febrero"
#: src/format.c:70
msgid "March"
msgstr "Marzo"
#: src/format.c:71
msgid "April"
msgstr "Abril"
#: src/format.c:73
msgid "June"
msgstr "Junio"
#: src/format.c:74
msgid "July"
msgstr "Julio"
#: src/format.c:75
msgid "August"
msgstr "Agosto"
#: src/format.c:76
msgid "September"
msgstr "Septiembre"
#: src/format.c:77
msgid "October"
msgstr "Octubre"
#: src/format.c:78
msgid "November"
msgstr "Noviembre"
#: src/format.c:79
msgid "December"
msgstr "Diciembre"
#: src/workbook.c:17
msgid "Exit"
msgstr "Salir"
#: src/workbook.c:23
msgid "File"
msgstr "Archivo"
msgid ""
msgstr ""
"Date: 1998-07-13 22:25:48-0500\n"
"From: Federico Mena Quintero,Pregonero # 53,(525)-643-6634,(525)-643-6634, <federico@casiopea.quartic.org>\n"
"Content-Type: text/plain; charset=\n"
"Xgettext-Options: --default-domain=gnumeric --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n"
"Files: src/main.c src/format.c src/workbook.c\n"
#: src/format.c:30
msgid "Sun"
msgstr ""
#: src/format.c:31
msgid "Mon"
msgstr ""
#: src/format.c:32
msgid "Tue"
msgstr ""
#: src/format.c:33
msgid "Wed"
msgstr ""
#: src/format.c:34
msgid "Thu"
msgstr ""
#: src/format.c:35
msgid "Fri"
msgstr ""
#: src/format.c:36
msgid "Sat"
msgstr ""
#: src/format.c:41
msgid "Sunday"
msgstr ""
#: src/format.c:42
msgid "Monday"
msgstr ""
#: src/format.c:43
msgid "Tuesday"
msgstr ""
#: src/format.c:44
msgid "Wednesday"
msgstr ""
#: src/format.c:45
msgid "Thursday"
msgstr ""
#: src/format.c:46
msgid "Friday"
msgstr ""
#: src/format.c:47
msgid "Saturday"
msgstr ""
#: src/format.c:52
msgid "Jan"
msgstr ""
#: src/format.c:53
msgid "Feb"
msgstr ""
#: src/format.c:54
msgid "Mar"
msgstr ""
#: src/format.c:55
msgid "Apr"
msgstr ""
#: src/format.c:56 src/format.c:72
msgid "May"
msgstr ""
#: src/format.c:57
msgid "Jun"
msgstr ""
#: src/format.c:58
msgid "Jul"
msgstr ""
#: src/format.c:59
msgid "Aug"
msgstr ""
#: src/format.c:60
msgid "Sep"
msgstr ""
#: src/format.c:61
msgid "Oct"
msgstr ""
#: src/format.c:62
msgid "Nov"
msgstr ""
#: src/format.c:63
msgid "Dec"
msgstr ""
#: src/format.c:68
msgid "January"
msgstr ""
#: src/format.c:69
msgid "Februrary"
msgstr ""
#: src/format.c:70
msgid "March"
msgstr ""
#: src/format.c:71
msgid "April"
msgstr ""
#: src/format.c:73
msgid "June"
msgstr ""
#: src/format.c:74
msgid "July"
msgstr ""
#: src/format.c:75
msgid "August"
msgstr ""
#: src/format.c:76
msgid "September"
msgstr ""
#: src/format.c:77
msgid "October"
msgstr ""
#: src/format.c:78
msgid "November"
msgstr ""
#: src/format.c:79
msgid "December"
msgstr ""
#: src/workbook.c:17
msgid "Exit"
msgstr ""
#: src/workbook.c:23
msgid "File"
msgstr ""
......@@ -44,10 +44,9 @@ gnumeric_sheet_create (Sheet *sheet, GtkWidget *entry)
gsheet = gtk_type_new (gnumeric_sheet_get_type ());
canvas = GNOME_CANVAS (gsheet);
canvas->visual = gtk_widget_get_default_visual ();
canvas->colormap = gtk_widget_get_default_colormap ();
canvas->cc = gdk_color_context_new (canvas->visual, canvas->colormap);
canvas->root = gnome_canvas_group_new (canvas);
gnome_canvas_construct (canvas,
gtk_widget_get_default_visual (),
gtk_widget_get_default_colormap ());
gsheet->sheet = sheet;
gsheet->top_col = 0;
......
......@@ -44,10 +44,9 @@ gnumeric_sheet_create (Sheet *sheet, GtkWidget *entry)
gsheet = gtk_type_new (gnumeric_sheet_get_type ());
canvas = GNOME_CANVAS (gsheet);
canvas->visual = gtk_widget_get_default_visual ();
canvas->colormap = gtk_widget_get_default_colormap ();
canvas->cc = gdk_color_context_new (canvas->visual, canvas->colormap);
canvas->root = gnome_canvas_group_new (canvas);
gnome_canvas_construct (canvas,
gtk_widget_get_default_visual (),
gtk_widget_get_default_colormap ());
gsheet->sheet = sheet;
gsheet->top_col = 0;
......
......@@ -103,7 +103,9 @@ get_row_name (int n)
{
static char x [32];
sprintf (x, "%d", n);
g_assert (n < 65536);
sprintf (x, "%d", n + 1);
return x;
}
......@@ -114,12 +116,12 @@ get_col_name (int n)
g_assert (n < 256);
if (n < 'z'-'a'){
if (n <= 'z'-'a') {
x [0] = n + 'A';
x [1] = 0;
} else {
x [0] = (n / ('z'-'a')) + 'A';
x [1] = (n % ('z'-'a')) + 'A';
x [0] = (n / ('z'-'a'+1) - 1) + 'A';
x [1] = (n % ('z'-'a'+1)) + 'A';
x [2] = 0;
}
return x;
......@@ -150,7 +152,6 @@ bar_draw_cell (ItemBar *item_bar, GdkDrawable *drawable, ColRowInfo *info, char
gdk_draw_string (drawable, font, item_bar->gc, x1 + ((x2 - x1)-len)/2,
y2 - (y2 - y1)/2 + texth/2 - 1,
str);
}
static void
......@@ -305,15 +306,20 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
GnomeCanvas *canvas = item->canvas;
ItemBar *item_bar = ITEM_BAR (item);
int pos, start, ele, x, y;
int resizing;
resizing = ITEM_BAR_RESIZING (item_bar);
switch (e->type){
case GDK_ENTER_NOTIFY:
convert (canvas, e->crossing.x, e->crossing.y, &x, &y);
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
pos = y;
else
pos = x;
set_cursor (item_bar, pos);
if (!resizing) {
convert (canvas, e->crossing.x, e->crossing.y, &x, &y);
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
pos = y;
else
pos = x;
set_cursor (item_bar, pos);
}
break;
case GDK_MOTION_NOTIFY:
......@@ -324,7 +330,7 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
pos = x;
/* Do column resizing or incremental marking */
if (ITEM_BAR_RESIZING (item_bar)){
if (resizing){
int npos;
npos = pos - item_bar->resize_start_pos;
......@@ -335,8 +341,8 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
0, 0, INT_MAX, INT_MAX);
}
} else {
set_cursor (item_bar, pos);
}
set_cursor (item_bar, pos);
break;
case GDK_BUTTON_PRESS:
......@@ -354,6 +360,12 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
item_bar->resize_width = cri->pixels;
item_bar_start_resize (item_bar, pos);
gdk_pointer_grab (GTK_WIDGET (canvas)->window,
FALSE,
GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
NULL,
NULL,
e->button.time);
} else {
gtk_signal_emit (GTK_OBJECT (item),
item_bar_signals [SELECTION_CHANGED],
......@@ -362,13 +374,14 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
break;
case GDK_BUTTON_RELEASE:
if (ITEM_BAR_RESIZING (item_bar)){
if (resizing){
gtk_signal_emit (GTK_OBJECT (item),
item_bar_signals [SIZE_CHANGED],
item_bar->resize_pos,
item_bar->resize_width);
item_bar->resize_pos = -1;
gtk_object_destroy (item_bar->resize_guide);
gdk_pointer_ungrab (e->button.time);
}
default:
return FALSE;
......@@ -469,6 +482,7 @@ item_bar_class_init (ItemBarClass *item_bar_class)
LAST_SIGNAL);
/* Method overrides */
object_class->destroy = item_bar_destroy;
object_class->set_arg = item_bar_set_arg;
/* GnomeCanvasItem method overrides */
......
......@@ -20,6 +20,8 @@ typedef struct {
int resize_width;
int resize_start_pos;
GtkObject *resize_guide;
int dragging : 1;
} ItemBar;
GtkType item_bar_get_type (void);
......
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