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

Changed the way we tag the function definitions before its too late.

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

	* src/fn-math.c: Changed the way we tag the function definitions
	before its too late.

	* src/item-cursor.c (item_cursor_point): Made the thresholds for
	the cursor a little better.

	* src/dialog-cell-format.c: Small changes to the color
	configuration code.

	* src/expr.c (do_expr_decode_tree): When decoding a tree, include
parent fea6e072
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-math.c: Changed the way we tag the function definitions
before its too late.
* src/item-cursor.c (item_cursor_point): Made the thresholds for
the cursor a little better.
* src/dialog-cell-format.c: Small changes to the color
configuration code.
* src/expr.c (do_expr_decode_tree): When decoding a tree, include
the argument separator. Also, loop properly trough the arguments
being decoded.
......@@ -16,6 +20,11 @@
* src/fn-date.c (gnumeric_now): The serial number returned by
NOW() should be relative to 1900/1/1, not year zero.
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/expr.c (eval_expr): Fix the way we computed expressions.
......
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-math.c: Changed the way we tag the function definitions
before its too late.
* src/item-cursor.c (item_cursor_point): Made the thresholds for
the cursor a little better.
* src/dialog-cell-format.c: Small changes to the color
configuration code.
* src/expr.c (do_expr_decode_tree): When decoding a tree, include
the argument separator. Also, loop properly trough the arguments
being decoded.
......@@ -16,6 +20,11 @@
* src/fn-date.c (gnumeric_now): The serial number returned by
NOW() should be relative to 1900/1/1, not year zero.
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/expr.c (eval_expr): Fix the way we computed expressions.
......
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-math.c: Changed the way we tag the function definitions
before its too late.
* src/item-cursor.c (item_cursor_point): Made the thresholds for
the cursor a little better.
* src/dialog-cell-format.c: Small changes to the color
configuration code.
* src/expr.c (do_expr_decode_tree): When decoding a tree, include
the argument separator. Also, loop properly trough the arguments
being decoded.
......@@ -16,6 +20,11 @@
* src/fn-date.c (gnumeric_now): The serial number returned by
NOW() should be relative to 1900/1/1, not year zero.
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/expr.c (eval_expr): Fix the way we computed expressions.
......
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-21 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-math.c: Changed the way we tag the function definitions
before its too late.
* src/item-cursor.c (item_cursor_point): Made the thresholds for
the cursor a little better.
* src/dialog-cell-format.c: Small changes to the color
configuration code.
* src/expr.c (do_expr_decode_tree): When decoding a tree, include
the argument separator. Also, loop properly trough the arguments
being decoded.
......@@ -16,6 +20,11 @@
* src/fn-date.c (gnumeric_now): The serial number returned by
NOW() should be relative to 1900/1/1, not year zero.
1998-09-21 Adrian Likins <adrian@gimp.org>
*src/fn-math.c: firat stab at fleshing out the help
blurbs here.
1998-09-20 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/expr.c (eval_expr): Fix the way we computed expressions.
......
This diff is collapsed.
......@@ -140,6 +140,32 @@ cell_set_foreground (Cell *cell, gushort red, gushort green, gushort blue)
cell_queue_redraw (cell);
}
void
cell_set_background (Cell *cell, gushort red, gushort green, gushort blue)
{
g_return_if_fail (cell != NULL);
if (cell->style->valid_flags & STYLE_BACK_COLOR)
style_color_unref (cell->style->back_color);
cell->style->valid_flags |= STYLE_BACK_COLOR;
cell->style->back_color = style_color_new (red, green, blue);
cell_queue_redraw (cell);
}
void
cell_set_pattern (Cell *cell, int pattern)
{
g_return_if_fail (cell != NULL);
cell->style->valid_flags |= STYLE_PATTERN;
cell->style->pattern = pattern;
cell_queue_redraw (cell);
}
/*
* cell_set_rendered_text
* @cell: the cell we will modify
......
......@@ -72,6 +72,8 @@ void cell_set_format (Cell *cell, char *format);
void cell_set_font (Cell *cell, char *font_name);
void cell_set_font_from_style (Cell *cell, StyleFont *style_font);
void cell_set_foreground (Cell *cell, gushort red, gushort green, gushort blue);
void cell_set_background (Cell *cell, gushort red, gushort green, gushort blue);
void cell_set_pattern (Cell *cell, int pattern);
void cell_set_alignment (Cell *cell, int halign, int valign, int orientation, int auto_return);
void cell_set_halign (Cell *cell, StyleHAlignFlags halign);
void cell_set_rendered_text (Cell *cell, char *rendered_text);
......
......@@ -35,7 +35,8 @@ static GtkWidget *auto_return;
static GSList *foreground_radio_list;
static GSList *background_radio_list;
static GnomeColorPicker *foreground_cs;
static GtkWidget *foreground_cs;
static GtkWidget *background_cs;
/* Points to the first cell in the selection */
static Cell *first_cell;
......@@ -669,13 +670,13 @@ create_foreground_radio (GtkWidget *prop_win)
foreground_radio_list = GTK_RADIO_BUTTON (r2)->group;
foreground_cs = GNOME_COLOR_PICKER (gnome_color_picker_new ());
foreground_cs = gnome_color_picker_new ();
make_color_picker_notify (GTK_WIDGET (foreground_cs), prop_win);
make_color_picker_notify (foreground_cs, prop_win);
gtk_table_attach (GTK_TABLE (table), r1, 0, 1, 0, 1, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), r2, 0, 1, 1, 2, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (foreground_cs),
gtk_table_attach (GTK_TABLE (table), foreground_cs,
1, 2, 1, 2, 0, 0, 0, 0);
return frame;
......@@ -684,7 +685,7 @@ create_foreground_radio (GtkWidget *prop_win)
static GtkWidget *
create_background_radio (GtkWidget *prop_win)
{
GtkWidget *frame, *table, *r1, *r2, *r3, *cs1, *cs2, *p;
GtkWidget *frame, *table, *r1, *r2, *r3, *p;
int e = GTK_FILL | GTK_EXPAND;
frame = gtk_frame_new (_("Background configuration"));
......@@ -702,11 +703,9 @@ create_background_radio (GtkWidget *prop_win)
background_radio_list = GTK_RADIO_BUTTON (r3)->group;
/* The color selectors */
cs1 = gnome_color_picker_new ();
cs2 = gnome_color_picker_new ();
background_cs = gnome_color_picker_new ();
make_color_picker_notify (cs1, prop_win);
make_color_picker_notify (cs2, prop_win);
make_color_picker_notify (background_cs, prop_win);
/* Create the pattern preview */
p = pattern_selector_new (0);
......@@ -715,8 +714,7 @@ create_background_radio (GtkWidget *prop_win)
gtk_table_attach (GTK_TABLE (table), r2, 0, 1, 1, 2, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), r3, 0, 1, 2, 3, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), cs1, 1, 2, 1, 2, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), cs2, 1, 2, 2, 3, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), background_cs, 1, 2, 1, 2, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), p, 0, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
return frame;
}
......@@ -749,7 +747,7 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
gushort back_red, back_green, back_blue;
if (gtk_radio_group_get_selected (foreground_radio_list) == 1){
gnome_color_picker_get_d (foreground_cs, &rd, &gd, &bd, &ad);
gnome_color_picker_get_d (GNOME_COLOR_PICKER (foreground_cs), &rd, &gd, &bd, &ad);
fore_red = rd * 65535;
fore_green = gd * 65535;
......@@ -765,7 +763,6 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
back_green = 0xffff;
back_blue = 0xffff;
} else {
}
/* Apply the color to the cells */
......@@ -773,10 +770,13 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
Cell *cell = cells->data;
cell_set_foreground (cell, fore_red, fore_green, fore_blue);
cell_set_background (cell, back_red, back_green, back_blue);
cell_set_pattern (cell, 2);
}
style->valid_flags |= STYLE_FORE_COLOR;
style->valid_flags |= STYLE_FORE_COLOR | STYLE_PATTERN | STYLE_BACK_COLOR;
style->fore_color = style_color_new (fore_red, fore_green, fore_blue);
style->fore_color = style_color_new (back_red, back_green, back_blue);
}
static struct {
......@@ -787,7 +787,7 @@ static struct {
{ N_("Number"), create_number_format_page, apply_number_formats },
{ N_("Alignment"), create_align_page, apply_align_format },
{ N_("Font"), create_font_page, apply_font_format },
{ N_("Coloring"), create_coloring_page, apply_coloring_format },
/* { N_("Coloring"), create_coloring_page, apply_coloring_format }, */
{ NULL, NULL }
};
......
......@@ -35,7 +35,8 @@ static GtkWidget *auto_return;
static GSList *foreground_radio_list;
static GSList *background_radio_list;
static GnomeColorPicker *foreground_cs;
static GtkWidget *foreground_cs;
static GtkWidget *background_cs;
/* Points to the first cell in the selection */
static Cell *first_cell;
......@@ -669,13 +670,13 @@ create_foreground_radio (GtkWidget *prop_win)
foreground_radio_list = GTK_RADIO_BUTTON (r2)->group;
foreground_cs = GNOME_COLOR_PICKER (gnome_color_picker_new ());
foreground_cs = gnome_color_picker_new ();
make_color_picker_notify (GTK_WIDGET (foreground_cs), prop_win);
make_color_picker_notify (foreground_cs, prop_win);
gtk_table_attach (GTK_TABLE (table), r1, 0, 1, 0, 1, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), r2, 0, 1, 1, 2, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (foreground_cs),
gtk_table_attach (GTK_TABLE (table), foreground_cs,
1, 2, 1, 2, 0, 0, 0, 0);
return frame;
......@@ -684,7 +685,7 @@ create_foreground_radio (GtkWidget *prop_win)
static GtkWidget *
create_background_radio (GtkWidget *prop_win)
{
GtkWidget *frame, *table, *r1, *r2, *r3, *cs1, *cs2, *p;
GtkWidget *frame, *table, *r1, *r2, *r3, *p;
int e = GTK_FILL | GTK_EXPAND;
frame = gtk_frame_new (_("Background configuration"));
......@@ -702,11 +703,9 @@ create_background_radio (GtkWidget *prop_win)
background_radio_list = GTK_RADIO_BUTTON (r3)->group;
/* The color selectors */
cs1 = gnome_color_picker_new ();
cs2 = gnome_color_picker_new ();
background_cs = gnome_color_picker_new ();
make_color_picker_notify (cs1, prop_win);
make_color_picker_notify (cs2, prop_win);
make_color_picker_notify (background_cs, prop_win);
/* Create the pattern preview */
p = pattern_selector_new (0);
......@@ -715,8 +714,7 @@ create_background_radio (GtkWidget *prop_win)
gtk_table_attach (GTK_TABLE (table), r2, 0, 1, 1, 2, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), r3, 0, 1, 2, 3, e, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), cs1, 1, 2, 1, 2, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), cs2, 1, 2, 2, 3, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), background_cs, 1, 2, 1, 2, 0, 0, 4, 2);
gtk_table_attach (GTK_TABLE (table), p, 0, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
return frame;
}
......@@ -749,7 +747,7 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
gushort back_red, back_green, back_blue;
if (gtk_radio_group_get_selected (foreground_radio_list) == 1){
gnome_color_picker_get_d (foreground_cs, &rd, &gd, &bd, &ad);
gnome_color_picker_get_d (GNOME_COLOR_PICKER (foreground_cs), &rd, &gd, &bd, &ad);
fore_red = rd * 65535;
fore_green = gd * 65535;
......@@ -765,7 +763,6 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
back_green = 0xffff;
back_blue = 0xffff;
} else {
}
/* Apply the color to the cells */
......@@ -773,10 +770,13 @@ apply_coloring_format (Style *style, Sheet *sheet, CellList *cells)
Cell *cell = cells->data;
cell_set_foreground (cell, fore_red, fore_green, fore_blue);
cell_set_background (cell, back_red, back_green, back_blue);
cell_set_pattern (cell, 2);
}
style->valid_flags |= STYLE_FORE_COLOR;
style->valid_flags |= STYLE_FORE_COLOR | STYLE_PATTERN | STYLE_BACK_COLOR;
style->fore_color = style_color_new (fore_red, fore_green, fore_blue);
style->fore_color = style_color_new (back_red, back_green, back_blue);
}
static struct {
......@@ -787,7 +787,7 @@ static struct {
{ N_("Number"), create_number_format_page, apply_number_formats },
{ N_("Alignment"), create_align_page, apply_align_format },
{ N_("Font"), create_font_page, apply_font_format },
{ N_("Coloring"), create_coloring_page, apply_coloring_format },
/* { N_("Coloring"), create_coloring_page, apply_coloring_format }, */
{ NULL, NULL }
};
......
This diff is collapsed.
......@@ -526,8 +526,9 @@ render_number (gdouble number,
for (temp = number; temp >= 1.0; temp /= 10.0){
gint digit = floor (temp);
double r = floor (temp);
int digit;
if (use_thousand_sep){
group++;
if (group == 4){
......@@ -543,8 +544,8 @@ render_number (gdouble number,
}
}
digit %= 10;
g_string_prepend_c (number_string, digit + '0');
digit = r - floor (r / 10) * 10;
g_string_prepend_c (number_string, (digit) + '0');
if (left_req > 0)
left_req --;
if (left_spaces > 0)
......
This diff is collapsed.
......@@ -339,22 +339,22 @@ item_cursor_point (GnomeCanvasItem *item, double x, double y, int cx, int cy,
{
*actual_item = NULL;
if (cx < item->x1-1)
if (cx < item->x1-3)
return INT_MAX;
if (cx > item->x2)
if (cx > item->x2+3)
return INT_MAX;
if (cy < item->y1-1)
if (cy < item->y1-3)
return INT_MAX;
if (cy > item->y2)
if (cy > item->y2+3)
return INT_MAX;
/* FIXME: this needs to handle better the small little square case
* for ITEM_CURSOR_SELECTION style
*/
if ((cx < (item->x1 + 3)) ||
(cx > (item->x2 - 3)) ||
(cy < (item->y1 + 3)) ||
(cy > (item->y2 - 3))){
if ((cx < (item->x1 + 4)) ||
(cx > (item->x2 - 8)) ||
(cy < (item->y1 + 4)) ||
(cy > (item->y2 - 8))){
*actual_item = item;
return 0.0;
}
......
......@@ -214,12 +214,12 @@ item_grid_draw_cell (GdkDrawable *drawable, ItemGrid *item_grid, Cell *cell, int
x1, y1,
cell->col->pixels,
cell->row->pixels);
} else {
gdk_gc_set_fill (gc, GDK_SOLID);
gdk_gc_set_stipple (gc, NULL);
}
count = cell_draw (cell, item_grid->sheet_view, gc, drawable, x1, y1);
return count;
}
......
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