Commit 771be446 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

- Merge some enhancements to the color combo boxes.

- Simplify and enhance the cursor and selection code.
  Its not as pretty as I'd like, but its getting better.
- Fix a display glitch in the item-bar.  canvas redraw excludes
  the far coordinate.  That will teach me to read docs.

2000-02-18  Jody Goldberg <jgoldberg@home.com>

	* src/widgets/widget-color-combo.c (color_combo_construct) : typo.
	(color_combo_new) : Disable the charting colours for now.  They are
	  mostly duplicates.

2000-02-16 Dom Lachowicz <dominicl@seas.upenn.edu>

	* src/widgets/widget-color-combo.[ch]
	Changed the code some to enable tooltips
	Minor api changes

2000-02-18  Jody Goldberg <jgoldberg@home.com>

	* src/workbook-view.c : Add history.h.

2000-02-18  Jody Goldberg <jgoldberg@home.com>

	* src/sheet.c (sheet_redraw_selection) : Delete.

	* src/selection.c (sheet_selection_extend_to) : Short circuit when
	  there would be no change to the selection.
	(sheet_selection_change) : The sheet already has the correct edit,
	  move, base positions.  Use them.

	* src/sheet-view.c (sheet_view_redraw_headers) : gnome_canvas_request_redraw
	  EXCLUDES the far coordinates.  Add 1 so that the last pixel get
	  redrawn too.

2000-02-18  Jody Goldberg <jgoldberg@home.com>

	* src/history.c (history_menu_item_create) : typo.

