gnumeric r16876 - in trunk: . component po src src/dialogs src/tools
- From: guelzow svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r16876 - in trunk: . component po src src/dialogs src/tools
- Date: Sun, 12 Oct 2008 23:47:06 +0000 (UTC)
Author: guelzow
Date: Sun Oct 12 23:47:06 2008
New Revision: 16876
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16876&view=rev
Log:
2008-10-12 Andreas J. Guelzow <aguelzow pyrshep ca>
* frequency.glade: new
* dialog-analysis-tool-frequency.c: new
* dialogs.h (dialog_frequency_tool): new
* Makefile.am: added frequency.glade and
dialog-analysis-tool-frequency.c
* help.h (GNUMERIC_HELP_LINK_FREQUENCY): new
2008-10-12 Andreas J. Guelzow <aguelzow pyrshep ca>
* analysis-tools.h (set_cell_text_col): new
* analysis-tools.c (set_cell_text_col): make non-static
* analysis-frequency.[ch]: new
* Makefile.am: added analysis-frequency.[ch]
2008-10-12 Andreas J. Guelzow <aguelzow pyrshep ca>
* component/Gnumeric-embed.xml.in: added frequency tool menu item
* src/GNOME_Gnumeric-gtk.xml.in: ditto
* src/HILDON_Gnumeric-gtk.xml.in: ditto
* src/wbc-gtk-actions.c: added ToolsFrequency
2008-10-12 Andreas J. Guelzow <aguelzow pyrshep ca>
* POTFILES.in: added src/tools/analysis-frequency.c and
src/dialogs/dialog-analysis-tool-frequency.c
Added:
trunk/src/dialogs/dialog-analysis-tool-frequency.c
trunk/src/dialogs/frequency.glade
trunk/src/tools/analysis-frequency.c
trunk/src/tools/analysis-frequency.h
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/component/Gnumeric-embed.xml.in
trunk/po/ChangeLog
trunk/po/POTFILES.in
trunk/src/GNOME_Gnumeric-gtk.xml.in
trunk/src/HILDON_Gnumeric-gtk.xml.in
trunk/src/dialogs/ChangeLog
trunk/src/dialogs/Makefile.am
trunk/src/dialogs/dialogs.h
trunk/src/dialogs/help.h
trunk/src/tools/ChangeLog
trunk/src/tools/Makefile.am
trunk/src/tools/analysis-tools.c
trunk/src/tools/analysis-tools.h
trunk/src/wbc-gtk-actions.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun Oct 12 23:47:06 2008
@@ -25,6 +25,7 @@
* Added multiplicative Holt-Winters exponential smoothing.
* Fix minor bugs. [#554818] [#553342]
* Update some of the analysis tools documentation.
+ * Add non-numeric frequency tables tool. [#134166]
Jean:
* Fix printing of rotated text. [#539734]
Modified: trunk/component/Gnumeric-embed.xml.in
==============================================================================
--- trunk/component/Gnumeric-embed.xml.in (original)
+++ trunk/component/Gnumeric-embed.xml.in Sun Oct 12 23:47:06 2008
@@ -169,7 +169,10 @@
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
- <menuitem action="ToolsHistogram"/>
+ <menu name="ToolForecast" action="MenuToolFrequencies">
+ <menuitem action="ToolsFrequency"/>
+ <menuitem action="ToolsHistogram"/>
+ </menu>
<menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Sun Oct 12 23:47:06 2008
@@ -141,6 +141,7 @@
src/dialogs/descriptive-stats.glade
src/dialogs/dialog-about.c
src/dialogs/dialog-advanced-filter.c
+src/dialogs/dialog-analysis-tool-frequency.c
src/dialogs/dialog-analysis-tools.c
src/dialogs/dialog-autocorrect.c
src/dialogs/dialog-autofilter.c
@@ -295,6 +296,7 @@
src/style.c
src/test-pango.c
src/tools/analysis-exp-smoothing.c
+src/tools/analysis-frequency.c
src/tools/analysis-histogram.c
src/tools/analysis-tools.c
src/tools/dao.c
Modified: trunk/src/GNOME_Gnumeric-gtk.xml.in
==============================================================================
--- trunk/src/GNOME_Gnumeric-gtk.xml.in (original)
+++ trunk/src/GNOME_Gnumeric-gtk.xml.in Sun Oct 12 23:47:06 2008
@@ -173,7 +173,10 @@
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
- <menuitem action="ToolsHistogram"/>
+ <menu name="ToolFrequencies" action="MenuToolFrequencies">
+ <menuitem action="ToolsFrequency"/>
+ <menuitem action="ToolsHistogram"/>
+ </menu>
<menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
Modified: trunk/src/HILDON_Gnumeric-gtk.xml.in
==============================================================================
--- trunk/src/HILDON_Gnumeric-gtk.xml.in (original)
+++ trunk/src/HILDON_Gnumeric-gtk.xml.in Sun Oct 12 23:47:06 2008
@@ -178,8 +178,11 @@
<menuitem action="ToolsAverage"/>
</menu>
<menuitem action="ToolsFourier"/>
- <menuitem action="ToolsHistogram"/>
- <menuitem action="ToolsRanking"/>
+ <menu name="ToolFrequencies" action="MenuToolFrequencies">
+ <menuitem action="ToolsFrequency"/>
+ <menuitem action="ToolsHistogram"/>
+ </menu>
+ <menuitem action="ToolsRanking"/>
<menuitem action="ToolsRegression"/>
<menuitem action="ToolsSampling"/>
<menu name="ToolTTest" action="MenuToolTTest">
Modified: trunk/src/dialogs/Makefile.am
==============================================================================
--- trunk/src/dialogs/Makefile.am (original)
+++ trunk/src/dialogs/Makefile.am Sun Oct 12 23:47:06 2008
@@ -26,6 +26,7 @@
dialog-about.c \
dialog-advanced-filter.c \
dialog-analysis-tools.c \
+ dialog-analysis-tool-frequency.c \
dialog-autocorrect.c \
dialog-autofilter.c \
dialog-autoformat.c \
@@ -115,6 +116,7 @@
font-sel.glade \
formula-guru.glade \
fourier-analysis.glade \
+ frequency.glade \
function-select.glade \
goalseek.glade \
goto.glade \
Added: trunk/src/dialogs/dialog-analysis-tool-frequency.c
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/dialog-analysis-tool-frequency.c Sun Oct 12 23:47:06 2008
@@ -0,0 +1,297 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * dialog-analysis-tool-frequency.c:
+ *
+ * Authors:
+ * Andreas J. Guelzow <aguelzow taliesin ca>
+ *
+ * (C) Copyright 2008 by Andreas J. Guelzow <aguelzow pyrshep ca>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gnumeric-config.h>
+#include <glib/gi18n-lib.h>
+#include <gnumeric.h>
+#include "dialogs.h"
+#include "analysis-frequency.h"
+#include "analysis-tools.h"
+
+#include <workbook.h>
+#include <workbook-control.h>
+#include <wbc-gtk.h>
+#include <workbook-view.h>
+#include <gui-util.h>
+#include <parse-util.h>
+#include <gnm-format.h>
+#include <tool-dialogs.h>
+#include <dao-gui-utils.h>
+#include <sheet.h>
+#include <expr.h>
+#include <number-match.h>
+#include <ranges.h>
+#include <selection.h>
+#include <value.h>
+#include <commands.h>
+#include "help.h"
+
+#include <widgets/gnm-dao.h>
+#include <widgets/gnumeric-expr-entry.h>
+
+#include <glade/glade.h>
+#include <string.h>
+#include <gtk/gtktable.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtkspinbutton.h>
+#include <gtk/gtklabel.h>
+
+#define FREQUENCY_KEY "analysistools-frequency-dialog"
+
+static char const * const grouped_by_group[] = {
+ "grouped_by_row",
+ "grouped_by_col",
+ NULL
+};
+
+static char const * const chart_group[] = {
+ "nochart-button",
+ "barchart-button",
+ "columnchart-button",
+ NULL
+};
+
+typedef struct {
+ GenericToolState base;
+ GtkWidget *predetermined_button;
+ GtkWidget *calculated_button;
+ GtkEntry *n_entry;
+} FrequencyToolState;
+
+
+/**
+ * frequency_tool_update_sensitivity_cb:
+ * @dummy:
+ * @state:
+ *
+ * Update the dialog widgets sensitivity
+ **/
+static void
+frequency_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy,
+ FrequencyToolState *state)
+{
+ int the_n;
+ gboolean predetermined_bins;
+ GSList *input_range;
+ GnmValue *input_range_2 = NULL;
+
+ input_range = gnm_expr_entry_parse_as_list
+ (GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
+ if (input_range == NULL) {
+ gtk_label_set_text (GTK_LABEL (state->base.warning),
+ _("The input range is invalid."));
+ gtk_widget_set_sensitive (state->base.ok_button, FALSE);
+ return;
+ }
+
+ range_list_destroy (input_range);
+
+ predetermined_bins = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (state->predetermined_button));
+ if (predetermined_bins) {
+ input_range_2 = gnm_expr_entry_parse_as_value
+ (GNM_EXPR_ENTRY (state->base.input_entry_2), state->base.sheet);
+ if (input_range_2 == NULL) {
+ gtk_label_set_text (GTK_LABEL (state->base.warning),
+ _("The categories range is not valid."));
+ gtk_widget_set_sensitive (state->base.ok_button, FALSE);
+ return;
+ }
+ value_release (input_range_2);
+ } else if (entry_to_int(state->n_entry, &the_n,FALSE) != 0 || the_n <= 0) {
+ gtk_label_set_text (GTK_LABEL (state->base.warning),
+ _("The number of categories is invalid."));
+ gtk_widget_set_sensitive (state->base.ok_button, FALSE);
+ return;
+ }
+
+ if (!gnm_dao_is_ready (GNM_DAO (state->base.gdao))) {
+ gtk_label_set_text (GTK_LABEL (state->base.warning),
+ _("The output specification "
+ "is invalid."));
+ gtk_widget_set_sensitive (state->base.ok_button, FALSE);
+ return;
+ }
+
+ gtk_label_set_text (GTK_LABEL (state->base.warning), "");
+ gtk_widget_set_sensitive (state->base.ok_button, TRUE);
+
+ return;
+}
+
+/**
+ * frequency_tool_ok_clicked_cb:
+ * @button:
+ * @state:
+ *
+ * Retrieve the information from the dialog and call the frequency_tool.
+ * Note that we assume that the ok_button is only active if the entry fields
+ * contain sensible data.
+ **/
+static void
+frequency_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
+ FrequencyToolState *state)
+{
+ data_analysis_output_t *dao;
+ analysis_tools_data_frequency_t *data;
+
+ GtkWidget *w;
+
+ data = g_new0 (analysis_tools_data_frequency_t, 1);
+ dao = parse_output ((GenericToolState *)state, NULL);
+
+ data->base.input = gnm_expr_entry_parse_as_list (
+ GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
+ data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
+
+ data->predetermined = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (state->predetermined_button));
+ if (data->predetermined) {
+ w = glade_xml_get_widget (state->base.gui, "labels_2_button");
+ data->bin = gnm_expr_entry_parse_as_value
+ (GNM_EXPR_ENTRY (state->base.input_entry_2),
+ state->base.sheet);
+ } else {
+ entry_to_int(state->n_entry, &data->n,TRUE);
+ data->bin = NULL;
+ }
+
+ data->chart = gnumeric_glade_group_value (state->base.gui, chart_group);
+
+ w = glade_xml_get_widget (state->base.gui, "labels_button");
+ data->base.labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+ w = glade_xml_get_widget (state->base.gui, "percentage-button");
+ data->percentage = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
+
+ if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
+ dao, data, analysis_tool_frequency_engine))
+ gtk_widget_destroy (state->base.dialog);
+
+ return;
+}
+
+/**
+ * frequency_tool_set_predetermined:
+ * @widget:
+ * @focus_widget:
+ * @state:
+ *
+ * Output range entry was focused. Switch to output range.
+ *
+ **/
+static gboolean
+frequency_tool_set_predetermined (G_GNUC_UNUSED GtkWidget *widget,
+ G_GNUC_UNUSED GdkEventFocus *event,
+ FrequencyToolState *state)
+{
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->predetermined_button), TRUE);
+ return FALSE;
+}
+
+/**
+ * frequency_tool_set_calculated:
+ * @widget:
+ * @event:
+ * @state:
+ *
+ **/
+static gboolean
+frequency_tool_set_calculated (G_GNUC_UNUSED GtkWidget *widget,
+ G_GNUC_UNUSED GdkEventFocus *event,
+ FrequencyToolState *state)
+{
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->calculated_button), TRUE);
+ return FALSE;
+}
+
+/**
+ * dialog_frequency_tool:
+ * @wbcg:
+ * @sheet:
+ *
+ * Show the dialog (guru).
+ *
+ **/
+int
+dialog_frequency_tool (WBCGtk *wbcg, Sheet *sheet)
+{
+ FrequencyToolState *state;
+
+ if (wbcg == NULL) {
+ return 1;
+ }
+
+
+ /* Only pop up one copy per workbook */
+ if (gnumeric_dialog_raise_if_exists (wbcg, FREQUENCY_KEY))
+ return 0;
+
+ state = g_new0 (FrequencyToolState, 1);
+
+ if (dialog_tool_init (&state->base, wbcg, sheet,
+ GNUMERIC_HELP_LINK_FREQUENCY,
+ "frequency.glade", "Frequency",
+ _("Could not create the Frequency Tool dialog."),
+ FREQUENCY_KEY,
+ G_CALLBACK (frequency_tool_ok_clicked_cb), NULL,
+ G_CALLBACK (frequency_tool_update_sensitivity_cb),
+ 0))
+ return 0;
+
+ state->predetermined_button = GTK_WIDGET (glade_xml_get_widget
+ (state->base.gui,
+ "pre_determined_button"));
+ state->calculated_button = GTK_WIDGET (glade_xml_get_widget
+ (state->base.gui,
+ "calculated_button"));
+ state->n_entry = GTK_ENTRY(glade_xml_get_widget (state->base.gui,
+ "n_entry"));
+
+ g_signal_connect_after (G_OBJECT (state->predetermined_button),
+ "toggled",
+ G_CALLBACK (frequency_tool_update_sensitivity_cb), state);
+ g_signal_connect_after (G_OBJECT (state->calculated_button),
+ "toggled",
+ G_CALLBACK (frequency_tool_update_sensitivity_cb), state);
+ g_signal_connect_after (G_OBJECT (state->n_entry),
+ "changed",
+ G_CALLBACK (frequency_tool_update_sensitivity_cb), state);
+ g_signal_connect (G_OBJECT (state->n_entry),
+ "key-press-event",
+ G_CALLBACK (frequency_tool_set_calculated), state);
+ g_signal_connect (G_OBJECT
+ (gnm_expr_entry_get_entry (
+ GNM_EXPR_ENTRY (state->base.input_entry_2))),
+ "focus-in-event",
+ G_CALLBACK (frequency_tool_set_predetermined), state);
+
+ gnm_dao_set_put (GNM_DAO (state->base.gdao), TRUE, TRUE);
+ frequency_tool_update_sensitivity_cb (NULL, state);
+ tool_load_selection ((GenericToolState *)state, TRUE);
+
+ gtk_widget_set_sensitive (state->n_entry, FALSE);
+ gtk_widget_set_sensitive (state->calculated_button, FALSE);
+
+ return 0;
+}
Modified: trunk/src/dialogs/dialogs.h
==============================================================================
--- trunk/src/dialogs/dialogs.h (original)
+++ trunk/src/dialogs/dialogs.h Sun Oct 12 23:47:06 2008
@@ -87,6 +87,7 @@
int dialog_anova_single_factor_tool (WBCGtk *wbcg, Sheet *sheet);
int dialog_anova_two_factor_tool (WBCGtk *wbcg, Sheet *sheet);
int dialog_histogram_tool (WBCGtk *wbcg, Sheet *sheet);
+int dialog_frequency_tool (WBCGtk *wbcg, Sheet *sheet);
typedef enum {
TTEST_PAIRED = 1,
Added: trunk/src/dialogs/frequency.glade
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/frequency.glade Sun Oct 12 23:47:06 2008
@@ -0,0 +1,480 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+ <widget class="GtkDialog" id="Frequency">
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Histogram</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">5</property>
+ <child>
+ <widget class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkTable" id="input-table">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="var1-label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">Input _range:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">Grouped by:</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkRadioButton" id="grouped_by_col">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Columns</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="grouped_by_row">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Rows</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">grouped_by_col</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="grouped_by_area">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Areas</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">grouped_by_col</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="labels_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Labels</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator4">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Input</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <child>
+ <widget class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Maximum number of categories:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">n_entry</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ <property name="x_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="n_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">*</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ <property name="y_padding">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="calculated_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Automatic Categories</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">pre_determined_button</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator2">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="bin_table">
+ <property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="pre_determined_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="label" translatable="yes">_Predetermined categories </property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="var2-label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">Category _range:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">C_ategories</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkRadioButton" id="nochart-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">No chart</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="barchart-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Bar chart</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">nochart-button</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="columnchart-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Column chart</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">nochart-button</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator5">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="percentage-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Percentages</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Graphs & Options</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="dao">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Output</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="warnings">
+ <property name="visible">True</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="helpbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="cancelbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="okbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
Modified: trunk/src/dialogs/help.h
==============================================================================
--- trunk/src/dialogs/help.h (original)
+++ trunk/src/dialogs/help.h Sun Oct 12 23:47:06 2008
@@ -146,6 +146,9 @@
#define GNUMERIC_HELP_LINK_ANOVA_SINGLE_FACTOR "sect-analysis-statistical"
#define GNUMERIC_HELP_LINK_ANOVA_TWO_FACTOR "sect-analysis-statistical"
+/* dialog-analysis-tool-frequency.c */
+#define GNUMERIC_HELP_LINK_FREQUENCY "sect-analysis-statistical"
+
/* dialog-consolidate.c */
#define GNUMERIC_HELP_LINK_CONSOLIDATE ""
Modified: trunk/src/tools/Makefile.am
==============================================================================
--- trunk/src/tools/Makefile.am (original)
+++ trunk/src/tools/Makefile.am Sun Oct 12 23:47:06 2008
@@ -21,6 +21,8 @@
libtools_la_SOURCES = \
analysis-exp-smoothing.c \
analysis-exp-smoothing.h \
+ analysis-frequency.c \
+ analysis-frequency.h \
analysis-histogram.c \
analysis-histogram.h \
analysis-tools.c \
Added: trunk/src/tools/analysis-frequency.c
==============================================================================
--- (empty file)
+++ trunk/src/tools/analysis-frequency.c Sun Oct 12 23:47:06 2008
@@ -0,0 +1,276 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * analysis-frequency.c:
+ *
+ * Author:
+ * Andreas J. Guelzow <aguelzow pyrshep ca>
+ *
+ * (C) Copyright 2008 by Andreas J. Guelzow <aguelzow pyrshep ca>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gnumeric-config.h>
+#include <glib/gi18n-lib.h>
+#include "gnumeric.h"
+#include "analysis-frequency.h"
+#include "analysis-tools.h"
+#include "value.h"
+#include "ranges.h"
+#include "expr.h"
+#include "func.h"
+#include "numbers.h"
+#include "sheet-object-graph.h"
+#include <goffice/graph/gog-graph.h>
+#include <goffice/graph/gog-object.h>
+#include <goffice/graph/gog-chart.h>
+#include <goffice/graph/gog-plot.h>
+#include <goffice/graph/gog-series.h>
+#include <goffice/utils/go-glib-extras.h>
+
+static gboolean
+analysis_tool_frequency_engine_run (data_analysis_output_t *dao,
+ analysis_tools_data_frequency_t *info)
+{
+ gint i_limit, col;
+ GSList *l;
+
+ GnmFunc *fd_sum;
+ GnmFunc *fd_if;
+ GnmFunc *fd_index;
+ GnmFunc *fd_rows = NULL;
+ GnmFunc *fd_columns = NULL;
+
+ fd_sum = gnm_func_lookup ("SUM", NULL);
+ gnm_func_ref (fd_sum);
+ fd_if = gnm_func_lookup ("IF", NULL);
+ gnm_func_ref (fd_if);
+ fd_index = gnm_func_lookup ("INDEX", NULL);
+ gnm_func_ref (fd_index);
+
+ if (info->percentage) {
+ fd_rows = gnm_func_lookup ("ROWS", NULL);
+ gnm_func_ref (fd_rows);
+ fd_columns = gnm_func_lookup ("COLUMNS", NULL);
+ gnm_func_ref (fd_columns);
+ }
+ /* General Info */
+
+ dao_set_italic (dao, 0, 0, 0, 0);
+ set_cell_text_col (dao, 0, 0, _("/Frequency Table"
+ "/Category"));
+
+ /* Setting up the categories */
+
+ if (info->predetermined) {
+ int row = 2, i, j, i_h_limit, i_w_limit;
+ GnmExpr const *expr_bin;
+ GnmRange range;
+
+ range_init_value (&range, info->bin);
+ i_h_limit = range_height (&range);
+ i_w_limit = range_width (&range);
+ i_limit = i_h_limit * i_w_limit;
+
+ expr_bin = gnm_expr_new_constant (info->bin);
+
+ for (i = 1; i <= i_h_limit; i++)
+ for (j = 1; j <= i_w_limit; j++)
+ dao_set_cell_expr (dao, 0, row++,
+ gnm_expr_new_funcall3
+ (fd_index,
+ gnm_expr_copy (expr_bin),
+ gnm_expr_new_constant (value_new_int (i)),
+ gnm_expr_new_constant (value_new_int (j))));
+ gnm_expr_free (expr_bin);
+ } else {
+ i_limit = info->n;
+ }
+
+ for (l = info->base.input, col = 1; l; col++, l = l->next) {
+ GnmValue *val = value_dup ((GnmValue *)l->data);
+ GnmValue *val_c = NULL;
+ GnmExpr const *expr_count;
+ GnmExpr const *expr_data;
+ GnmExpr const *expr_if;
+ int i, row = 2;
+
+
+ if (info->base.labels) {
+ val_c = value_dup (val);
+ switch (info->base.group_by) {
+ case GROUPED_BY_ROW:
+ val->v_range.cell.a.col++;
+ break;
+ default:
+ val->v_range.cell.a.row++;
+ break;
+ }
+ dao_set_cell_expr (dao, col, 1,
+ gnm_expr_new_funcall1 (fd_index,
+ gnm_expr_new_constant (val_c)));
+ } else {
+ char const *format;
+
+ switch (info->base.group_by) {
+ case GROUPED_BY_ROW:
+ format = _("Row %d");
+ break;
+ case GROUPED_BY_COL:
+ format = _("Column %d");
+ break;
+ default:
+ format = _("Area %d");
+ break;
+ }
+ dao_set_cell_printf (dao, col, 1, format, col);
+ }
+
+ expr_data = gnm_expr_new_constant (val);
+ expr_if = gnm_expr_new_funcall3
+ (fd_if,
+ gnm_expr_new_binary
+ (gnm_expr_copy (expr_data),
+ GNM_EXPR_OP_EQUAL, make_cellref (- col, 0)),
+ gnm_expr_new_constant (value_new_int (1)),
+ gnm_expr_new_constant (value_new_int (0)));
+ expr_count = gnm_expr_new_funcall1 (fd_sum, expr_if);
+
+ if (info->percentage) {
+ dao_set_format (dao, col, 2, col, i_limit + 2, "0.0%");
+ expr_count = gnm_expr_new_binary (expr_count,
+ GNM_EXPR_OP_DIV,
+ gnm_expr_new_binary
+ (gnm_expr_new_funcall1
+ (fd_rows, gnm_expr_copy (expr_data)),
+ GNM_EXPR_OP_MULT,
+ gnm_expr_new_funcall1
+ (fd_columns, expr_data)));
+ } else
+ gnm_expr_free (expr_data);
+
+ for (i = 0; i < i_limit; i++, row++)
+ dao_set_cell_array_expr (dao, col, row, gnm_expr_copy (expr_count));
+
+ gnm_expr_free (expr_count);
+ }
+
+ gnm_func_unref (fd_if);
+ gnm_func_unref (fd_sum);
+ gnm_func_unref (fd_index);
+ if (fd_rows != NULL)
+ gnm_func_unref (fd_rows);
+ if (fd_columns != NULL)
+ gnm_func_unref (fd_columns);
+
+ /* Create Chart if requested */
+ if (info->chart != NO_CHART) {
+ SheetObject *so;
+ GogGraph *graph;
+ GogChart *chart;
+ GogPlot *plot;
+ GogSeries *series;
+ GOData *cats;
+ GOData *values;
+ int ct;
+
+ graph = g_object_new (GOG_GRAPH_TYPE, NULL);
+ chart = GOG_CHART (gog_object_add_by_name (
+ GOG_OBJECT (graph), "Chart", NULL));
+ plot = gog_plot_new_by_name ("GogBarColPlot");
+ if (info->chart == BAR_CHART)
+ go_object_toggle (plot, "horizontal");
+ gog_object_add_by_name (GOG_OBJECT (chart),
+ "Plot", GOG_OBJECT (plot));
+
+ cats = dao_go_data_vector (dao, 0, 2,
+ 0, 2 + i_limit);
+
+ for (ct = 1; ct < col; ct ++) {
+ g_object_ref (cats);
+ values = dao_go_data_vector (dao, ct, 2,
+ ct, 2 + i_limit);
+
+ series = gog_plot_new_series (plot);
+ gog_series_set_dim (series, 0, cats, NULL);
+ gog_series_set_dim (series, 1, values, NULL);
+ }
+ g_object_unref (cats);
+
+ so = sheet_object_graph_new (graph);
+ g_object_unref (graph);
+
+ dao_set_sheet_object (dao, 0, 1, so);
+ }
+
+ dao_redraw_respan (dao);
+
+ return FALSE;
+}
+
+
+static gint
+calc_length (GnmValue *bin)
+{
+ g_return_val_if_fail (bin != NULL, 0);
+ g_return_val_if_fail (bin->type == VALUE_CELLRANGE, 0);
+
+ return ((bin->v_range.cell.b.col - bin->v_range.cell.a.col + 1) *
+ (bin->v_range.cell.b.row - bin->v_range.cell.a.row + 1));
+}
+
+
+gboolean
+analysis_tool_frequency_engine (data_analysis_output_t *dao, gpointer specs,
+ analysis_tool_engine_t selector, gpointer result)
+{
+ analysis_tools_data_frequency_t *info = specs;
+
+ switch (selector) {
+ case TOOL_ENGINE_UPDATE_DESCRIPTOR:
+ return (dao_command_descriptor (dao, _("Frequency Table (%s)"), result)
+ == NULL);
+ case TOOL_ENGINE_UPDATE_DAO:
+ {
+ int i;
+
+ prepare_input_range (&info->base.input, info->base.group_by);
+
+ i = 2 + ((info->predetermined) ? calc_length (info->bin) : info->n);
+
+ dao_adjust (dao, g_slist_length (info->base.input) + 1, i);
+
+ return FALSE;
+ }
+ case TOOL_ENGINE_CLEAN_UP:
+ return analysis_tool_generic_clean (specs);
+ case TOOL_ENGINE_LAST_VALIDITY_CHECK:
+ return FALSE;
+ case TOOL_ENGINE_PREPARE_OUTPUT_RANGE:
+ dao_prepare_output (NULL, dao, _("Frequency Table"));
+ return FALSE;
+ case TOOL_ENGINE_FORMAT_OUTPUT_RANGE:
+ return dao_format_output (dao, _("Frequency Table"));
+ case TOOL_ENGINE_PERFORM_CALC:
+ default:
+ return analysis_tool_frequency_engine_run (dao, specs);
+ }
+ return TRUE;
+}
+
+
+
+
Added: trunk/src/tools/analysis-frequency.h
==============================================================================
--- (empty file)
+++ trunk/src/tools/analysis-frequency.h Sun Oct 12 23:47:06 2008
@@ -0,0 +1,57 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * analysis-frequency.h:
+ *
+ * Author:
+ * Andreas J. Guelzow <aguelzow pyrshep ca>
+ *
+ * (C) Copyright 2008 by Andreas J. Guelzow <aguelzow pyrshep ca>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef ANALYSIS_FREQUENCY_H
+#define ANALYSIS_FREQUENCY_H
+
+#include "gnumeric.h"
+#include "numbers.h"
+#include "dao.h"
+#include "tools.h"
+#include "analysis-tools.h"
+
+typedef enum {
+ NO_CHART = 0,
+ BAR_CHART,
+ COLUMN_CHART
+} chart_freq_t;
+
+
+typedef struct {
+ analysis_tools_data_generic_t base;
+ gboolean predetermined;
+ GnmValue *bin;
+ gnm_float max;
+ gnm_float min;
+ gint n;
+ gboolean percentage;
+ chart_freq_t chart;
+} analysis_tools_data_frequency_t;
+
+gboolean analysis_tool_frequency_engine (data_analysis_output_t *dao, gpointer specs,
+ analysis_tool_engine_t selector, gpointer result);
+
+#endif
Modified: trunk/src/tools/analysis-tools.c
==============================================================================
--- trunk/src/tools/analysis-tools.c (original)
+++ trunk/src/tools/analysis-tools.c Sun Oct 12 23:47:06 2008
@@ -631,7 +631,7 @@
/*
* Set a column of text from a string like "/first/second/third" or "|foo|bar|baz".
*/
-static void
+void
set_cell_text_col (data_analysis_output_t *dao, int col, int row, const char *text)
{
gboolean leave = FALSE;
Modified: trunk/src/tools/analysis-tools.h
==============================================================================
--- trunk/src/tools/analysis-tools.h (original)
+++ trunk/src/tools/analysis-tools.h Sun Oct 12 23:47:06 2008
@@ -248,5 +248,7 @@
void set_cell_text_row (data_analysis_output_t *dao,
int col, int row, const char *text);
+void set_cell_text_col (data_analysis_output_t *dao,
+ int col, int row, const char *text);
#endif
Modified: trunk/src/wbc-gtk-actions.c
==============================================================================
--- trunk/src/wbc-gtk-actions.c (original)
+++ trunk/src/wbc-gtk-actions.c Sun Oct 12 23:47:06 2008
@@ -728,6 +728,7 @@
static GNM_ACTION_DEF (cb_tools_exp_smoothing) { dialog_exp_smoothing_tool (wbcg, wbcg_cur_sheet (wbcg)); }
static GNM_ACTION_DEF (cb_tools_average) { dialog_average_tool (wbcg, wbcg_cur_sheet (wbcg)); }
static GNM_ACTION_DEF (cb_tools_fourier) { dialog_fourier_tool (wbcg, wbcg_cur_sheet (wbcg)); }
+static GNM_ACTION_DEF (cb_tools_frequency) { dialog_frequency_tool (wbcg, wbcg_cur_sheet (wbcg)); }
static GNM_ACTION_DEF (cb_tools_histogram) { dialog_histogram_tool (wbcg, wbcg_cur_sheet (wbcg)); }
static GNM_ACTION_DEF (cb_tools_ranking) { dialog_ranking_tool (wbcg, wbcg_cur_sheet (wbcg)); }
static GNM_ACTION_DEF (cb_tools_regression) { dialog_regression_tool (wbcg, wbcg_cur_sheet (wbcg)); }
@@ -1553,6 +1554,7 @@
{ "MenuToolStatisticalAnalysis", NULL, N_("Statistical Anal_ysis") },
{ "MenuANOVA", NULL, N_("_ANOVA") },
{ "MenuToolForecast", NULL, N_("F_orecast") },
+ { "MenuToolFrequencies", NULL, N_("Fre_quency Tables") },
{ "MenuToolTTest", NULL, N_("Two _Means") },
{ "MenuData", NULL, N_("_Data") },
{ "MenuFilter", NULL, N_("_Filter") },
@@ -1948,6 +1950,14 @@
NULL, N_("Moving average..."),
G_CALLBACK (cb_tools_average) },
+/* Tools -> Frequency Tables */
+ { "ToolsFrequency", NULL, N_("Fre_quency Tables..."),
+ NULL, N_("Frequency tables for non-numeric data"),
+ G_CALLBACK (cb_tools_frequency) },
+ { "ToolsHistogram", NULL, N_("_Histogram..."),
+ NULL, N_("Various frequency tables for numeric data"),
+ G_CALLBACK (cb_tools_histogram) },
+
/* Tools -> Two Means */
{ "ToolTTestPaired", NULL, N_("_Paired Samples: T-Test..."),
NULL, N_("Comparing two population means for two paired samples: t-test..."),
@@ -1978,9 +1988,6 @@
{ "ToolsFourier", NULL, N_("_Fourier Analysis..."),
NULL, N_("Fourier Analysis"),
G_CALLBACK (cb_tools_fourier) },
- { "ToolsHistogram", NULL, N_("_Histogram..."),
- NULL, N_("Various frequency tables"),
- G_CALLBACK (cb_tools_histogram) },
{ "ToolsRanking", NULL, N_("Ranks And _Percentiles..."),
NULL, N_("Ranks, placements and percentiles"),
G_CALLBACK (cb_tools_ranking) },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]