Commit 8a52fa07 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

Added shortcuts to the File menu.

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

	* src/workbook.c: Added shortcuts to the File menu.

	* src/item-cursor.c (item_cursor_autofill_event): Do not allow
	under-the-base coordinates.

	* src/sheet-autofill.c: Its "january" not "jannuary".

	* src/cell.c (cell_set_text): Enhanced number detection.

	* src/item-cursor.c (item_cursor_drag_event): Handle sheet
	boundaries.

	* src/gnumeric-sheet.c (move_cursor_vertical,
	move_cursor_horizontal): Handle sheet boundaries.

	* src/item-grid.c (item_grid_event): Handle sheet boundaries.

	* src/item-bar.c (item_bar_draw): Handle sheet boundaries.

	* src/pixmaps/bold.xpm:  Oops.  Use the bold icon I created
	yesterday.
parent 7a2e17b5
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c: Added shortcuts to the File menu.
* src/item-cursor.c (item_cursor_autofill_event): Do not allow
under-the-base coordinates.
* src/sheet-autofill.c: Its "january" not "jannuary".
* src/cell.c (cell_set_text): Enhanced number detection.
* src/item-cursor.c (item_cursor_drag_event): Handle sheet
boundaries.
* src/gnumeric-sheet.c (move_cursor_vertical,
move_cursor_horizontal): Handle sheet boundaries.
* src/item-grid.c (item_grid_event): Handle sheet boundaries.
* src/item-bar.c (item_bar_draw): Handle sheet boundaries.
* src/pixmaps/bold.xpm: Oops. Use the bold icon I created
yesterday.
Wed, 23 Sep 1998 12:52:20 +0200 Paolo Molaro <lupus@debian.org>
* src/format.c: added #include <locale.h>
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c: Added shortcuts to the File menu.
* src/item-cursor.c (item_cursor_autofill_event): Do not allow
under-the-base coordinates.
* src/sheet-autofill.c: Its "january" not "jannuary".
* src/cell.c (cell_set_text): Enhanced number detection.
* src/item-cursor.c (item_cursor_drag_event): Handle sheet
boundaries.
* src/gnumeric-sheet.c (move_cursor_vertical,
move_cursor_horizontal): Handle sheet boundaries.
* src/item-grid.c (item_grid_event): Handle sheet boundaries.
* src/item-bar.c (item_bar_draw): Handle sheet boundaries.
* src/pixmaps/bold.xpm: Oops. Use the bold icon I created
yesterday.
Wed, 23 Sep 1998 12:52:20 +0200 Paolo Molaro <lupus@debian.org>
* src/format.c: added #include <locale.h>
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c: Added shortcuts to the File menu.
* src/item-cursor.c (item_cursor_autofill_event): Do not allow
under-the-base coordinates.
* src/sheet-autofill.c: Its "january" not "jannuary".
* src/cell.c (cell_set_text): Enhanced number detection.
* src/item-cursor.c (item_cursor_drag_event): Handle sheet
boundaries.
* src/gnumeric-sheet.c (move_cursor_vertical,
move_cursor_horizontal): Handle sheet boundaries.
* src/item-grid.c (item_grid_event): Handle sheet boundaries.
* src/item-bar.c (item_bar_draw): Handle sheet boundaries.
* src/pixmaps/bold.xpm: Oops. Use the bold icon I created
yesterday.
Wed, 23 Sep 1998 12:52:20 +0200 Paolo Molaro <lupus@debian.org>
* src/format.c: added #include <locale.h>
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/workbook.c: Added shortcuts to the File menu.
* src/item-cursor.c (item_cursor_autofill_event): Do not allow
under-the-base coordinates.
* src/sheet-autofill.c: Its "january" not "jannuary".
* src/cell.c (cell_set_text): Enhanced number detection.
* src/item-cursor.c (item_cursor_drag_event): Handle sheet
boundaries.
* src/gnumeric-sheet.c (move_cursor_vertical,
move_cursor_horizontal): Handle sheet boundaries.
* src/item-grid.c (item_grid_event): Handle sheet boundaries.
* src/item-bar.c (item_bar_draw): Handle sheet boundaries.
* src/pixmaps/bold.xpm: Oops. Use the bold icon I created
yesterday.
Wed, 23 Sep 1998 12:52:20 +0200 Paolo Molaro <lupus@debian.org>
* src/format.c: added #include <locale.h>
......
......@@ -241,13 +241,15 @@ cell_set_text (Cell *cell, char *text)
cell_set_formula (cell, text);
} else {
Value *v = g_new (Value, 1);
int is_text = 0, is_float = 0;
int is_text, is_float, maybe_float, has_digits;
char *p;
is_text = is_float = maybe_float = has_digits = FALSE;
for (p = text; *p && !is_text; p++){
switch (*p){
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
has_digits = TRUE;
break;
case '-':
......@@ -256,16 +258,16 @@ cell_set_text (Cell *cell, char *text)
/* falldown */
case 'E': case 'e': case '+': case ':': case '.':
is_float = 1;
maybe_float = TRUE;
break;
default:
is_text = 1;
is_text = TRUE;
}
}
if (is_text){
v->type = VALUE_STRING;
v->v.str = string_get (text);
} else {
if (has_digits && maybe_float)
is_float = TRUE;
if (has_digits && !is_text){
if (is_float){
v->type = VALUE_FLOAT;
float_get_from_range (text, text+strlen(text),
......@@ -275,6 +277,9 @@ cell_set_text (Cell *cell, char *text)
int_get_from_range (text, text+strlen (text),
&v->v.v_int);
}
} else {
v->type = VALUE_STRING;
v->v.str = string_get (text);
}
cell->value = v;
......
......@@ -192,6 +192,8 @@ move_cursor_horizontal (GnumericSheet *gsheet, int count)
if (new_left < 0)
new_left = 0;
if (new_left > SHEET_MAX_COLS-1)
new_left = SHEET_MAX_COLS-1;
move_cursor (gsheet, new_left, sheet->cursor_row, TRUE);
}
......@@ -213,7 +215,9 @@ move_cursor_vertical (GnumericSheet *gsheet, int count)
if (new_top < 0)
new_top = 0;
if (new_top > SHEET_MAX_ROWS-1)
new_top = SHEET_MAX_ROWS-1;
move_cursor (gsheet, sheet->cursor_col, new_top, TRUE);
}
......
......@@ -192,6 +192,8 @@ move_cursor_horizontal (GnumericSheet *gsheet, int count)
if (new_left < 0)
new_left = 0;
if (new_left > SHEET_MAX_COLS-1)
new_left = SHEET_MAX_COLS-1;
move_cursor (gsheet, new_left, sheet->cursor_row, TRUE);
}
......@@ -213,7 +215,9 @@ move_cursor_vertical (GnumericSheet *gsheet, int count)
if (new_top < 0)
new_top = 0;
if (new_top > SHEET_MAX_ROWS-1)
new_top = SHEET_MAX_ROWS-1;
move_cursor (gsheet, sheet->cursor_col, new_top, TRUE);
}
......
......@@ -177,6 +177,14 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
total = 0;
do {
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL){
if (element >= SHEET_MAX_ROWS){
GtkWidget *canvas = GTK_WIDGET (item->canvas);
gtk_draw_shadow (canvas->style, drawable,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
x, y, width, height);
return;
}
cri = sheet_row_get_info (sheet, element);
if (item_bar->resize_pos == element)
pixels = item_bar->resize_width;
......@@ -191,6 +199,14 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
1 + total + pixels - y);
}
} else {
if (element >= SHEET_MAX_COLS){
GtkWidget *canvas = GTK_WIDGET (item->canvas);
gtk_draw_shadow (canvas->style, drawable,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
x, y, width, height);
return;
}
cri = sheet_col_get_info (sheet, element);
if (item_bar->resize_pos == element)
pixels = item_bar->resize_width;
......
......@@ -318,6 +318,10 @@ item_cursor_set_bounds (ItemCursor *item_cursor, int start_col, int start_row, i
g_return_if_fail (start_col <= end_col);
g_return_if_fail (start_row <= end_row);
g_return_if_fail (item_cursor != NULL);
g_return_if_fail (start_col >= 0);
g_return_if_fail (end_col >= 0);
g_return_if_fail (end_col < SHEET_MAX_COLS);
g_return_if_fail (end_row < SHEET_MAX_ROWS);
g_return_if_fail (IS_ITEM_CURSOR (item_cursor));
item = GNOME_CANVAS_ITEM (item_cursor);
......@@ -623,10 +627,15 @@ item_cursor_drag_event (GnomeCanvasItem *item, GdkEvent *event)
y = 0;
col = item_grid_find_col (item_cursor->item_grid, x, NULL);
row = item_grid_find_row (item_cursor->item_grid, y, NULL);
w = (item_cursor->end_col - item_cursor->start_col);
h = (item_cursor->end_row - item_cursor->start_row);
if (col + w > SHEET_MAX_COLS-1)
return TRUE;
if (row + h > SHEET_MAX_ROWS-1)
return TRUE;
item_cursor_set_bounds_visibly (item_cursor, col, row, col + w, row + h);
return TRUE;
......@@ -681,7 +690,12 @@ item_cursor_autofill_event (GnomeCanvasItem *item, GdkEvent *event)
col = item_grid_find_col (item_cursor->item_grid, x, NULL);
row = item_grid_find_row (item_cursor->item_grid, y, NULL);
if (col < item_cursor->base_col)
col = item_cursor->base_col;
if (row < item_cursor->base_row)
row = item_cursor->base_row;
if ((item_cursor->base_x - x) > (item_cursor->base_y - y)){
item_cursor_set_bounds_visibly (
item_cursor,
......
......@@ -612,6 +612,10 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
col = item_grid_find_col (item_grid, x, NULL);
row = item_grid_find_row (item_grid, y, NULL);
if (col > SHEET_MAX_COLS-1)
col = SHEET_MAX_COLS-1;
if (row > SHEET_MAX_ROWS-1)
row = SHEET_MAX_ROWS-1;
sheet_selection_extend_to (sheet, col, row);
return 1;
}
......
/* XPM */
static char *bold_xpm[] = {
/* width height num_colors chars_per_pixel */
" 20 18 2 1",
/* colors */
". c #303060",
"# c none",
/* pixels */
"####################",
"##########.#########",
"##########.#########",
"#########...########",
"########.....#######",
"########.....#######",
"########.....#######",
"#######..#....######",
"######..###....#####",
"######..###....#####",
"######.####....#####",
"#####....#.#....####",
"####...#.#.#.....###",
"####.########....###",
"###...########...###",
"##....######......##",
"##.##.#######.#.#..#",
"####################"
};
static char * bold_xpm[] = {
"24 24 2 1",
" c None",
". c #000000",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ....... ",
" .. .. ",
" .. .. ",
" .. .. ",
" .. .. ",
" ....... ",
" .. .. ",
" .. .. ",
" .. .. ",
" .. ... ",
" ....... ",
" ",
" ",
" ",
" ",
" ",
" "};
......@@ -573,7 +573,7 @@ sheet_autofill_dir (Sheet *sheet,
}
static char *months [] = {
N_("Jannuary"),
N_("January"),
N_("February"),
N_("March"),
N_("April"),
......
......@@ -319,17 +319,18 @@ about_cmd (GtkWidget *widge, Workbook *wb)
static GnomeUIInfo workbook_menu_file [] = {
{ GNOME_APP_UI_ITEM, N_("_New"), NULL, new_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW },
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, GDK_n, GDK_CONTROL_MASK },
{ GNOME_APP_UI_ITEM, N_("_Open"), NULL, open_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN },
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, GDK_o, GDK_CONTROL_MASK },
{ GNOME_APP_UI_ITEM, N_("_Save"), NULL, save_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, GDK_s, GDK_CONTROL_MASK },
{ GNOME_APP_UI_ITEM, N_("S_ave as..."), NULL, save_as_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE },
{ GNOME_APP_UI_ITEM, N_("_Plugins..."), NULL, plugins_cmd },
{ GNOME_APP_UI_ITEM, N_("_Close"), NULL, close_cmd },
{ GNOME_APP_UI_ITEM, N_("_Close"), NULL, close_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, GDK_w, GDK_CONTROL_MASK },
{ GNOME_APP_UI_ITEM, N_("_Exit"), NULL, quit_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, GDK_q, GDK_CONTROL_MASK },
GNOMEUIINFO_END
};
......
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