2000-02-18  Jody Goldberg <jgoldberg@home.com>

	* src/dialogs/dialog-goal-seek.c (dialog_goal_seek) : Use edit_pos.
	* src/dialogs/dialog-solver.c (dialog_solver) : Ditto.

	* src/xml-io.c (xml_read_selection_info) : Use edit_pos.
	(xml_write_selection_info) : Ditto.

	* src/workbook.c (cb_sheet_check_dirty) : Use edit_pos.
	(paste_cmd) : Ditto.
	(paste_special_cmd) : Ditto.
	(insert_current_date_cmd) : Ditto.
	(insert_current_time_cmd) : Ditto.
	(workbook_edit_comment) : Ditto.

	* src/sheet.c (sheet_new) : sheet_selection_append -> sheet_selection_add.
	(sheet_accept_pending_input) : Use edit_pos.
	(sheet_load_cell_val) : Ditto.
	(sheet_start_editing_at_cursor) : Ditto.
	(sheet_update_controls) : Ditto.
	(sheet_{col,row}_selection_type) : Fix cut-paste-o.
	(walk_boundaries) : Move to selection.c.
	(walk_boundaries_wrapped) : Ditto.
	(sheet_selection_walk_step) : Reworked and moved to selection.c.
	(sheet_cursor_move) : Switch to new framework.
	(sheet_cursor_set) : Ditto.
	(sheet_set_selection) : Delete.

	* src/sheet.h : (SheetSlection) : Remove base member.
	(Sheet) : adjsut notion of cursor to differentiate between,
	edit, base, and movement.  (see comments).
	* src/sheet-view.c (sheet_view_set_zoom_factor) : Use edit_pos.
	(sheet_view_scrollbar_config) : Switch to new scheme.
	(sheet_view_{col,row}_selection_changed) : Make the Top/Left visible
	  cell the edit cursor when things are out of range.

	* src/sheet-style.c (sheet_style_attach) : Use sheet_redraw_range directly.
	(sheet_range_apply_style) : Ditto.
	(sheet_range_set_border) : Ditto.

	* src/selection.c (sheet_selection_add_range) : Renamed from,
	  sheet_selection_append.  Document.  Switch to new edit, base, move
	  scheme.  Directly call sheet_cursor_set rather than the confusingly
	  named sheet_set_selection.
	(sheet_selection_add) : Renamed from sheet_selection_append.
	(sheet_selection_change) : Adjsut parm name from 'new' -> 'new_sel' to
	  enable test compiles from C++.
	(sheet_selection_extend_to) : Switch to new edit, base, move scheme.
	(sheet_selection_extend) : Just call sheet_selection_extend_to for the
	  main work.  Document.
	(sheet_select_all) : sheet_selection_append_range -> sheet_selection_add_range.
	(sheet_selection_extend_{horizontal, vertical} : Merge in to
	  sheet_seletion_extend and fix.
	(sheet_selection_set) : Switch to the new scheme.
	(sheet_selection_reset) : sheet_selection_append -> sheet_selection_add.
	  Use edit_pos.
	(walk_boundaries) : Moved from sheet.c, merged with
	  walk_boundaries_wrap, and change signature.
	(sheet_selection_walk_step) : Moved from sheet.c and switched to the
	  new method.  Do not change the selected region while iterating.

	* src/item-grid.c (item_grid_paint_empty_cell) : Use edit_pos.
	(item_grid_draw_cell) : Ditto.
	(item_grid_event) : Ditto.
	(context_paste_cmd) : Use the base and move cursors.
	(context_paste_special_cmd) : Ditto.
	(item_grid_button_1) : sheet_selection_append -> sheet_selection_add.

	* src/item-cursor.c (item_cursor_autofill_event) : Use
	  sheet_selection_add_range rather than the two step select extend.

	* src/clipboard.c (sheet_paste_selection) : Use
	  sheet_selection_add_range rather than the 2 step process
	  of setting the corner and extending.

	* plugins/excel/ms-excel-read.c (ms_excel_read_selection) :
	    sheet_selection_append_range -> sheet_selection_add_range
	* src/corba-sheet.c (Sheet_selection_append) : Ditto.
	(Sheet_selection_append_range) : Ditto.

	* src/gnumeric-sheet.c (move_cursor) : Ditto.
	(gnumeric_sheet_key_mode_sheet) : Ditto.  Use edit_pos.
          sheet_selection_walk_step now handles the cursor and selection
	  changes.
	(gnumeric_sheet_set_selection) : Delete this was unnecessary.
	(gnumeric_sheet_set_cursor_bounds) : Add preconditions.
	(move_cursor_horizontal) : Use the edit_pos for movement.
	(move_cursor_vertical) : Ditto.
	(gnumeric_sheet_create_editing_cursor) : Ditto.
	(start_cell_selection) : Ditto.
	(move_horizontal_selection) : Use sheet_selection_extend.
	(move_vertical_selection) : Ditto.
	(gnumeric_sheet_compute_visible_ranges) : Force a redraw of the
	  item-cursor when the visible region changes.  FIXME : This should be
	  an update not a redraw.
parent 86a1dc8b
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/widgets/widget-color-combo.c (color_combo_construct) : typo.
(color_combo_new) : Disable the charting colours for now. They are
mostly duplicates.
2000-02-16 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/widgets/widget-color-combo.[ch]
Changed the code some to enable tooltips
Minor api changes
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c : Add history.h.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_redraw_selection) : Delete.
* src/selection.c (sheet_selection_extend_to) : Short circuit when
there would be no change to the selection.
(sheet_selection_change) : The sheet already has the correct edit,
move, base positions. Use them.
* src/sheet-view.c (sheet_view_redraw_headers) : gnome_canvas_request_redraw
EXCLUDES the far coordinates. Add 1 so that the last pixel get
redrawn too.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/history.c (history_menu_item_create) : typo.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-goal-seek.c (dialog_goal_seek) : Use edit_pos.
* src/dialogs/dialog-solver.c (dialog_solver) : Ditto.
* src/xml-io.c (xml_read_selection_info) : Use edit_pos.
(xml_write_selection_info) : Ditto.
* src/workbook.c (cb_sheet_check_dirty) : Use edit_pos.
(paste_cmd) : Ditto.
(paste_special_cmd) : Ditto.
(insert_current_date_cmd) : Ditto.
(insert_current_time_cmd) : Ditto.
(workbook_edit_comment) : Ditto.
* src/sheet.c (sheet_new) : sheet_selection_append -> sheet_selection_add.
(sheet_accept_pending_input) : Use edit_pos.
(sheet_load_cell_val) : Ditto.
(sheet_start_editing_at_cursor) : Ditto.
(sheet_update_controls) : Ditto.
(sheet_{col,row}_selection_type) : Fix cut-paste-o.
(walk_boundaries) : Move to selection.c.
(walk_boundaries_wrapped) : Ditto.
(sheet_selection_walk_step) : Reworked and moved to selection.c.
(sheet_cursor_move) : Switch to new framework.
(sheet_cursor_set) : Ditto.
(sheet_set_selection) : Delete.
* src/sheet.h : (SheetSlection) : Remove base member.
(Sheet) : adjsut notion of cursor to differentiate between,
edit, base, and movement. (see comments).
* src/sheet-view.c (sheet_view_set_zoom_factor) : Use edit_pos.
(sheet_view_scrollbar_config) : Switch to new scheme.
(sheet_view_{col,row}_selection_changed) : Make the Top/Left visible
cell the edit cursor when things are out of range.
* src/sheet-style.c (sheet_style_attach) : Use sheet_redraw_range directly.
(sheet_range_apply_style) : Ditto.
(sheet_range_set_border) : Ditto.
* src/selection.c (sheet_selection_add_range) : Renamed from,
sheet_selection_append. Document. Switch to new edit, base, move
scheme. Directly call sheet_cursor_set rather than the confusingly
named sheet_set_selection.
(sheet_selection_add) : Renamed from sheet_selection_append.
(sheet_selection_change) : Adjsut parm name from 'new' -> 'new_sel' to
enable test compiles from C++.
(sheet_selection_extend_to) : Switch to new edit, base, move scheme.
(sheet_selection_extend) : Just call sheet_selection_extend_to for the
main work. Document.
(sheet_select_all) : sheet_selection_append_range -> sheet_selection_add_range.
(sheet_selection_extend_{horizontal, vertical} : Merge in to
sheet_seletion_extend and fix.
(sheet_selection_set) : Switch to the new scheme.
(sheet_selection_reset) : sheet_selection_append -> sheet_selection_add.
Use edit_pos.
(walk_boundaries) : Moved from sheet.c, merged with
walk_boundaries_wrap, and change signature.
(sheet_selection_walk_step) : Moved from sheet.c and switched to the
new method. Do not change the selected region while iterating.
* src/item-grid.c (item_grid_paint_empty_cell) : Use edit_pos.
(item_grid_draw_cell) : Ditto.
(item_grid_event) : Ditto.
(context_paste_cmd) : Use the base and move cursors.
(context_paste_special_cmd) : Ditto.
(item_grid_button_1) : sheet_selection_append -> sheet_selection_add.
* src/item-cursor.c (item_cursor_autofill_event) : Use
sheet_selection_add_range rather than the two step select extend.
* src/clipboard.c (sheet_paste_selection) : Use
sheet_selection_add_range rather than the 2 step process
of setting the corner and extending.
* plugins/excel/ms-excel-read.c (ms_excel_read_selection) :
sheet_selection_append_range -> sheet_selection_add_range
* src/corba-sheet.c (Sheet_selection_append) : Ditto.
(Sheet_selection_append_range) : Ditto.
* src/gnumeric-sheet.c (move_cursor) : Ditto.
(gnumeric_sheet_key_mode_sheet) : Ditto. Use edit_pos.
sheet_selection_walk_step now handles the cursor and selection
changes.
(gnumeric_sheet_set_selection) : Delete this was unnecessary.
(gnumeric_sheet_set_cursor_bounds) : Add preconditions.
(move_cursor_horizontal) : Use the edit_pos for movement.
(move_cursor_vertical) : Ditto.
(gnumeric_sheet_create_editing_cursor) : Ditto.
(start_cell_selection) : Ditto.
(move_horizontal_selection) : Use sheet_selection_extend.
(move_vertical_selection) : Ditto.
(gnumeric_sheet_compute_visible_ranges) : Force a redraw of the
item-cursor when the visible region changes. FIXME : This should be
an update not a redraw.
2000-02-18 Miguel de Icaza <miguel@gnu.org>
* configure.in (EXTRA_GNOME_CFLAGS): Remove stf plugin from here.
......
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/widgets/widget-color-combo.c (color_combo_construct) : typo.
(color_combo_new) : Disable the charting colours for now. They are
mostly duplicates.
2000-02-16 Dom Lachowicz <dominicl@seas.upenn.edu>
* src/widgets/widget-color-combo.[ch]
Changed the code some to enable tooltips
Minor api changes
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/workbook-view.c : Add history.h.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_redraw_selection) : Delete.
* src/selection.c (sheet_selection_extend_to) : Short circuit when
there would be no change to the selection.
(sheet_selection_change) : The sheet already has the correct edit,
move, base positions. Use them.
* src/sheet-view.c (sheet_view_redraw_headers) : gnome_canvas_request_redraw
EXCLUDES the far coordinates. Add 1 so that the last pixel get
redrawn too.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/history.c (history_menu_item_create) : typo.
2000-02-18 Jody Goldberg <jgoldberg@home.com>
* src/dialogs/dialog-goal-seek.c (dialog_goal_seek) : Use edit_pos.
* src/dialogs/dialog-solver.c (dialog_solver) : Ditto.
* src/xml-io.c (xml_read_selection_info) : Use edit_pos.
(xml_write_selection_info) : Ditto.
* src/workbook.c (cb_sheet_check_dirty) : Use edit_pos.
(paste_cmd) : Ditto.
(paste_special_cmd) : Ditto.
(insert_current_date_cmd) : Ditto.
(insert_current_time_cmd) : Ditto.
(workbook_edit_comment) : Ditto.
* src/sheet.c (sheet_new) : sheet_selection_append -> sheet_selection_add.
(sheet_accept_pending_input) : Use edit_pos.
(sheet_load_cell_val) : Ditto.
(sheet_start_editing_at_cursor) : Ditto.
(sheet_update_controls) : Ditto.
(sheet_{col,row}_selection_type) : Fix cut-paste-o.
(walk_boundaries) : Move to selection.c.
(walk_boundaries_wrapped) : Ditto.
(sheet_selection_walk_step) : Reworked and moved to selection.c.
(sheet_cursor_move) : Switch to new framework.
(sheet_cursor_set) : Ditto.
(sheet_set_selection) : Delete.
* src/sheet.h : (SheetSlection) : Remove base member.
(Sheet) : adjsut notion of cursor to differentiate between,
edit, base, and movement. (see comments).
* src/sheet-view.c (sheet_view_set_zoom_factor) : Use edit_pos.
(sheet_view_scrollbar_config) : Switch to new scheme.
(sheet_view_{col,row}_selection_changed) : Make the Top/Left visible
cell the edit cursor when things are out of range.
* src/sheet-style.c (sheet_style_attach) : Use sheet_redraw_range directly.
(sheet_range_apply_style) : Ditto.
(sheet_range_set_border) : Ditto.
* src/selection.c (sheet_selection_add_range) : Renamed from,
sheet_selection_append. Document. Switch to new edit, base, move
scheme. Directly call sheet_cursor_set rather than the confusingly
named sheet_set_selection.
(sheet_selection_add) : Renamed from sheet_selection_append.
(sheet_selection_change) : Adjsut parm name from 'new' -> 'new_sel' to
enable test compiles from C++.
(sheet_selection_extend_to) : Switch to new edit, base, move scheme.
(sheet_selection_extend) : Just call sheet_selection_extend_to for the
main work. Document.
(sheet_select_all) : sheet_selection_append_range -> sheet_selection_add_range.
(sheet_selection_extend_{horizontal, vertical} : Merge in to
sheet_seletion_extend and fix.
(sheet_selection_set) : Switch to the new scheme.
(sheet_selection_reset) : sheet_selection_append -> sheet_selection_add.
Use edit_pos.
(walk_boundaries) : Moved from sheet.c, merged with
walk_boundaries_wrap, and change signature.
(sheet_selection_walk_step) : Moved from sheet.c and switched to the
new method. Do not change the selected region while iterating.
* src/item-grid.c (item_grid_paint_empty_cell) : Use edit_pos.
(item_grid_draw_cell) : Ditto.
(item_grid_event) : Ditto.
(context_paste_cmd) : Use the base and move cursors.
(context_paste_special_cmd) : Ditto.
(item_grid_button_1) : sheet_selection_append -> sheet_selection_add.
* src/item-cursor.c (item_cursor_autofill_event) : Use
sheet_selection_add_range rather than the two step select extend.
* src/clipboard.c (sheet_paste_selection) : Use
sheet_selection_add_range rather than the 2 step process
of setting the corner and extending.
* plugins/excel/ms-excel-read.c (ms_excel_read_selection) :
sheet_selection_append_range -> sheet_selection_add_range
* src/corba-sheet.c (Sheet_selection_append) : Ditto.
(Sheet_selection_append_range) : Ditto.
* src/gnumeric-sheet.c (move_cursor) : Ditto.
(gnumeric_sheet_key_mode_sheet) : Ditto. Use edit_pos.
sheet_selection_walk_step now handles the cursor and selection
changes.
(gnumeric_sheet_set_selection) : Delete this was unnecessary.
(gnumeric_sheet_set_cursor_bounds) : Add preconditions.
(move_cursor_horizontal) : Use the edit_pos for movement.
(move_cursor_vertical) : Ditto.
(gnumeric_sheet_create_editing_cursor) : Ditto.
(start_cell_selection) : Ditto.
(move_horizontal_selection) : Use sheet_selection_extend.
(move_vertical_selection) : Ditto.
(gnumeric_sheet_compute_visible_ranges) : Force a redraw of the
item-cursor when the visible region changes. FIXME : This should be
an update not a redraw.
2000-02-18 Miguel de Icaza <miguel@gnu.org>
* configure.in (EXTRA_GNOME_CFLAGS): Remove stf plugin from here.
......
......@@ -22,9 +22,9 @@ Description Difficulty Integration
browsing/listing the funtions & I/O routines it
provides.
- Add tooltips for colours in
src/widgets/widget-color-combo.c Low Low.
Have a look at widget-pixmap-combo.c for an example.
- Make the new combo boxes tear-off-able High Low.
- Add 'custom' button to color combo boxes. Low Low.
- Save/Restore the values of the last selected colours Low Low.
from the toolbar for background or font.
......
......@@ -2822,10 +2822,10 @@ ms_excel_read_selection (ExcelSheet *sheet, BiffQuery *q)
#endif
/* FIXME : This should not trigger a recalc */
sheet_selection_append_range (sheet->gnum_sheet,
start_col, start_row,
start_col, start_row,
end_col, end_row);
sheet_selection_add_range (sheet->gnum_sheet,
start_col, start_row,
start_col, start_row,
end_col, end_row);
}
sheet_cursor_set (sheet->gnum_sheet,
act_col, act_row, act_col, act_row, act_col, act_row);
......
......@@ -352,9 +352,12 @@ sheet_paste_selection (CommandContext *context, Sheet *sheet,
pc->dest_col, pc->dest_row,
end_col, end_row);
/* Make the newly pasted region the selection */
sheet_selection_reset_only (pc->dest_sheet);
sheet_selection_append (pc->dest_sheet, pc->dest_col, pc->dest_row);
sheet_selection_extend_to (pc->dest_sheet, end_col, end_row);
sheet_selection_add_range (pc->dest_sheet,
pc->dest_col, pc->dest_row,
pc->dest_col, pc->dest_row,
end_col, end_row);
}
/**
......
......@@ -159,7 +159,7 @@ Sheet_selection_append (PortableServer_Servant servant,
verify_col (col);
verify_row (row);
sheet_selection_append (sheet, col, row);
sheet_selection_add (sheet, col, row);
}
static void
......@@ -172,9 +172,10 @@ Sheet_selection_append_range (PortableServer_Servant servant,
verify_region (start_col, start_row, end_col, end_row);
sheet_selection_append_range (sheet, start_col, start_row,
start_col, start_row,
end_col, end_row);
sheet_selection_add_range (sheet,
start_col, start_row,
start_col, start_row,
end_col, end_row);
}
static void
......
......@@ -37,7 +37,9 @@ static POA_GNOME_Gnumeric_WorkbookFactory__vepv gnumeric_workbook_factory_vepv;
static GNOME_Gnumeric_Workbook
WorkbookFactory_read (PortableServer_Servant servant, const CORBA_char * filename, CORBA_Environment * ev)
{
Workbook *workbook = workbook_read (command_context_corba (workbook), filename);
Workbook *workbook = workbook_read (
command_context_corba (
), filename);
gtk_widget_show (workbook->toplevel);
if (workbook)
......
......@@ -257,5 +257,3 @@ command_context_corba (Workbook *wb)
{
return wb->priv->corba_context;
}
......@@ -3,6 +3,8 @@
*
* Author:
* Miguel de Icaza (miguel@kernel.org)
* Tooltip support:
* Dom Lachowicz (dominicl@seas.upenn.edu)
*/
#include <config.h>
#include <gnome.h>
......@@ -116,14 +118,14 @@ color_clicked (GtkWidget *button, ColorCombo *combo)
}
static GtkWidget *
color_table_setup (ColorCombo *cc, char const * const no_color_label, int ncols, int nrows, char **color_names)
color_table_setup (ColorCombo *cc, char const * const no_color_label, int ncols, int nrows, ColorNamePair *color_names)
{
GtkWidget *label;
GtkWidget *table;
int total, row, col;
table = gtk_table_new (ncols, nrows, 0);
if (no_color_label != NULL) {
label = gtk_button_new_with_label (no_color_label);
......@@ -136,11 +138,12 @@ color_table_setup (ColorCombo *cc, char const * const no_color_label, int ncols,
for (col = 0; col < ncols; col++){
GtkWidget *button;
GtkWidget *canvas;
GtkTooltips *tool_tip;
int pos;
pos = row * ncols + col;
if (color_names [pos] == NULL) {
if (color_names [pos].color == NULL) {
/* Break out of two for-loops. */
row = nrows;
break;
......@@ -165,9 +168,13 @@ color_table_setup (ColorCombo *cc, char const * const no_color_label, int ncols,
"y1", 0.0,
"x2", (double) COLOR_PREVIEW_WIDTH,
"y2", (double) COLOR_PREVIEW_HEIGHT,
"fill_color", color_names [pos],
"fill_color", color_names [pos].color,
NULL);
tool_tip = gtk_tooltips_new();
gtk_tooltips_set_tip (tool_tip, button, _(color_names [pos].name),
"Private+Unused");
gtk_table_attach (GTK_TABLE (table), button,
col, col+1, row+1, row+2, GTK_FILL, GTK_FILL, 1, 1);
......@@ -203,9 +210,9 @@ emit_change (GtkWidget *button, ColorCombo *cc)
}
void
color_combo_construct (ColorCombo *cc, char **icon,
char const * const no_color_label,
int ncols, int nrows, char **color_names)
color_combo_construct (ColorCombo *cc, char **icon,
char const * const no_color_label,
int ncols, int nrows, ColorNamePair *color_names)
{
GdkImlibImage *image;
......@@ -218,8 +225,7 @@ color_combo_construct (ColorCombo *cc, char **icon,
*/
cc->preview_button = gtk_button_new ();
if (!gnome_preferences_get_toolbar_relief_btn ())
gtk_button_set_relief (GTK_BUTTON (cc->preview_button), GTK_RELIEF_NONE);
gtk_button_set_relief (GTK_BUTTON (cc->preview_button), GTK_RELIEF_NONE);
gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
cc->preview_canvas = GNOME_CANVAS (gnome_canvas_new ());
......@@ -248,7 +254,7 @@ color_combo_construct (ColorCombo *cc, char **icon,
"y1", 19.0,
"x2", 20.0,
"y2", 22.0,
"fill_color", color_names [0],
"fill_color", color_names [0].color,
NULL);
gtk_container_add (GTK_CONTAINER (cc->preview_button), GTK_WIDGET (cc->preview_canvas));
gtk_widget_set_usize (GTK_WIDGET (cc->preview_canvas), 24, 24);
......@@ -266,13 +272,14 @@ color_combo_construct (ColorCombo *cc, char **icon,
cc->preview_button,
cc->color_table);
if (!gnome_preferences_get_toolbar_relief_btn ())
gtk_combo_box_set_arrow_relief (GTK_COMBO_BOX (cc), GTK_RELIEF_NONE);
gtk_combo_box_set_arrow_relief (GTK_COMBO_BOX (cc), GTK_RELIEF_NONE);
}
GtkWidget *
color_combo_new_with_vals (char **icon, char const * const no_color_label,
int ncols, int nrows, char **color_names)
int ncols, int nrows, ColorNamePair *color_names)
{
ColorCombo *cc;
......@@ -289,76 +296,78 @@ color_combo_new_with_vals (char **icon, char const * const no_color_label,
/*
* this list of colors should match the Excel 2000 list of colors
*/
static char *default_colors [] = {
"rgb:0/0/0", /* black */
"rgb:99/33/0", /* light brown */
"rgb:33/33/0", /* brown gold */
"rgb:0/33/0", /* dark green #2 */
"rgb:0/33/66", /* navy */
"rgb:0/0/80", /* dark blue */
"rgb:33/33/99", /* purple #2 */
"rgb:33/33/33", /* very dark gray */
"rgb:80/0/0", /* dark red */
"rgb:FF/66/0", /* red-orange */
"rgb:80/80/0", /* gold */
"rgb:0/80/0", /* dark green */
"rgb:0/80/80", /* dull blue */
"rgb:0/0/FF", /* blue */
"rgb:66/66/99", /* dull purple */
"rgb:80/80/80", /* dark grey */
"rgb:FF/0/0", /* red */
"rgb:FF/99/0", /* orange */
"rgb:99/CC/0", /* lime */
"rgb:33/99/66", /* dull green */
"rgb:33/CC/CC",/* dull blue #2 */
"rgb:33/66/FF", /* sky blue #2 */
"rgb:80/0/80", /* purple */
"rgb:96/96/96", /* gray */
"rgb:FF/0/FF", /* magenta */
"rgb:FF/CC/0", /* bright orange */
"rgb:FF/FF/0", /* yellow */
"rgb:0/FF/0", /* green */
"rgb:0/FF/FF", /* cyan */
"rgb:0/CC/FF", /* bright blue */
"rgb:99/33/66", /* red purple */
"rgb:c0/c0/c0", /* light grey */
"rgb:FF/99/CC", /* pink */
"rgb:FF/CC/99", /* light orange */
"rgb:FF/FF/99", /* light yellow */
"rgb:CC/FF/CC", /* light green */
"rgb:CC/FF/FF", /* light cyan */
"rgb:99/CC/FF", /* light blue */
"rgb:CC/99/FF", /* light purple */
"rgb:FF/FF/FF", /* white */
"rgb:99/99/FF", /* purplish blue */
"rgb:99/33/66", /* red purple */
"rgb:FF/FF/CC", /* light yellow */
"rgb:CC/FF/FF", /* light blue */
"rgb:66/0/66", /* dark purple */
"rgb:FF/80/80", /* pink */
"rgb:0/66/CC", /* sky blue */
"rgb:CC/CC/FF", /* light purple */
"rgb:0/0/80", /* dark blue */
"rgb:FF/0/FF", /* magenta */
"rgb:FF/FF/0", /* yellow */
"rgb:0/FF/FF", /* cyan */
"rgb:80/0/80", /* purple */
"rgb:80/0/0", /* dark red */
"rgb:0/80/80", /* dull blue */
"rgb:0/0/FF", /* blue */
NULL
static ColorNamePair default_colors [] = {
{"rgb:0/0/0", N_("black")},
{"rgb:99/33/0", N_("light brown")},
{"rgb:33/33/0", N_("brown gold")},
{"rgb:0/33/0", N_("dark green #2")},
{"rgb:0/33/66", N_("navy")},
{"rgb:0/0/80", N_("dark blue")},
{"rgb:33/33/99", N_("purple #2")},
{"rgb:33/33/33", N_("very dark gray")},
{"rgb:80/0/0", N_("dark red")},
{"rgb:FF/66/0", N_("red-orange")},
{"rgb:80/80/0", N_("gold")},
{"rgb:0/80/0", N_("dark green")},
{"rgb:0/80/80", N_("dull blue")},
{"rgb:0/0/FF", N_("blue")},
{"rgb:66/66/99", N_("dull purple")},
{"rgb:80/80/80", N_("dark grey")},
{"rgb:FF/0/0", N_("red")},
{"rgb:FF/99/0", N_("orange")},
{"rgb:99/CC/0", N_("lime")},
{"rgb:33/99/66", N_("dull green")},
{"rgb:33/CC/CC",N_("dull blue #2")},
{"rgb:33/66/FF", N_("sky blue #2")},
{"rgb:80/0/80", N_("purple")},
{"rgb:96/96/96", N_("gray")},
{"rgb:FF/0/FF", N_("magenta")},
{"rgb:FF/CC/0", N_("bright orange")},
{"rgb:FF/FF/0", N_("yellow")},
{"rgb:0/FF/0", N_("green")},
{"rgb:0/FF/FF", N_("cyan")},
{"rgb:0/CC/FF", N_("bright blue")},
{"rgb:99/33/66", N_("red purple")},
{"rgb:c0/c0/c0", N_("light grey")},
{"rgb:FF/99/CC", N_("pink")},
{"rgb:FF/CC/99", N_("light orange")},
{"rgb:FF/FF/99", N_("light yellow")},
{"rgb:CC/FF/CC", N_("light green")},
{"rgb:CC/FF/FF", N_("light cyan")},
{"rgb:99/CC/FF", N_("light blue")},
{"rgb:CC/99/FF", N_("light purple")},
{"rgb:FF/FF/FF", N_("white")},
/* Disable these for now, they are mostly repeats */
{NULL, NULL},
{"rgb:99/99/FF", N_("purplish blue")},
{"rgb:99/33/66", N_("red purple")},
{"rgb:FF/FF/CC", N_("light yellow")},
{"rgb:CC/FF/FF", N_("light blue")},
{"rgb:66/0/66", N_("dark purple")},
{"rgb:FF/80/80", N_("pink")},
{"rgb:0/66/CC", N_("sky blue")},
{"rgb:CC/CC/FF", N_("light purple")},
{"rgb:0/0/80", N_("dark blue")},
{"rgb:FF/0/FF", N_("magenta")},
{"rgb:FF/FF/0", N_("yellow")},
{"rgb:0/FF/FF", N_("cyan")},
{"rgb:80/0/80", N_("purple")},
{"rgb:80/0/0", N_("dark red")},
{"rgb:0/80/80", N_("dull blue")},
{"rgb:0/0/FF", N_("blue")},
{NULL, NULL}
};
GtkWidget *
......
......@@ -37,14 +37,20 @@ typedef struct {
int last_index;
} ColorCombo;
typedef struct {
char *color; /* rgb color or otherwise - eg. "rgb:FF/FF/FF" */
char *name; /* english name - eg. "white" */
} ColorNamePair;
GtkType color_combo_get_type (void);
GtkWidget *color_combo_new (char **icon, char const * const no_color_label);
void color_combo_construct (ColorCombo *cc, char **icon,
char const * const no_color_label,
int ncols, int nrows, char **color_names);
char const * const no_color_label,
int ncols, int nrows, ColorNamePair *color_names);
GtkWidget *color_combo_new_with_vals (char **icon,
char const * const no_color_label,
int ncols, int nrows, char **color_names);
int ncols, int nrows,
ColorNamePair *color_names);
void color_combo_select_color (ColorCombo *color_combo, int index);
typedef struct {
......
......@@ -268,7 +268,8 @@ dialog_goal_seek (Workbook *wb, Sheet *sheet)
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
set_entry_str = cell_name (sheet->cursor_col, sheet->cursor_row);
set_entry_str = cell_name (sheet->cursor.edit_pos.col,
sheet->cursor.edit_pos.row);
if (!dialog) {
GtkWidget *set_label, *target_label, *change_label;
......
......@@ -596,8 +596,8 @@ dialog_solver (Workbook *wb, Sheet *sheet)
}
if (!target_entry_str)
target_entry_str = (gchar *) cell_name (sheet->cursor_col,
sheet->cursor_row);
target_entry_str = (gchar *) cell_name (sheet->cursor.edit_pos.col,
sheet->cursor.edit_pos.row);
dialog = glade_xml_get_widget (gui, "Solver");
target_entry = glade_xml_get_widget (gui, "target-cell");
......
This diff is collapsed.
......@@ -24,11 +24,6 @@
#include "workbook.h"
#include "commands.h"
#undef DEBUG_POSITIONS
#define CURSOR_COL(gsheet) (gsheet)->sheet_view->sheet->cursor_col
#define CURSOR_ROW(gsheet) (gsheet)->sheet_view->sheet->cursor_row
static GnomeCanvasClass *sheet_parent_class;
static void
......@@ -79,31 +74,6 @@ gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet, int col, int row, int *x,
*h = sheet_row_get_distance_pixels (sheet, row, row + 1);
}
/*
* gnumeric_sheet_set_selection:
* @gsheet: The sheet name
* @ss: The selection
*
* Set the current selection to cover the inclusive area delimited by
* start_col, start_row, end_col and end_row. The actual cursor is
* placed at base_col, base_row
*/
void
gnumeric_sheet_set_selection (GnumericSheet *gsheet,
int base_col, int base_row,
SheetSelection const *ss)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (ss != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
sheet_cursor_set (
gsheet->sheet_view->sheet,
base_col, base_row,
ss->user.start.col, ss->user.start.row,
ss->user.end.col, ss->user.end.row);
}
/*
* move_cursor:
* @gsheet: The sheet where the cursor is located
......@@ -139,7 +109,7 @@ move_cursor (GnumericSheet *gsheet, int col, int row, gboolean clear_selection)
sheet_make_cell_visible (sheet, col, row);
if (clear_selection)
sheet_selection_append (sheet, col, row);
sheet_selection_add (sheet, col, row);
}
void
......@@ -158,6 +128,8 @@ gnumeric_sheet_set_cursor_bounds (GnumericSheet *gsheet,
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
g_return_if_fail (start_row <= end_row);
g_return_if_fail (start_col <= end_col);
item_cursor_set_bounds (
gsheet->item_cursor,
......@@ -178,18 +150,20 @@ static void
move_cursor_horizontal (GnumericSheet *gsheet, int count, gboolean jump_to_boundaries)
{
Sheet *sheet = gsheet->sheet_view->sheet;
int const new_col = sheet_find_boundary_horizontal (
sheet,
sheet->cursor_col,
sheet->cursor_row,
count, jump_to_boundaries);
move_cursor (gsheet, new_col, CURSOR_ROW (gsheet), TRUE);
int const new_col =
sheet_find_boundary_horizontal (sheet,
sheet->cursor.edit_pos.col,
sheet->cursor.edit_pos.row,
count, jump_to_boundaries);