Commit 1e3d41ad authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

New routine: loads a couple of default fonts to be used in Gnumeric.

1998-10-07  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/style.c (font_init): New routine: loads a couple of default
	fonts to be used in Gnumeric.

	* src/item-bar.c (bar_draw_cell): Make the SELECTION cells display
	with a bold font.
	(item_bar_realize, item_bar_unrealize): reference and unreference
	the gnumeric_default_bold_font.

1998-10-07  Jakub Jelinek  <jj@ultra.linux.cz>

	* src/item-grid.c (item_grid_button_1): Handle shift+click
	on cells (removes last selection and selects from last base
	to current mouse location).
	(item_grid_event): Don't lock up if mouse is moved during
	selection behind left or top margin of sheet canvas (later
	on we should move the current view).

	* src/cell.c (cell_formula_changed): Cast void * to something
	reasonable.

	* src/item-bar.c (draw_bar_cell): Switch from 2 state bars
	to 3 state: whole column/row is selected in one of the current
	selections, some cells are selected in one of the selections
	or nothing is selected. Get rid of ci->selected, compute it
	from the selections.
	(item_bar_draw): Ditto.

	* src/cell.h (selected): Ditto.

	* src/sheet.c (sheet_init_default_styles, sheet_init_dummy_stuff):
	Ditto.
	(sheet_selection_row_extend_to, sheet_selection_col_extend_to):
	Remove.
	(sheet_all_is_selected): True if any of the selections covers whole
	sheet.
	(sheet_col_selection_type, sheet_row_selection_type): New functions.
	(sheet_selection_set): New function.

	* src/sheet-view.c (sheet_view_row_set_selection,
	sheet_view_col_set_selection): Remove.
	(sheet_view_col_selection_changed, sheet_view_row_selection_changed):
	Handle shift+click and ctrl+click on whole columns/bars as well.
	(sheet_view_col_size_changed, sheet_view_row_size_changed): Use
	sheet_*_selection_type instead of ci->selected.

	* src/item-bar.h (ItemBarSelectionType): Enum for the new 3 state
	column/row titles.
	(ItemBarClass): selection_changed takes modifier mask as argument.

	* src/sheet-view.h (sheet_view_*_set_selection): Remove prototypes.

	* src/sheet.h (sheet_selection_*_extend_to): Ditto.
	(sheet_selection_set, sheet_*_selection_type): New prototypes.

