Commit 6c1143a7 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

Compute the day of week. This was done before by localtime, but the new

1998-09-30  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/format.c (split_time): Compute the day of week.  This was
	done before by localtime, but the new code was not doing it (thus,
	format "ddd" always reported "Sun").

	* src/clipboard.c (x_selection_handler): Use the last workbook
	that claimed the selection instead of using the value provided by
	the callback, as gtk_selection_set_owner just ignores who is the
	owner.

	* src/item-edit.c (item_edit_reconfigure): Call reconfigure in parent.

	* src/item-cursor.c (item_cursor_reconfigure): Call reconfigure in parent.
parent d95baa6f
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/format.c (split_time): Compute the day of week. This was
done before by localtime, but the new code was not doing it (thus,
format "ddd" always reported "Sun").
* src/clipboard.c (x_selection_handler): Use the last workbook
that claimed the selection instead of using the value provided by
the callback, as gtk_selection_set_owner just ignores who is the
owner.
* src/item-edit.c (item_edit_reconfigure): Call reconfigure in parent.
* src/item-cursor.c (item_cursor_reconfigure): Call reconfigure in parent.
* src/format.c (append_year): Year 2000 fix :-).
* src/cell.c (cell_set_text_simple): Fix, use localeconv
......
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/format.c (split_time): Compute the day of week. This was
done before by localtime, but the new code was not doing it (thus,
format "ddd" always reported "Sun").
* src/clipboard.c (x_selection_handler): Use the last workbook
that claimed the selection instead of using the value provided by
the callback, as gtk_selection_set_owner just ignores who is the
owner.
* src/item-edit.c (item_edit_reconfigure): Call reconfigure in parent.
* src/item-cursor.c (item_cursor_reconfigure): Call reconfigure in parent.
* src/format.c (append_year): Year 2000 fix :-).
* src/cell.c (cell_set_text_simple): Fix, use localeconv
......
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/format.c (split_time): Compute the day of week. This was
done before by localtime, but the new code was not doing it (thus,
format "ddd" always reported "Sun").
* src/clipboard.c (x_selection_handler): Use the last workbook
that claimed the selection instead of using the value provided by
the callback, as gtk_selection_set_owner just ignores who is the
owner.
* src/item-edit.c (item_edit_reconfigure): Call reconfigure in parent.
* src/item-cursor.c (item_cursor_reconfigure): Call reconfigure in parent.
* src/format.c (append_year): Year 2000 fix :-).
* src/cell.c (cell_set_text_simple): Fix, use localeconv
......
1998-09-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/format.c (split_time): Compute the day of week. This was
done before by localtime, but the new code was not doing it (thus,
format "ddd" always reported "Sun").
* src/clipboard.c (x_selection_handler): Use the last workbook
that claimed the selection instead of using the value provided by
the callback, as gtk_selection_set_owner just ignores who is the
owner.
* src/item-edit.c (item_edit_reconfigure): Call reconfigure in parent.
* src/item-cursor.c (item_cursor_reconfigure): Call reconfigure in parent.
* src/format.c (append_year): Year 2000 fix :-).
* src/cell.c (cell_set_text_simple): Fix, use localeconv
......
......@@ -131,3 +131,12 @@ documentation for these:
- Contorl-Home: move to the cell A1
o Auto-convert-on-input features: When you enter text in Gnumeric
it is now matched against the known formats of Gnumeric and if
possible, converted to a (number, format) pair. This works
when you enter a formula and when you type in text.
This means you can use now dates and times in expressions, like
this: ="10-Jan"+45.
Autofill will also work on this.
......@@ -27,6 +27,8 @@ typedef struct {
int paste_flags;
} clipboard_paste_closure_t;
static Workbook *workbook_with_selection = NULL;
/*
* Pastes a cell in the spreadsheet
*/
......@@ -305,7 +307,7 @@ x_selection_received (GtkWidget *widget, GtkSelectionData *sel, gpointer data)
static void
x_selection_handler (GtkWidget *widget, GtkSelectionData *selection_data, gpointer data)
{
Workbook *wb = data;
Workbook *wb = workbook_with_selection;
char *rendered_selection;
g_assert (wb->clipboard_contents);
......@@ -344,13 +346,13 @@ x_clipboard_bind_workbook (Workbook *wb)
GTK_OBJECT (wb->toplevel), "selection_clear_event",
GTK_SIGNAL_FUNC(x_selection_clear), wb);
gtk_selection_add_handler (
wb->toplevel,
GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING,
x_selection_handler, wb);
gtk_signal_connect (
GTK_OBJECT (wb->toplevel), "selection_received",
GTK_SIGNAL_FUNC(x_selection_received), wb);
gtk_selection_add_handler (
wb->toplevel,
GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING,
x_selection_handler, NULL);
}
/*
......@@ -361,10 +363,13 @@ x_clipboard_bind_workbook (Workbook *wb)
static void
clipboard_export_cell_region (Workbook *wb)
{
workbook_with_selection = wb;
wb->have_x_selection = gtk_selection_owner_set (
current_workbook->toplevel,
GDK_SELECTION_PRIMARY,
GDK_CURRENT_TIME);
}
typedef struct {
......
......@@ -693,6 +693,7 @@ split_time (gdouble number)
/* Day 1 means 1st of jannuary of 1900 */
calc_new_date (&tm.tm_year, &tm.tm_mon, &tm.tm_mday, number-1.0);
tm.tm_wday = day_of_week (tm.tm_year, tm.tm_mon, tm.tm_mday);
/* printf ("Year: %d Month: %d, Day: %d\n", tm.tm_year, tm.tm_mon, tm.tm_mday); */
tm.tm_mon--;
......
......@@ -119,6 +119,8 @@ item_cursor_unrealize (GnomeCanvasItem *item)
static void
item_cursor_reconfigure (GnomeCanvasItem *item)
{
if (GNOME_CANVAS_ITEM_CLASS(item_cursor_parent_class)->reconfigure)
(*GNOME_CANVAS_ITEM_CLASS(item_cursor_parent_class)->reconfigure)(item);
}
/*
......
......@@ -124,6 +124,9 @@ item_edit_reconfigure (GnomeCanvasItem *item)
ItemEdit *item_edit = ITEM_EDIT (item);
int x, y, w, h;
if (GNOME_CANVAS_ITEM_CLASS (item_edit_parent_class)->reconfigure)
(*GNOME_CANVAS_ITEM_CLASS(item_edit_parent_class)->reconfigure)(item);
item_edit_get_pixel_coords (item_edit, &x, &y, &w, &h);
item->x1 = x;
item->y1 = y;
......
......@@ -623,8 +623,11 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
}
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_PRESS: {
Cell *cell;
sheet_set_mode_type (sheet, SHEET_MODE_SHEET);
switch (event->button.button){
case 1:
convert (canvas, event->button.x, event->button.y, &x, &y);
......@@ -641,6 +644,29 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
if (!(event->button.state & GDK_CONTROL_MASK))
sheet_selection_reset_only (sheet);
if ((cell = sheet_cell_get (sheet, col, row)) != NULL){
if (cell->comment || 1){
int xp;
xp = sheet_col_get_distance (
sheet,
item_grid->left_col,
col+1);
if (x > xp - 6){
int yp;
yp = sheet_col_get_distance (
sheet,
item_grid->top_row,
row);
if (y < yp + 6){
printf ("CLICK EN EL COMENTARIO\n");
}
}
}
}
item_grid->selecting = 1;
sheet_selection_append (sheet, col, row);
gnome_canvas_item_grab (item,
......@@ -658,6 +684,8 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
item_grid_popup_menu (item_grid, event, col, row);
return 1;
}
}
default:
return 0;
}
......
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