Commit 0dc8508a authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow

removed (cb_dialog_graphic_config_ok_clicked) : don't call

2002-04-11  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
	  removed
	(cb_dialog_graphic_config_ok_clicked) : don't call
	  cb_dialog_graphic_config_apply_clicked
	(cb_adjustment_value_changed) : also change real sheet object
	(cb_color_changed) : ditto
	(cb_dialog_filled_config_apply_clicked) : removed
	(cb_dialog_filled_adjustment_value_changed) : new
	(cb_dialog_filled_color_changed) : new
	(cb_dialog_filled_config_ok_clicked) : don't call
	  cb_dialog_filled_config_apply_clicked
	(sheet_object_filled_user_config) : hook-up cb_dialog_filled_*_changed
	* src/sheet-object-widget.c (cb_scrollbar_config_ok_clicked) : save
	  all data
	(cb_checkbox_config_destroy) : delete old_label
	(cb_checkbox_config_cancel_clicked) : reset all data
	(sheet_widget_checkbox_user_config) : save old label

2002-04-11  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* so-arrow.glade : remove apply button
	* so-fill.glade : remove apply button
	* dialog-sheet-order.c : don't reset the color combos
parent 646d9e15
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
removed
(cb_dialog_graphic_config_ok_clicked) : don't call
cb_dialog_graphic_config_apply_clicked
(cb_adjustment_value_changed) : also change real sheet object
(cb_color_changed) : ditto
(cb_dialog_filled_config_apply_clicked) : removed
(cb_dialog_filled_adjustment_value_changed) : new
(cb_dialog_filled_color_changed) : new
(cb_dialog_filled_config_ok_clicked) : don't call
cb_dialog_filled_config_apply_clicked
(sheet_object_filled_user_config) : hook-up cb_dialog_filled_*_changed
* src/sheet-object-widget.c (cb_scrollbar_config_ok_clicked) : save
all data
(cb_checkbox_config_destroy) : delete old_label
(cb_checkbox_config_cancel_clicked) : reset all data
(sheet_widget_checkbox_user_config) : save old label
2002-04-11 Morten Welinder <terra@diku.dk>
* */*: Make new plugins fn-eng from src/functions/fn-eng.c
......
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
removed
(cb_dialog_graphic_config_ok_clicked) : don't call
cb_dialog_graphic_config_apply_clicked
(cb_adjustment_value_changed) : also change real sheet object
(cb_color_changed) : ditto
(cb_dialog_filled_config_apply_clicked) : removed
(cb_dialog_filled_adjustment_value_changed) : new
(cb_dialog_filled_color_changed) : new
(cb_dialog_filled_config_ok_clicked) : don't call
cb_dialog_filled_config_apply_clicked
(sheet_object_filled_user_config) : hook-up cb_dialog_filled_*_changed
* src/sheet-object-widget.c (cb_scrollbar_config_ok_clicked) : save
all data
(cb_checkbox_config_destroy) : delete old_label
(cb_checkbox_config_cancel_clicked) : reset all data
(sheet_widget_checkbox_user_config) : save old label
2002-04-11 Morten Welinder <terra@diku.dk>
* */*: Make new plugins fn-eng from src/functions/fn-eng.c
......
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/sheet-object-graphic.c (cb_dialog_graphic_config_apply_clicked) :
removed
(cb_dialog_graphic_config_ok_clicked) : don't call
cb_dialog_graphic_config_apply_clicked
(cb_adjustment_value_changed) : also change real sheet object
(cb_color_changed) : ditto
(cb_dialog_filled_config_apply_clicked) : removed
(cb_dialog_filled_adjustment_value_changed) : new
(cb_dialog_filled_color_changed) : new
(cb_dialog_filled_config_ok_clicked) : don't call
cb_dialog_filled_config_apply_clicked
(sheet_object_filled_user_config) : hook-up cb_dialog_filled_*_changed
* src/sheet-object-widget.c (cb_scrollbar_config_ok_clicked) : save
all data
(cb_checkbox_config_destroy) : delete old_label
(cb_checkbox_config_cancel_clicked) : reset all data
(sheet_widget_checkbox_user_config) : save old label
2002-04-11 Morten Welinder <terra@diku.dk>
* */*: Make new plugins fn-eng from src/functions/fn-eng.c
......
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* so-arrow.glade : remove apply button
* so-fill.glade : remove apply button
* dialog-sheet-order.c : don't reset the color combos
2002-04-11 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-workbook-attr.c : do not use GnomePropertyBox
......
......@@ -61,6 +61,7 @@ typedef struct {
GtkWidget *ccombo_back;
GtkWidget *ccombo_fore;
gboolean initial_colors_set;
GSList *old_order;
} SheetManager;
......@@ -176,10 +177,13 @@ cb_selection_changed (GtkTreeSelection *ignored, SheetManager *state)
BACKGROUND_COLOUR_POINTER, &back,
FOREGROUND_COLOUR_POINTER, &fore,
-1);
color_combo_set_color (COLOR_COMBO (state->ccombo_back), back);
if (!state->initial_colors_set) {
color_combo_set_color (COLOR_COMBO (state->ccombo_back), back);
color_combo_set_color (COLOR_COMBO (state->ccombo_fore), fore);
state->initial_colors_set = TRUE;
}
if (back)
gdk_color_free (back);
color_combo_set_color (COLOR_COMBO (state->ccombo_fore), fore);
if (fore)
gdk_color_free (fore);
gtk_widget_set_sensitive (state->ccombo_back, TRUE);
......@@ -637,6 +641,7 @@ dialog_sheet_order (WorkbookControlGUI *wbcg)
state->ok_btn = glade_xml_get_widget (gui, "ok_button");
state->cancel_btn = glade_xml_get_widget (gui, "cancel_button");
state->old_order = NULL;
state->initial_colors_set = FALSE;
state->sheet_image = gtk_widget_render_icon (state->dialog,
"Gnumeric_MergeCells",
GTK_ICON_SIZE_SMALL_TOOLBAR,
......
......@@ -5,7 +5,7 @@
<widget class="GtkDialog" id="SO-Arrow">
<property name="border_width">5</property>
<property name="visible">no</property>
<property name="title" translatable="yes">Scrollbar Configure</property>
<property name="title" translatable="yes">Configure Arrow/Line</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property>
<property name="allow_shrink">no</property>
......@@ -38,18 +38,6 @@
</widget>
</child>
<child>
<widget class="GtkButton" id="apply_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<property name="label">gtk-apply</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="ok_button">
<property name="can_default">yes</property>
......@@ -215,6 +203,7 @@
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">0 0 3001 1 10 1</property>
<property name="width_request">60</property>
</widget>
<packing>
<property name="left_attach">1</property>
......@@ -223,7 +212,7 @@
<property name="bottom_attach">2</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="x_options">shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
......@@ -239,6 +228,7 @@
<property name="wrap">False</property>
<property name="adjustment">0 0 3001 1 10 1</property>
<property name="tooltip" translatable="yes">Distance from tip of arrowhead to the center point</property>
<property name="width_request">60</property>
</widget>
<packing>
<property name="left_attach">1</property>
......@@ -247,7 +237,7 @@
<property name="bottom_attach">3</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="x_options">shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
......@@ -263,6 +253,7 @@
<property name="wrap">False</property>
<property name="adjustment">0 0 3001 1 10 1</property>
<property name="tooltip" translatable="yes">Distance from tip of arrowhead to trailing point, measured along shaft</property>
<property name="width_request">60</property>
</widget>
<packing>
<property name="left_attach">1</property>
......@@ -271,7 +262,7 @@
<property name="bottom_attach">4</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="x_options">shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
......@@ -287,6 +278,7 @@
<property name="wrap">False</property>
<property name="adjustment">0 0 3001 1 10 1</property>
<property name="tooltip" translatable="yes">Distance of trailing point from outside edge of shaft</property>
<property name="width_request">60</property>
</widget>
<packing>
<property name="left_attach">1</property>
......@@ -295,7 +287,7 @@
<property name="bottom_attach">5</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="x_options">shrink|fill</property>
<property name="y_options"></property>
</packing>
</child>
......
......@@ -38,18 +38,6 @@
</widget>
</child>
<child>
<widget class="GtkButton" id="apply_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<property name="label">gtk-apply</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="ok_button">
<property name="can_default">yes</property>
......
......@@ -392,32 +392,9 @@ cb_dialog_graphic_config_destroy (GtkObject *w, DialogGraphicData *state)
return FALSE;
}
static void
cb_dialog_graphic_config_apply_clicked (GtkWidget *button, DialogGraphicData *state)
{
SheetObject *so = SHEET_OBJECT (state->sog);
sheet_object_graphic_width_set (state->sog,
gtk_spin_button_get_adjustment (
state->spin_line_width)->value);
sheet_object_graphic_fill_color_set (so, color_combo_get_style_color (
state->fill_color_combo));
if (state->sog->type == SHEET_OBJECT_ARROW)
sheet_object_graphic_abc_set (state->sog,
gtk_spin_button_get_adjustment (
state->spin_arrow_tip)->value,
gtk_spin_button_get_adjustment (
state->spin_arrow_length)->value,
gtk_spin_button_get_adjustment (
state->spin_arrow_width)->value);
}
static void
cb_dialog_graphic_config_ok_clicked (GtkWidget *button, DialogGraphicData *state)
{
cb_dialog_graphic_config_apply_clicked (button, state);
gtk_widget_destroy (state->dialog);
}
......@@ -439,16 +416,32 @@ cb_dialog_graphic_config_cancel_clicked (GtkWidget *button, DialogGraphicData *s
static void
cb_adjustment_value_changed (GtkAdjustment *adj, DialogGraphicData *state)
{
sheet_object_graphic_width_set (state->sog,
gtk_spin_button_get_adjustment (
state->spin_line_width)->value);
gnome_canvas_item_set (state->arrow,
"arrow_shape_a", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_tip)->value,
"arrow_shape_b", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_length)->value,
"arrow_shape_c", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_width)->value,
"width_units", (double) gtk_spin_button_get_adjustment (
state->spin_line_width)->value,
NULL);
if (state->sog->type == SHEET_OBJECT_ARROW) {
sheet_object_graphic_abc_set (state->sog,
gtk_spin_button_get_adjustment (
state->spin_arrow_tip)->value,
gtk_spin_button_get_adjustment (
state->spin_arrow_length)->value,
gtk_spin_button_get_adjustment (
state->spin_arrow_width)->value);
gnome_canvas_item_set (state->arrow,
"arrow_shape_a", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_tip)->value,
"arrow_shape_b", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_length)->value,
"arrow_shape_c", (double) gtk_spin_button_get_adjustment (
state->spin_arrow_width)->value,
NULL);
}
}
static void
......@@ -456,6 +449,10 @@ cb_fill_color_changed (ColorCombo *color_combo, GdkColor *color,
gboolean is_custom, gboolean by_user, gboolean is_default,
DialogGraphicData *state)
{
SheetObject *so = SHEET_OBJECT (state->sog);
sheet_object_graphic_fill_color_set (so, color_combo_get_style_color (
state->fill_color_combo));
gnome_canvas_item_set (state->arrow, "fill_color_gdk", color, NULL);
}
......@@ -580,9 +577,6 @@ sheet_object_graphic_user_config (SheetObject *so, SheetControlGUI *scg)
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "ok_button")),
"clicked",
G_CALLBACK (cb_dialog_graphic_config_ok_clicked), state);
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "apply_button")),
"clicked",
G_CALLBACK (cb_dialog_graphic_config_apply_clicked), state);
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "cancel_button")),
"clicked",
G_CALLBACK (cb_dialog_graphic_config_cancel_clicked), state);
......@@ -841,18 +835,22 @@ cb_dialog_filled_config_destroy (GtkObject *w, DialogFilledData *state)
}
static void
cb_dialog_filled_config_apply_clicked (GtkWidget *button, DialogFilledData *state)
cb_dialog_filled_adjustment_value_changed (GtkAdjustment *adj, DialogFilledData *state)
{
SheetObjectGraphic *sog = SHEET_OBJECT_GRAPHIC (state->sof);
SheetObject *so = SHEET_OBJECT (state->sof);
sheet_object_graphic_width_set (sog,
gtk_spin_button_get_adjustment (
state->spin_border_width)->value);
sheet_object_graphic_fill_color_set (so,
color_combo_get_style_color (
state->spin_border_width)->value);
}
static void
cb_dialog_filled_color_changed (ColorCombo *color_combo, GdkColor *color,
gboolean is_custom, gboolean by_user, gboolean is_default,
DialogFilledData *state)
{
SheetObject *so = SHEET_OBJECT (state->sof);
sheet_object_graphic_fill_color_set (so, color_combo_get_style_color (
state->fill_color_combo));
sheet_object_filled_outline_color_set (so,
color_combo_get_style_color (
......@@ -862,7 +860,6 @@ cb_dialog_filled_config_apply_clicked (GtkWidget *button, DialogFilledData *stat
static void
cb_dialog_filled_config_ok_clicked (GtkWidget *button, DialogFilledData *state)
{
cb_dialog_filled_config_apply_clicked (button, state);
gtk_widget_destroy (state->dialog);
}
......@@ -939,15 +936,23 @@ sheet_object_filled_user_config (SheetObject *so, SheetControlGUI *scg)
state->width = sog->width;
gtk_spin_button_set_value (state->spin_border_width, state->width);
g_signal_connect (G_OBJECT (state->fill_color_combo),
"color_changed",
G_CALLBACK (cb_dialog_filled_color_changed), state);
g_signal_connect (G_OBJECT (state->outline_color_combo),
"color_changed",
G_CALLBACK (cb_dialog_filled_color_changed), state);
g_signal_connect (G_OBJECT
(gtk_spin_button_get_adjustment (state->spin_border_width)),
"value_changed",
G_CALLBACK (cb_dialog_filled_adjustment_value_changed), state);
g_signal_connect (G_OBJECT (state->dialog),
"destroy",
G_CALLBACK (cb_dialog_filled_config_destroy), state);
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "ok_button")),
"clicked",
G_CALLBACK (cb_dialog_filled_config_ok_clicked), state);
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "apply_button")),
"clicked",
G_CALLBACK (cb_dialog_filled_config_apply_clicked), state);
g_signal_connect (G_OBJECT (glade_xml_get_widget (state->gui, "cancel_button")),
"clicked",
G_CALLBACK (cb_dialog_filled_config_cancel_clicked), state);
......
......@@ -687,6 +687,17 @@ cb_scrollbar_config_ok_clicked (GtkWidget *button, ScrollbarConfigState *state)
gnm_expr_unref (expr);
}
state->swb->adjustment->lower = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (state->min));
state->swb->adjustment->upper = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (state->max)) + 1;
state->swb->adjustment->step_increment = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (state->inc));
state->swb->adjustment->page_increment = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (state->page));
gtk_adjustment_changed (state->swb->adjustment);
gtk_widget_destroy (state->dialog);
}
......@@ -1069,7 +1080,8 @@ typedef struct {
GtkWidget *dialog;
GnumericExprEntry *expression;
GtkWidget *label;
char *old_label;
GtkWidget *old_focus;
WorkbookControlGUI *wbcg;
......@@ -1113,6 +1125,8 @@ cb_checkbox_config_destroy (GtkObject *w, CheckboxConfigState *state)
state->gui = NULL;
}
g_free (state->old_label);
state->old_label = NULL;
state->dialog = NULL;
g_free (state);
......@@ -1138,6 +1152,22 @@ cb_checkbox_config_ok_clicked (GtkWidget *button, CheckboxConfigState *state)
static void
cb_checkbox_config_cancel_clicked (GtkWidget *button, CheckboxConfigState *state)
{
GList *list;
SheetWidgetCheckbox *swc;
swc = state->swc;
if (swc->label)
g_free (swc->label);
swc->label = g_strdup (state->old_label);
list = swc->sow.parent_object.realized_list;
for (; list != NULL; list = list->next) {
GnomeCanvasWidget *item = GNOME_CANVAS_WIDGET (list->data);
g_return_if_fail (GTK_IS_CHECK_BUTTON (item->widget));
g_return_if_fail (GTK_IS_LABEL (GTK_BIN (item->widget)->child));
gtk_label_set_text (GTK_LABEL (GTK_BIN (item->widget)->child), state->old_label);
}
gtk_widget_destroy (state->dialog);
}
......@@ -1184,6 +1214,7 @@ sheet_widget_checkbox_user_config (SheetObject *so, SheetControlGUI *scg)
state->wbcg = wbcg;
state->sheet = sc_sheet (SHEET_CONTROL (scg));
state->old_focus = NULL;
state->old_label = g_strdup (swc->label);
state->gui = gnumeric_glade_xml_new (wbcg, "so-checkbox.glade");
state->dialog = glade_xml_get_widget (state->gui, "SO-Checkbox");
......@@ -1203,6 +1234,7 @@ sheet_widget_checkbox_user_config (SheetObject *so, SheetControlGUI *scg)
state->label = glade_xml_get_widget (state->gui, "label_entry");
gtk_entry_set_text (GTK_ENTRY (state->label), swc->label);
g_signal_connect (G_OBJECT (state->label),
......
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