1998-10-06  Miguel de Icaza  <miguel@nuclecu.unam.mx>
parent 8b70bde0
1998-10-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (font_init): New routine: loads a couple of default
fonts to be used in Gnumeric.
* src/item-bar.c (bar_draw_cell): Make the SELECTION cells display
with a bold font.
(item_bar_realize, item_bar_unrealize): reference and unreference
the gnumeric_default_bold_font.
1998-10-07 Jakub Jelinek <jj@ultra.linux.cz>
* src/item-grid.c (item_grid_button_1): Handle shift+click
on cells (removes last selection and selects from last base
to current mouse location).
(item_grid_event): Don't lock up if mouse is moved during
selection behind left or top margin of sheet canvas (later
on we should move the current view).
* src/cell.c (cell_formula_changed): Cast void * to something
reasonable.
* src/item-bar.c (draw_bar_cell): Switch from 2 state bars
to 3 state: whole column/row is selected in one of the current
selections, some cells are selected in one of the selections
or nothing is selected. Get rid of ci->selected, compute it
from the selections.
(item_bar_draw): Ditto.
* src/cell.h (selected): Ditto.
* src/sheet.c (sheet_init_default_styles, sheet_init_dummy_stuff):
Ditto.
(sheet_selection_row_extend_to, sheet_selection_col_extend_to):
Remove.
(sheet_all_is_selected): True if any of the selections covers whole
sheet.
(sheet_col_selection_type, sheet_row_selection_type): New functions.
(sheet_selection_set): New function.
* src/sheet-view.c (sheet_view_row_set_selection,
sheet_view_col_set_selection): Remove.
(sheet_view_col_selection_changed, sheet_view_row_selection_changed):
Handle shift+click and ctrl+click on whole columns/bars as well.
(sheet_view_col_size_changed, sheet_view_row_size_changed): Use
sheet_*_selection_type instead of ci->selected.
* src/item-bar.h (ItemBarSelectionType): Enum for the new 3 state
column/row titles.
(ItemBarClass): selection_changed takes modifier mask as argument.
* src/sheet-view.h (sheet_view_*_set_selection): Remove prototypes.
* src/sheet.h (sheet_selection_*_extend_to): Ditto.
(sheet_selection_set, sheet_*_selection_type): New prototypes.
1998-10-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/cell.c (cell_modified): Cells from the clipboard do not have
......
1998-10-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (font_init): New routine: loads a couple of default
fonts to be used in Gnumeric.
* src/item-bar.c (bar_draw_cell): Make the SELECTION cells display
with a bold font.
(item_bar_realize, item_bar_unrealize): reference and unreference
the gnumeric_default_bold_font.
1998-10-07 Jakub Jelinek <jj@ultra.linux.cz>
* src/item-grid.c (item_grid_button_1): Handle shift+click
on cells (removes last selection and selects from last base
to current mouse location).
(item_grid_event): Don't lock up if mouse is moved during
selection behind left or top margin of sheet canvas (later
on we should move the current view).
* src/cell.c (cell_formula_changed): Cast void * to something
reasonable.
* src/item-bar.c (draw_bar_cell): Switch from 2 state bars
to 3 state: whole column/row is selected in one of the current
selections, some cells are selected in one of the selections
or nothing is selected. Get rid of ci->selected, compute it
from the selections.
(item_bar_draw): Ditto.
* src/cell.h (selected): Ditto.
* src/sheet.c (sheet_init_default_styles, sheet_init_dummy_stuff):
Ditto.
(sheet_selection_row_extend_to, sheet_selection_col_extend_to):
Remove.
(sheet_all_is_selected): True if any of the selections covers whole
sheet.
(sheet_col_selection_type, sheet_row_selection_type): New functions.
(sheet_selection_set): New function.
* src/sheet-view.c (sheet_view_row_set_selection,
sheet_view_col_set_selection): Remove.
(sheet_view_col_selection_changed, sheet_view_row_selection_changed):
Handle shift+click and ctrl+click on whole columns/bars as well.
(sheet_view_col_size_changed, sheet_view_row_size_changed): Use
sheet_*_selection_type instead of ci->selected.
* src/item-bar.h (ItemBarSelectionType): Enum for the new 3 state
column/row titles.
(ItemBarClass): selection_changed takes modifier mask as argument.
* src/sheet-view.h (sheet_view_*_set_selection): Remove prototypes.
* src/sheet.h (sheet_selection_*_extend_to): Ditto.
(sheet_selection_set, sheet_*_selection_type): New prototypes.
1998-10-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/cell.c (cell_modified): Cells from the clipboard do not have
......
1998-10-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (font_init): New routine: loads a couple of default
fonts to be used in Gnumeric.
* src/item-bar.c (bar_draw_cell): Make the SELECTION cells display
with a bold font.
(item_bar_realize, item_bar_unrealize): reference and unreference
the gnumeric_default_bold_font.
1998-10-07 Jakub Jelinek <jj@ultra.linux.cz>
* src/item-grid.c (item_grid_button_1): Handle shift+click
on cells (removes last selection and selects from last base
to current mouse location).
(item_grid_event): Don't lock up if mouse is moved during
selection behind left or top margin of sheet canvas (later
on we should move the current view).
* src/cell.c (cell_formula_changed): Cast void * to something
reasonable.
* src/item-bar.c (draw_bar_cell): Switch from 2 state bars
to 3 state: whole column/row is selected in one of the current
selections, some cells are selected in one of the selections
or nothing is selected. Get rid of ci->selected, compute it
from the selections.
(item_bar_draw): Ditto.
* src/cell.h (selected): Ditto.
* src/sheet.c (sheet_init_default_styles, sheet_init_dummy_stuff):
Ditto.
(sheet_selection_row_extend_to, sheet_selection_col_extend_to):
Remove.
(sheet_all_is_selected): True if any of the selections covers whole
sheet.
(sheet_col_selection_type, sheet_row_selection_type): New functions.
(sheet_selection_set): New function.
* src/sheet-view.c (sheet_view_row_set_selection,
sheet_view_col_set_selection): Remove.
(sheet_view_col_selection_changed, sheet_view_row_selection_changed):
Handle shift+click and ctrl+click on whole columns/bars as well.
(sheet_view_col_size_changed, sheet_view_row_size_changed): Use
sheet_*_selection_type instead of ci->selected.
* src/item-bar.h (ItemBarSelectionType): Enum for the new 3 state
column/row titles.
(ItemBarClass): selection_changed takes modifier mask as argument.
* src/sheet-view.h (sheet_view_*_set_selection): Remove prototypes.
* src/sheet.h (sheet_selection_*_extend_to): Ditto.
(sheet_selection_set, sheet_*_selection_type): New prototypes.
1998-10-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/cell.c (cell_modified): Cells from the clipboard do not have
......
1998-10-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/style.c (font_init): New routine: loads a couple of default
fonts to be used in Gnumeric.
* src/item-bar.c (bar_draw_cell): Make the SELECTION cells display
with a bold font.
(item_bar_realize, item_bar_unrealize): reference and unreference
the gnumeric_default_bold_font.
1998-10-07 Jakub Jelinek <jj@ultra.linux.cz>
* src/item-grid.c (item_grid_button_1): Handle shift+click
on cells (removes last selection and selects from last base
to current mouse location).
(item_grid_event): Don't lock up if mouse is moved during
selection behind left or top margin of sheet canvas (later
on we should move the current view).
* src/cell.c (cell_formula_changed): Cast void * to something
reasonable.
* src/item-bar.c (draw_bar_cell): Switch from 2 state bars
to 3 state: whole column/row is selected in one of the current
selections, some cells are selected in one of the selections
or nothing is selected. Get rid of ci->selected, compute it
from the selections.
(item_bar_draw): Ditto.
* src/cell.h (selected): Ditto.
* src/sheet.c (sheet_init_default_styles, sheet_init_dummy_stuff):
Ditto.
(sheet_selection_row_extend_to, sheet_selection_col_extend_to):
Remove.
(sheet_all_is_selected): True if any of the selections covers whole
sheet.
(sheet_col_selection_type, sheet_row_selection_type): New functions.
(sheet_selection_set): New function.
* src/sheet-view.c (sheet_view_row_set_selection,
sheet_view_col_set_selection): Remove.
(sheet_view_col_selection_changed, sheet_view_row_selection_changed):
Handle shift+click and ctrl+click on whole columns/bars as well.
(sheet_view_col_size_changed, sheet_view_row_size_changed): Use
sheet_*_selection_type instead of ci->selected.
* src/item-bar.h (ItemBarSelectionType): Enum for the new 3 state
column/row titles.
(ItemBarClass): selection_changed takes modifier mask as argument.
* src/sheet-view.h (sheet_view_*_set_selection): Remove prototypes.
* src/sheet.h (sheet_selection_*_extend_to): Ditto.
(sheet_selection_set, sheet_*_selection_type): New prototypes.
1998-10-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/cell.c (cell_modified): Cells from the clipboard do not have
......
......@@ -2,7 +2,6 @@
GNOME Spread Sheet task list
* Number formatting
The formatting code should take the current GtkFont for the cell
......
......@@ -26,6 +26,7 @@ dialog_about (void)
"Tom Dyas, Plugin support.",
"Federico Mena, Canvas support.",
"Adrian Likins, Documentation, debugging",
"Jakub Jelinek, Gnumeric hacker",
NULL
};
......
......@@ -13,7 +13,6 @@ typedef struct {
int margin_b; /* in pixels: bottom/right margin */
int pixels; /* we compute this from the above parameters */
unsigned int selected:1; /* is this selected? */
unsigned int hard_size:1; /* has the user explicitly set the dimensions? */
void *data;
} ColRowInfo;
......
......@@ -26,6 +26,7 @@ dialog_about (void)
"Tom Dyas, Plugin support.",
"Federico Mena, Canvas support.",
"Adrian Likins, Documentation, debugging",
"Jakub Jelinek, Gnumeric hacker",
NULL
};
......
......@@ -25,8 +25,6 @@ GdkColor gs_white, gs_black, gs_light_gray, gs_dark_gray, gs_red;
static GnomeCanvasClass *sheet_parent_class;
static void stop_cell_selection (GnumericSheet *gsheet);
static void
gnumeric_sheet_destroy (GtkObject *object)
......@@ -271,7 +269,6 @@ start_cell_selection_at (GnumericSheet *gsheet, int col, int row)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
Sheet *sheet = gsheet->sheet_view->sheet;
g_return_if_fail (gsheet->selecting_cell == FALSE);
......
......@@ -25,8 +25,6 @@ GdkColor gs_white, gs_black, gs_light_gray, gs_dark_gray, gs_red;
static GnomeCanvasClass *sheet_parent_class;
static void stop_cell_selection (GnumericSheet *gsheet);
static void
gnumeric_sheet_destroy (GtkObject *object)
......@@ -271,7 +269,6 @@ start_cell_selection_at (GnumericSheet *gsheet, int col, int row)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
Sheet *sheet = gsheet->sheet_view->sheet;
g_return_if_fail (gsheet->selecting_cell == FALSE);
......
......@@ -76,13 +76,17 @@ item_bar_realize (GnomeCanvasItem *item)
item_bar->change_cursor = gdk_cursor_new (GDK_SB_V_DOUBLE_ARROW);
else
item_bar->change_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
/* Reference the bold font */
style_font_ref (gnumeric_default_bold_font);
}
static void
item_bar_unrealize (GnomeCanvasItem *item)
{
ItemBar *item_bar = ITEM_BAR (item);
style_font_unref (gnumeric_default_bold_font);
gdk_gc_unref (item_bar->gc);
gdk_cursor_destroy (item_bar->change_cursor);
gdk_cursor_destroy (item_bar->normal_cursor);
......@@ -131,7 +135,7 @@ get_col_name (int n)
}
static void
bar_draw_cell (ItemBar *item_bar, GdkDrawable *drawable, int draw_selected, char *str, int x1, int y1, int x2, int y2)
bar_draw_cell (ItemBar *item_bar, GdkDrawable *drawable, ItemBarSelectionType type, char *str, int x1, int y1, int x2, int y2)
{
GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item_bar)->canvas);
GdkFont *font = canvas->style->font;
......@@ -141,12 +145,22 @@ bar_draw_cell (ItemBar *item_bar, GdkDrawable *drawable, int draw_selected, char
len = gdk_string_width (font, str);
texth = font->ascent + font->descent;
if (draw_selected){
shadow = GTK_SHADOW_IN;
gc = canvas->style->dark_gc [GTK_STATE_NORMAL];
} else {
switch (type){
default:
case ITEM_BAR_NO_SELECTION:
shadow = GTK_SHADOW_OUT;
gc = canvas->style->bg_gc [GTK_STATE_ACTIVE];
break;
case ITEM_BAR_PARTIAL_SELECTION:
shadow = GTK_SHADOW_OUT;
gc = canvas->style->bg_gc [GTK_STATE_ACTIVE];
font = gnumeric_default_bold_font->font;
break;
case ITEM_BAR_FULL_SELECTION:
shadow = GTK_SHADOW_IN;
gc = canvas->style->dark_gc [GTK_STATE_NORMAL];
font = gnumeric_default_bold_font->font;
break;
}
gdk_draw_rectangle (drawable, gc, TRUE, x1 + 1, y1 + 1, x2-x1-2, y2-y1-2);
......@@ -164,7 +178,7 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
ItemBar *item_bar = ITEM_BAR (item);
Sheet *sheet = item_bar->sheet_view->sheet;
ColRowInfo *cri;
int element, total, pixels, limit, all_selected;
int element, total, pixels, limit;
char *str;
element = item_bar->first_element;
......@@ -176,11 +190,6 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
total = 0;
if (sheet_is_all_selected (sheet))
all_selected = 1;
else
all_selected = 0;
do {
if (item_bar->orientation == GTK_ORIENTATION_VERTICAL){
......@@ -201,7 +210,7 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
if (total + pixels >= y){
str = get_row_name (element);
bar_draw_cell (item_bar, drawable,
cri->selected | all_selected,
sheet_row_selection_type (sheet, element),
str, -x, 1 + total - y,
item->canvas->width - x,
1 + total + pixels - y);
......@@ -224,7 +233,7 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
if (total + pixels >= x){
str = get_col_name (element);
bar_draw_cell (item_bar, drawable,
cri->selected | all_selected,
sheet_col_selection_type (sheet, element),
str, 1 + total - x, -y,
1 + total + pixels - x,
item->canvas->height - y);
......@@ -443,7 +452,7 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
gtk_signal_emit (
GTK_OBJECT (item),
item_bar_signals [SELECTION_CHANGED],
element, FALSE);
element, 0);
set_cursor (item_bar, pos);
}
......@@ -489,7 +498,7 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
e->button.time);
gtk_signal_emit (GTK_OBJECT (item),
item_bar_signals [SELECTION_CHANGED],
element, TRUE);
element, e->button.state | GDK_BUTTON1_MASK);
}
break;
......
......@@ -7,6 +7,12 @@
#define ITEM_BAR_RESIZING(x) (ITEM_BAR(x)->resize_pos != -1)
typedef enum {
ITEM_BAR_NO_SELECTION,
ITEM_BAR_PARTIAL_SELECTION,
ITEM_BAR_FULL_SELECTION
} ItemBarSelectionType;
typedef struct {
GnomeCanvasItem canvas_item;
SheetView *sheet_view;
......@@ -36,7 +42,7 @@ typedef struct {
GnomeCanvasItemClass parent_class;
/* Signals emited */
void (* selection_changed) (ItemBar *, int column, int reset);
void (* selection_changed) (ItemBar *, int column, int modifiers);
void (* size_changed) (ItemBar *, int column, int new_width);
} ItemBarClass;
......
......@@ -605,12 +605,19 @@ item_grid_button_1 (Sheet *sheet, GdkEvent *event, ItemGrid *item_grid, int col,
*/
sheet_accept_pending_input (sheet);
sheet_cursor_move (sheet, col, row);
if (!(event->button.state & GDK_CONTROL_MASK))
sheet_selection_reset_only (sheet);
if (!(event->button.state & GDK_SHIFT_MASK))
sheet_cursor_move (sheet, col, row);
if (!(event->button.state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)))
sheet_selection_reset_only (sheet);
item_grid->selecting = ITEM_GRID_SELECTING_CELL_RANGE;
sheet_selection_append (sheet, col, row);
if ((event->button.state & GDK_SHIFT_MASK) && sheet->selections)
sheet_selection_extend_to (sheet, col, row);
else
sheet_selection_append (sheet, col, row);
gnome_canvas_item_grab (item,
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK,
......@@ -657,6 +664,10 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_MOTION_NOTIFY:
convert (canvas, event->motion.x, event->motion.y, &x, &y);
if (x < 0 || y < 0)
return 1;
col = item_grid_find_col (item_grid, x, NULL);
row = item_grid_find_row (item_grid, y, NULL);
......@@ -681,9 +692,7 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
sheet_selection_extend_to (sheet, col, row);
return 1;
case GDK_BUTTON_PRESS: {
Cell *cell;
case GDK_BUTTON_PRESS:
sheet_set_mode_type (sheet, SHEET_MODE_SHEET);
convert (canvas, event->button.x, event->button.y, &x, &y);
......@@ -698,8 +707,7 @@ item_grid_event (GnomeCanvasItem *item, GdkEvent *event)
item_grid_popup_menu (item_grid, event, col, row);
return 1;
}
}
default:
return 0;
}
......
......@@ -100,22 +100,6 @@ sheet_view_redraw_cell_region (SheetView *sheet_view, int start_col, int start_r
x+w, y+h);
}
void
sheet_view_row_set_selection (SheetView *sheet_view, ColRowInfo *ri)
{
gnome_canvas_request_redraw (
GNOME_CANVAS (sheet_view->row_canvas),
0, 0, INT_MAX, INT_MAX);
}
void
sheet_view_col_set_selection (SheetView *sheet_view, ColRowInfo *ci)
{
gnome_canvas_request_redraw (
GNOME_CANVAS (sheet_view->col_canvas),
0, 0, INT_MAX, INT_MAX);
}
void
sheet_view_redraw_columns (SheetView *sheet_view)
{
......@@ -219,22 +203,32 @@ sheet_view_size_allocate (GtkWidget *widget, GtkAllocation *alloc, SheetView *sh
}
static void
sheet_view_col_selection_changed (ItemBar *item_bar, int column, int reset, SheetView *sheet_view)
sheet_view_col_selection_changed (ItemBar *item_bar, int column, int modifiers, SheetView *sheet_view)
{
ColRowInfo *ci;
Sheet *sheet = sheet_view->sheet;
if (reset){
sheet_cursor_set (sheet, column, 0, column, SHEET_MAX_ROWS - 1);
sheet_selection_reset_only (sheet);
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
int start_col, end_col;
start_col = MIN (ss->base_col, column);
end_col = MAX (ss->base_col, column);
sheet_selection_set (sheet,
start_col, 0,
end_col, SHEET_MAX_ROWS-1);
return;
}
sheet_cursor_move (sheet, column, 0);
if (!(modifiers & GDK_CONTROL_MASK))
sheet_selection_reset_only (sheet);
sheet_selection_append_range (sheet,
column, 0,
column, 0,
column, SHEET_MAX_ROWS-1);
ci = sheet_col_get (sheet, column);
sheet_col_set_selection (sheet, ci, 1);
} else
sheet_selection_col_extend_to (sheet, column);
sheet_selection_extend_to (sheet, column, SHEET_MAX_ROWS - 1);
}
static void
......@@ -242,54 +236,51 @@ sheet_view_col_size_changed (ItemBar *item_bar, int col, int width, SheetView *s
{
Sheet *sheet = sheet_view->sheet;
GList *l;
gboolean size_change_selected = FALSE;
if (sheet_is_all_selected (sheet))
sheet_col_info_set_width (sheet, &sheet->default_col_style, width);
else {
for (l = sheet->cols_info; l; l = l->next){
ColRowInfo *ci = l->data;
if (ci->selected) {
if (ci->pos == col) {
size_change_selected = TRUE;
break;
}
}
}
if (size_change_selected) {
for (l = sheet->cols_info; l; l = l->next){
ColRowInfo *ci = l->data;
if (ci->selected)
sheet_col_set_width (sheet, ci->pos, width);
}
} else {
sheet_col_set_width (sheet, col, width);
}
}
ItemBarSelectionType type;
type = sheet_col_selection_type (sheet, col);
if (type == ITEM_BAR_FULL_SELECTION)
for (l = sheet->cols_info; l; l = l->next){
ColRowInfo *ci = l->data;
if (sheet_col_selection_type (sheet, ci->pos) == ITEM_BAR_FULL_SELECTION)
sheet_col_set_width (sheet, ci->pos, width);
}
else
sheet_col_set_width (sheet, col, width);
gnumeric_sheet_compute_visible_ranges (GNUMERIC_SHEET (sheet_view->sheet_view));
}
static void
sheet_view_row_selection_changed (ItemBar *item_bar, int row, int reset, SheetView *sheet_view)
sheet_view_row_selection_changed (ItemBar *item_bar, int row, int modifiers, SheetView *sheet_view)
{
ColRowInfo *ri;
Sheet *sheet = sheet_view->sheet;
if (modifiers){
if ((modifiers & GDK_SHIFT_MASK) && sheet->selections){
SheetSelection *ss = sheet->selections->data;
int start_row, end_row;
start_row = MIN (ss->base_row, row);
end_row = MAX (ss->base_row, row);
sheet_selection_set (sheet,
0, start_row,
SHEET_MAX_COLS-1, end_row);
return;
}
sheet_cursor_move (sheet, 0, row);
if (!(modifiers & GDK_CONTROL_MASK))
sheet_selection_reset_only (sheet);
if (reset){
sheet_cursor_set (sheet, 0, row, SHEET_MAX_COLS-1, row);
sheet_selection_reset_only (sheet);
sheet_selection_append_range (sheet,
0, row,
0, row,
SHEET_MAX_COLS-1, row);
ri = sheet_row_get (sheet, row);
sheet_row_set_selection (sheet, ri, 1);
} else
sheet_selection_row_extend_to (sheet, row);
sheet_selection_extend_to (sheet, SHEET_MAX_COLS-1, row);
}
static void
......@@ -297,32 +288,21 @@ sheet_view_row_size_changed (ItemBar *item_bar, int row, int height, SheetView *
{
Sheet *sheet = sheet_view->sheet;
GList *l;
gboolean size_change_selected = FALSE;
if (sheet_is_all_selected (sheet))
sheet_row_info_set_height (sheet, &sheet->default_row_style, height, TRUE);
else {
ItemBarSelectionType type;