6 * Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
7 * Andreas J. Guelzow <aguelzow@taliesin.ca>
9 * (C) Copyright 2000, 2001 by Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
10 * (C) Copyright 2001, 2002 by Andreas J. Guelzow <aguelzow@taliesin.ca>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses/>.
26 #include <gnumeric-config.h>
27 #include <glib/gi18n-lib.h>
28 #include <dialogs/dao-gui-utils.h>
32 #include <selection.h>
33 #include <widgets/gnm-dao.h>
34 #include <dialogs/tool-dialogs.h>
38 * dialog__tool_preset_to_range:
41 * Load selection into range and switch to output range
46 dialog_tool_preset_to_range (GnmGenericToolState
*state
)
51 g_return_if_fail (state
!= NULL
);
52 g_return_if_fail (state
->gdao
!= NULL
);
54 sel
= selection_first_range (state
->sv
, NULL
, NULL
);
55 gnm_dao_load_range (GNM_DAO (state
->gdao
), sel
);
56 gnm_dao_focus_output_range (GNM_DAO (state
->gdao
));
58 w
= go_gtk_builder_get_widget (state
->gui
, "notebook1");
59 g_return_if_fail (w
&& GTK_IS_NOTEBOOK (w
));
60 gtk_notebook_set_current_page (GTK_NOTEBOOK(w
), 0);
65 * dialog_tool_init_outputs: (skip)
69 * Setup the standard output information
73 dialog_tool_init_outputs (GnmGenericToolState
*state
, GCallback sensitivity_cb
)
77 dao_box
= go_gtk_builder_get_widget (state
->gui
, "dao");
79 if (dao_box
== NULL
) {
84 state
->gdao
= gnm_dao_new (state
->wbcg
, NULL
);
85 gtk_box_pack_start (GTK_BOX (dao_box
), state
->gdao
,
87 gtk_widget_show (state
->gdao
);
88 g_signal_connect_after (G_OBJECT (state
->gdao
),
90 G_CALLBACK (sensitivity_cb
), state
);
91 gnm_editable_enters (GTK_WINDOW (state
->dialog
),
92 GTK_WIDGET (state
->gdao
));
96 * parse_output: (skip)
100 * fill dao with information from the standard output section of a dialog
102 data_analysis_output_t
*
103 parse_output (GnmGenericToolState
*state
, data_analysis_output_t
*dao
)
105 data_analysis_output_t
*this_dao
= dao
;
107 gnm_dao_get_data (GNM_DAO (state
->gdao
), &this_dao
);
108 if (this_dao
->type
== InPlaceOutput
) {
109 GnmValue
*output_range
110 = gnm_expr_entry_parse_as_value (
111 state
->input_entry
, state
->sheet
);
112 dao_load_from_value (this_dao
, output_range
);
113 value_release (output_range
);