static gpointer gog_pie_series_element_populate_editor (GogObject *gobj, GOEditor *editor, GOCmdContext *cc) { GtkWidget *widget = gog_pie_series_element_pref (GOG_PIE_SERIES_ELEMENT (gobj), cc); go_editor_add_page (editor, widget, _("Settings")); g_object_unref (widget); return widget; }
static void gog_ring_plot_populate_editor (GogObject *item, GOEditor *editor, G_GNUC_UNUSED GogDataAllocator *dalloc, GOCmdContext *cc) { GtkWidget *widget = gog_ring_plot_pref (GOG_RING_PLOT (item), cc); go_editor_add_page (editor, widget, _("Properties")); g_object_unref (widget); }
static void gog_pie_plot_populate_editor (GogObject *item, GOEditor *editor, G_GNUC_UNUSED GogDataAllocator *dalloc, GOCmdContext *cc) { GtkWidget *widget = gog_pie_plot_pref (GOG_PIE_PLOT (item), cc); go_editor_add_page (editor, widget, _("Properties")); g_object_unref (widget); (GOG_OBJECT_CLASS(pie_parent_klass)->populate_editor) (item, editor, dalloc, cc); }
static void gog_trend_line_populate_editor (GogObject *gobj, GOEditor *editor, GogDataAllocator *dalloc, GOCmdContext *cc) { GtkWidget *w, *box; GogTrendLine *line = GOG_TREND_LINE (gobj); box = go_editor_get_page (editor, _("Properties")); if (!box) box = go_editor_get_page (editor, _("Details")); if (!box) { box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_set_border_width (GTK_CONTAINER (box), 12); gtk_widget_show_all (box); go_editor_add_page (editor, box, _("Legend")); } w = gtk_check_button_new_with_mnemonic (_("_Show in Legend")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), gog_trend_line_has_legend (line)); g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (cb_show_in_legend), gobj); if (GTK_IS_BOX (box)) gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0); else if (GTK_IS_GRID (box)) { GtkGrid *grid = GTK_GRID (box); gtk_grid_insert_row (grid, 1); gtk_grid_attach (grid, w, 0, 1, 2, 1); } else if (GTK_IS_CONTAINER (box)) gtk_container_add (GTK_CONTAINER (box), w); else g_warning ("Unsupported container"); gtk_widget_show (w); (GOG_OBJECT_CLASS (trend_line_parent_klass)->populate_editor) (gobj, editor, dalloc, cc); }
static void gog_xy_dropbar_populate_editor (GogObject *obj, GOEditor *editor, GogDataAllocator *dalloc, GOCmdContext *cc) { #ifdef GOFFICE_WITH_GTK GogXYDropBarPlot *dropbar = GOG_XY_DROPBAR_PLOT (obj); GtkBuilder *gui = go_gtk_builder_load ("res:go:plot_xy/gog-xy-dropbar-prefs.ui", GETTEXT_PACKAGE, cc); if (gui != NULL) { GtkWidget *w = go_gtk_builder_get_widget (gui, "before-grid"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), (GOG_PLOT (obj))->rendering_order == GOG_PLOT_RENDERING_BEFORE_GRID); g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (display_before_grid_cb), obj); w = go_gtk_builder_get_widget (gui, "horizontal"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), dropbar->horizontal); g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (horizontal_cb), obj); w = go_gtk_builder_get_widget (gui, "width-btn"); gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), dropbar->width); g_signal_connect (G_OBJECT (w), "value_changed", G_CALLBACK (value_changed_cb), obj); w = go_gtk_builder_get_widget (gui, "gog-xy-dropbar-prefs"); go_editor_add_page (editor, w, _("Properties")); g_object_unref (gui); } #endif gog_xy_dropbar_parent_klass->populate_editor (obj, editor, dalloc, cc); };
static void gog_smoothed_curve_populate_editor (GogObject *gobj, GOEditor *editor, GogDataAllocator *dalloc, GOCmdContext *cc) { GtkWidget *w, *child; GtkGrid *grid; GogDataset *set = GOG_DATASET (gobj); w = gtk_grid_new (); grid = GTK_GRID (w); g_object_set (G_OBJECT (grid), "margin", 12, "column-spacing", 12, "orientation", GTK_ORIENTATION_VERTICAL, NULL); child = gtk_label_new (_("(Name):")); gtk_grid_attach (grid, child, 0, 0, 1, 1); child = GTK_WIDGET (gog_data_allocator_editor (dalloc, set, -1, GOG_DATA_SCALAR)); g_object_set (G_OBJECT (child), "hexpand", TRUE, NULL); gtk_grid_attach (grid, child, 1, 0, 1, 1); gtk_widget_show_all (w); go_editor_add_page (editor, w, _("Details")); (GOG_OBJECT_CLASS (smoothed_curve_parent_klass)->populate_editor) (gobj, editor, dalloc, cc); }
static void gog_chart_populate_editor (GogObject *gobj, GOEditor *editor, G_GNUC_UNUSED GogDataAllocator *dalloc, GOCmdContext *cc) { static guint chart_pref_page = 0; GtkBuilder *gui; PlotAreaPrefState *state; gboolean is_plot_area_manual; GogViewAllocation plot_area; GtkWidget *w; GogChart *chart = GOG_CHART (gobj); g_return_if_fail (chart != NULL); gui = go_gtk_builder_load_internal ("res:go:graph/gog-plot-prefs.ui", GETTEXT_PACKAGE, cc); g_return_if_fail (gui != NULL); (GOG_OBJECT_CLASS(chart_parent_klass)->populate_editor) (gobj, editor, dalloc, cc); state = g_new (PlotAreaPrefState, 1); state->chart = chart; state->gui = gui; g_object_ref (chart); is_plot_area_manual = gog_chart_get_plot_area (chart, &plot_area); state->x_spin = go_gtk_builder_get_widget (gui, "x_spin"); gtk_spin_button_set_value (GTK_SPIN_BUTTON (state->x_spin), plot_area.x * 100.0); g_signal_connect (G_OBJECT (state->x_spin), "value-changed", G_CALLBACK (cb_plot_area_changed), state); state->y_spin = go_gtk_builder_get_widget (gui, "y_spin"); gtk_spin_button_set_value (GTK_SPIN_BUTTON (state->y_spin), plot_area.y * 100.0); g_signal_connect (G_OBJECT (state->y_spin), "value-changed", G_CALLBACK (cb_plot_area_changed), state); state->w_spin = go_gtk_builder_get_widget (gui, "w_spin"); gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->w_spin), 0.0, (1.0 - plot_area.x) * 100.0); gtk_spin_button_set_value (GTK_SPIN_BUTTON (state->w_spin), 100.0 * plot_area.w); state->w_spin_signal = g_signal_connect (G_OBJECT (state->w_spin), "value-changed", G_CALLBACK (cb_plot_area_changed), state); state->h_spin = go_gtk_builder_get_widget (gui, "h_spin"); gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->h_spin), 0.0, (1.0 - plot_area.y) * 100.0); gtk_spin_button_set_value (GTK_SPIN_BUTTON (state->h_spin), 100.0 * plot_area.h); state->h_spin_signal = g_signal_connect (G_OBJECT (state->h_spin), "value-changed", G_CALLBACK (cb_plot_area_changed), state); state->position_select_combo = go_gtk_builder_get_widget (gui, "position_select_combo"); gtk_combo_box_set_active (GTK_COMBO_BOX (state->position_select_combo), is_plot_area_manual ? 1 : 0); state->manual_setting_grid = go_gtk_builder_get_widget (gui, "manual-setting-grid"); if (!is_plot_area_manual) gtk_widget_hide (state->manual_setting_grid); g_signal_connect (G_OBJECT (state->position_select_combo), "changed", G_CALLBACK (cb_manual_position_changed), state); w = go_gtk_builder_get_widget (gui, "gog-plot-prefs"); g_signal_connect_swapped (G_OBJECT (w), "destroy", G_CALLBACK (plot_area_pref_state_free), state); go_editor_add_page (editor, w, _("Plot area")); go_editor_set_store_page (editor, &chart_pref_page); }