Commit 4e6306e8 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

when starting to edit use a font colour to match the background.

2002-01-13  Jody Goldberg <jody@gnome.org>

	* widget-editable-label.c (el_edit_sync) : when starting to edit
	  use a font colour to match the background.
	(el_start_editing) : restore the contrasting colour.

2002-01-12  Jody Goldberg <jody@gnome.org>

	* src/workbook-control.c (wb_control_parse_and_jump) : support
	  intersheet jumps.

2002-01-12  Jody Goldberg <jody@gnome.org>

	* dialog-goal-seek.c (cb_dialog_apply_clicked) : Use global_range_parse.
parent 4b96e7dd
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control.c (wb_control_parse_and_jump) : support
intersheet jumps.
2002-01-12 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=67425
* src/sheet-control-gui.c (cb_control_point_event) : reset cursor on
exit.
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_write_style_condition_chain) : delete.
......
......@@ -16,7 +16,10 @@ Jody:
* Improve Data Validation, and add XL import.
* Add new builtin format to Applix importer.
* Fix AREA_3D expressions from Excel.
* Support coloured tabs from Excel XP.
* Display and import coloured tabs from Excel XP.
* Fix displayed cursor when leaving a sheet object.
* Improve goto box to support names, and inter-sheet jumps.
* Support inter-sheet references in the goal seek.
Morten:
* Make sure Linux ends up using IEEE_754 code in mathfunc.c.
......
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control.c (wb_control_parse_and_jump) : support
intersheet jumps.
2002-01-12 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=67425
* src/sheet-control-gui.c (cb_control_point_event) : reset cursor on
exit.
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_write_style_condition_chain) : delete.
......
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control.c (wb_control_parse_and_jump) : support
intersheet jumps.
2002-01-12 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=67425
* src/sheet-control-gui.c (cb_control_point_event) : reset cursor on
exit.
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_write_style_condition_chain) : delete.
......
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control.c (wb_control_parse_and_jump) : support
intersheet jumps.
2002-01-12 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=67425
* src/sheet-control-gui.c (cb_control_point_event) : reset cursor on
exit.
2002-01-12 Jody Goldberg <jody@gnome.org>
* src/xml-io.c (xml_write_style_condition_chain) : delete.
......
2002-01-13 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_tab_color) : turn down the debug
level.
2002-01-12 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_dv) : reorg slightly and enable.
......
......@@ -2918,6 +2918,9 @@ ms_excel_read_row (BiffQuery *q, ExcelSheet *esheet)
static void
ms_excel_read_tab_color (BiffQuery *q, ExcelSheet *esheet)
{
/* this is a guess, but the only field I see
* changing seems to be the colour.
*/
#if 0
0 | 62 8 0 0 0 0 0 0 0 0 0 0 14 0 0 0 | b...............
10 | 0 0 0 XX XX XX XX XX XX XX XX XX XX XX XX | ...************
......@@ -2935,7 +2938,7 @@ ms_excel_read_tab_color (BiffQuery *q, ExcelSheet *esheet)
sheet_set_tab_color (esheet->gnum_sheet, color);
if (color != NULL) {
d (-1, printf ("%s tab colour = %04hx:%04hx:%04hx\n",
d (1, printf ("%s tab colour = %04hx:%04hx:%04hx\n",
esheet->gnum_sheet->name_unquoted,
color->red, color->green, color->blue););
}
......
2002-01-12 Jody Goldberg <jody@gnome.org>
* dialog-goal-seek.c (cb_dialog_apply_clicked) : Use global_range_parse.
2002-01-12 Jody Goldberg <jody@gnome.org>
* dialog-cell-format.c (validation_entry_from_expr) : new.
......
......@@ -18,6 +18,7 @@
#include <format.h>
#include <value.h>
#include <mstyle.h>
#include <ranges.h>
#include <number-match.h>
#include <parse-util.h>
#include <workbook.h>
......@@ -58,8 +59,6 @@ typedef struct {
Sheet *sheet;
Workbook *wb;
WorkbookControlGUI *wbcg;
int set_cell_col, set_cell_row;
int change_cell_col, change_cell_row;
gnum_float target_value;
gnum_float xmin;
gnum_float xmax;
......@@ -344,18 +343,21 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
StyleFormat *min_value_format;
StyleFormat *max_value_format;
gnum_float max_range_val = 1e24;
Value *error_value;
Value *error_value, *target;
RangeRef const *r;
text = gtk_entry_get_text (GTK_ENTRY (state->set_cell_entry));
if (!parse_cell_name (text, &state->set_cell_col, &state->set_cell_row, TRUE, NULL)){
/* set up source */
target = global_range_parse (state->sheet,
gtk_entry_get_text (GTK_ENTRY (state->set_cell_entry)));
if (target == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("You should introduce a valid cell name in 'Set Cell:'!"));
focus_on_entry (GTK_WIDGET (state->set_cell_entry));
return;
}
state->set_cell = sheet_cell_get (state->sheet, state->set_cell_col, state->set_cell_row);
r = &target->v_range.cell;
state->set_cell = sheet_cell_get (r->a.sheet, r->a.col, r->a.row);
value_release (target);
if (state->set_cell == NULL || !cell_has_expr (state->set_cell)) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("The cell named in 'Set Cell:' must contain a formula!"));
......@@ -363,8 +365,10 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
return;
}
text = gtk_entry_get_text (GTK_ENTRY (state->change_cell_entry));
if (!parse_cell_name (text, &state->change_cell_col, &state->change_cell_row, TRUE, NULL)){
/* set up source */
target = global_range_parse (state->sheet,
gtk_entry_get_text (GTK_ENTRY (state->change_cell_entry)));
if (target == NULL) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("You should introduce a valid cell "
"name in 'By Changing Cell:'!"));
......@@ -372,7 +376,9 @@ cb_dialog_apply_clicked (GtkWidget *button, GoalSeekState *state)
return;
}
state->change_cell = sheet_cell_fetch (state->sheet, state->change_cell_col, state->change_cell_row);
r = &target->v_range.cell;
state->change_cell = sheet_cell_get (r->a.sheet, r->a.col, r->a.row);
value_release (target);
if (cell_has_expr (state->change_cell)) {
gnumeric_notice (state->wbcg, GNOME_MESSAGE_BOX_ERROR,
_("The cell named in 'By changing cell' "
......
......@@ -89,7 +89,7 @@ dialog_goto_cell (WorkbookControlGUI *wbcg)
text = gtk_entry_get_text (GTK_ENTRY (entry));
if (*text){
if (*text) {
if (wb_control_parse_and_jump (WORKBOOK_CONTROL (wbcg), text)) {
char *tmp[1];
int i = 0;
......
......@@ -1757,6 +1757,9 @@ cb_control_point_event (GnomeCanvasItem *ctrl_pt, GdkEvent *event,
e_cursor_set_widget (ctrl_pt->canvas, GPOINTER_TO_UINT (p));
break;
}
case GDK_LEAVE_NOTIFY:
scg_set_display_cursor (scg);
break;
case GDK_BUTTON_RELEASE:
if (scg->drag_object != so)
......
2002-01-13 Jody Goldberg <jody@gnome.org>
* widget-editable-label.c (el_edit_sync) : when starting to edit
use a font colour to match the background.
(el_start_editing) : restore the contrasting colour.
2002-01-12 Jody Goldberg <jody@gnome.org>
* widget-editable-label.c (editable_label_set_color) : new routine.
......
......@@ -105,13 +105,16 @@ el_edit_sync (El *el)
points->coords [3] = font->ascent + font->descent - 1 - MARGIN;
/* Draw the cursor */
if (!el->cursor)
if (!el->cursor) {
el->cursor = gnome_canvas_item_new (
root_group, gnome_canvas_line_get_type (),
"points", points,
"fill_color_gdk", &widget->style->fg [GTK_STATE_NORMAL],
NULL);
else
gnome_canvas_item_set (GNOME_CANVAS_ITEM (el->text_item),
"fill_color_gdk", &widget->style->fg [GTK_STATE_NORMAL],
NULL);
} else
gnome_canvas_item_set (
el->cursor,
"points", points,
......@@ -188,6 +191,7 @@ el_stop_editing (El *el)
el->background = NULL;
}
editable_label_set_color (el, el->color);
gtk_grab_remove (GTK_WIDGET (el));
}
......
......@@ -26,10 +26,12 @@
#include "workbook-view.h"
#include "workbook.h"
#include "parse-util.h"
#include "sheet.h"
#include "selection.h"
#include "commands.h"
#include "value.h"
#include "ranges.h"
#include "expr-name.h"
#include <gal/util/e-util.h>
#include <libgnome/gnome-i18n.h>
......@@ -200,20 +202,56 @@ wb_control_cur_sheet (WorkbookControl *wbc)
gboolean
wb_control_parse_and_jump (WorkbookControl *wbc, const char *text)
{
int col, row;
/* FIXME : handle inter-sheet jumps too */
if (parse_cell_name (text, &col, &row, TRUE, NULL)) {
Sheet *sheet = wb_control_cur_sheet (wbc);
sheet_selection_set (sheet, col, row, col, row, col, row);
sheet_make_cell_visible (sheet, col, row, FALSE);
return TRUE;
} else {
/* TODO : create a name */
RangeRef const *r;
Sheet *sheet;
Value *target = global_range_parse (wb_control_cur_sheet (wbc), text);
/* not an address, is it a name ? */
if (target == NULL) {
ParsePos pp;
NamedExpression *nexpr = expr_name_lookup (
parse_pos_init (&pp, NULL, sheet, 0, 0), text);
/* Not a name, create one */
if (nexpr == NULL) {
Range const *r = selection_first_range (sheet, wbc,
_("Define Name"));
if (r != NULL) {
char const *err;
CellRef a, b;
a.sheet = b.sheet = sheet;
a.col = r->start.col;
a.row = r->start.row;
b.col = r->end.col;
b.row = r->end.row;
pp.sheet = NULL; /* make it a global name */
nexpr = expr_name_add (&pp, text,
expr_tree_new_constant (
value_new_cellrange_unsafe (&a, &b)), &err);
if (nexpr != NULL)
return TRUE;
gnumeric_error_invalid (COMMAND_CONTEXT (wbc), _("Name"), err);
}
return FALSE;
} else {
if (!nexpr->builtin)
target = expr_tree_get_range (nexpr->t.expr_tree);
if (target == NULL) {
gnumeric_error_invalid (COMMAND_CONTEXT (wbc), _("Address"), text);
return FALSE;
}
}
}
gnumeric_error_invalid (COMMAND_CONTEXT (wbc), _("Address"), text);
return FALSE;
r = &target->v_range.cell;
sheet = r->a.sheet;
sheet_selection_set (r->a.sheet, r->a.col, r->a.row,
r->a.col, r->a.row, r->b.col, r->b.row);
sheet_make_cell_visible (sheet, r->a.col, r->a.row, FALSE);
if (wb_control_cur_sheet (wbc) != sheet)
wb_view_sheet_focus (wbc->wb_view, sheet);
value_release (target);
return TRUE;
}
/*****************************************************************************/
......
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