Implemented a dialog box for the ROC command
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 12 Dec 2009 15:48:02 +0000 (16:48 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 12 Dec 2009 15:48:02 +0000 (16:48 +0100)
src/ui/gui/automake.mk
src/ui/gui/data-editor.glade
src/ui/gui/psppire-data-window.c
src/ui/gui/roc-dialog.c [new file with mode: 0644]
src/ui/gui/roc-dialog.h [new file with mode: 0644]
src/ui/gui/roc.ui [new file with mode: 0644]

index f2f0b813b8c83cf9256f0dfcceb5df47c09a41e5..22e2350b5156cfd02d2e198abdde130dd5d9175a 100644 (file)
@@ -67,6 +67,7 @@ UI_FILES = \
        src/ui/gui/recode.ui \
        src/ui/gui/regression.ui \
        src/ui/gui/reliability.ui \
+       src/ui/gui/roc.ui \
        src/ui/gui/t-test.ui \
        src/ui/gui/text-data-import.ui \
        src/ui/gui/var-sheet-dialogs.ui \
@@ -187,6 +188,8 @@ src_ui_gui_psppire_SOURCES = \
        src/ui/gui/regression-dialog.h \
        src/ui/gui/reliability-dialog.c \
        src/ui/gui/reliability-dialog.h \
+       src/ui/gui/roc-dialog.c \
+       src/ui/gui/roc-dialog.h \
        src/ui/gui/select-cases-dialog.c \
        src/ui/gui/select-cases-dialog.h \
        src/ui/gui/sort-cases-dialog.c \
index 06776248738df3cbea663edeca39e2934b910037..ca7efc90aff231c0f970f1f71a37352e2b1b1386 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
+<?xml version="1.0"?>
 <glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
   <widget class="GtkMenuBar" id="menubar">
     <property name="visible">True</property>
     <child>
@@ -13,8 +13,8 @@
           <widget class="GtkMenu" id="menuitem1_menu">
             <child>
               <widget class="GtkImageMenuItem" id="new1">
-                <property name="visible">True</property>
                 <property name="label">gtk-new</property>
+                <property name="visible">True</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
                 <child>
@@ -39,8 +39,8 @@
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="open1">
-                <property name="visible">True</property>
                 <property name="label">gtk-open</property>
+                <property name="visible">True</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
                 <child>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="file_save">
-                <property name="visible">True</property>
                 <property name="label">gtk-save</property>
+                <property name="visible">True</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="file_save_as">
-                <property name="visible">True</property>
                 <property name="label">gtk-save-as</property>
+                <property name="visible">True</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="file_quit">
-                <property name="visible">True</property>
                 <property name="label">gtk-quit</property>
+                <property name="visible">True</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="edit_goto-case">
+                <property name="label">Go To Case</property>
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="label" translatable="yes">Go To Case</property>
                 <property name="use_underline">True</property>
+                <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="edit_cut">
+                <property name="label">gtk-cut</property>
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="label">gtk-cut</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="edit_copy">
+                <property name="label">gtk-copy</property>
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="label">gtk-copy</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="edit_paste">
+                <property name="label">gtk-paste</property>
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="label">gtk-paste</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="edit_find">
+                <property name="label">gtk-find</property>
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="label" translatable="yes">gtk-find</property>
                 <property name="use_underline">True</property>
                 <property name="use_stock">True</property>
               </widget>
           <widget class="GtkMenu" id="data_menu">
             <child>
               <widget class="GtkImageMenuItem" id="data_sort-cases">
+                <property name="label">_Sort Cases</property>
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">_Sort Cases</property>
                 <property name="use_underline">True</property>
-                <child internal-child="image">
-                  <widget class="GtkImage" id="menu-item-image1">
-                    <property name="visible">True</property>
-                    <property name="stock">gtk-sort-ascending</property>
-                  </widget>
-                </child>
+                <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
                 <property name="sensitive">False</property>
                 <property name="label" translatable="yes">_Run Pending Transforms</property>
                 <property name="use_underline">True</property>
-                <accelerator key="G" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                <accelerator key="G" signal="activate" modifiers="GDK_CONTROL_MASK"/>
               </widget>
             </child>
           </widget>
                 </child>
               </widget>
             </child>
+            <child>
+              <widget class="GtkMenuItem" id="roc-curve">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">ROC Cur_ve...</property>
+                <property name="use_underline">True</property>
+              </widget>
+            </child>
           </widget>
         </child>
       </widget>
           <widget class="GtkMenu" id="menuitem5_menu">
             <child>
               <widget class="GtkImageMenuItem" id="help_reference">
+                <property name="label">_Reference Manual</property>
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">_Reference Manual</property>
                 <property name="use_underline">True</property>
-                <child internal-child="image">
-                  <widget class="GtkImage" id="menu-item-image2">
-                    <property name="visible">True</property>
-                    <property name="stock">gtk-help</property>
-                  </widget>
-                </child>
+                <property name="use_stock">True</property>
               </widget>
             </child>
             <child>
               <widget class="GtkImageMenuItem" id="help_about">
+                <property name="label">_About</property>
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">_About</property>
                 <property name="use_underline">True</property>
-                <child internal-child="image">
-                  <widget class="GtkImage" id="menu-item-image3">
-                    <property name="visible">True</property>
-                    <property name="stock">gtk-about</property>
-                  </widget>
-                </child>
+                <property name="use_stock">True</property>
               </widget>
             </child>
           </widget>
   </widget>
   <widget class="GtkHandleBox" id="handlebox1">
     <property name="visible">True</property>
-    <property name="shadow_type">GTK_SHADOW_OUT</property>
     <child>
       <widget class="GtkToolbar" id="toolbar1">
         <property name="visible">True</property>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
-          <widget class="GtkSeparatorToolItem" id="separatortoolitem1">
-          </widget>
+          <widget class="GtkSeparatorToolItem" id="separatortoolitem1"/>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="homogeneous">False</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
         <child>
           </widget>
           <packing>
             <property name="expand">False</property>
+            <property name="homogeneous">True</property>
           </packing>
         </child>
       </widget>
       <widget class="GtkFrame" id="frame2">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox1">
             <property name="visible">True</property>
           </widget>
         </child>
       </widget>
+      <packing>
+        <property name="position">0</property>
+      </packing>
     </child>
     <child>
       <widget class="GtkFrame" id="frame3">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox2">
             <property name="visible">True</property>
       <widget class="GtkFrame" id="frame5">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox4">
             <property name="visible">True</property>
       <widget class="GtkFrame" id="frame6">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox5">
             <property name="visible">True</property>
             <child>
               <widget class="GtkLabel" id="filter-use-status-area">
                 <property name="visible">True</property>
-                <property name="ellipsize">PANGO_ELLIPSIZE_START</property>
+                <property name="ellipsize">start</property>
                 <property name="width_chars">10</property>
                 <property name="single_line_mode">True</property>
               </widget>
       <widget class="GtkFrame" id="frame7">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox6">
             <property name="visible">True</property>
             <child>
               <widget class="GtkLabel" id="weight-status-area">
                 <property name="visible">True</property>
-                <property name="ellipsize">PANGO_ELLIPSIZE_START</property>
+                <property name="ellipsize">start</property>
                 <property name="width_chars">15</property>
                 <property name="single_line_mode">True</property>
               </widget>
       <widget class="GtkFrame" id="frame8">
         <property name="visible">True</property>
         <property name="label_xalign">0</property>
-        <property name="shadow_type">GTK_SHADOW_IN</property>
+        <property name="shadow_type">in</property>
         <child>
           <widget class="GtkEventBox" id="eventbox7">
             <property name="visible">True</property>
             <child>
               <widget class="GtkLabel" id="split-file-status-area">
                 <property name="visible">True</property>
-                <property name="ellipsize">PANGO_ELLIPSIZE_START</property>
+                <property name="ellipsize">start</property>
                 <property name="width_chars">15</property>
                 <property name="single_line_mode">True</property>
               </widget>
index 2707498c7929038cafc9d55f1e85f0ad93ad0272..e42d2bd08875f7d296ab5067ffe62703b16624ce 100644 (file)
@@ -56,6 +56,7 @@
 #include "examine-dialog.h"
 #include "regression-dialog.h"
 #include "reliability-dialog.h"
+#include "roc-dialog.h"
 #include "oneway-anova-dialog.h"
 #include "t-test-independent-samples-dialog.h"
 #include "t-test-one-sample.h"
@@ -1692,6 +1693,20 @@ psppire_data_window_init (PsppireDataWindow *de)
                      G_CALLBACK (reliability_dialog), de);
   }
 
+  {
+    GtkAction *invoke_roc_dialog =
+      resolve_action (de->builder, "roc-curve", NULL);
+
+    g_object_set (invoke_roc_dialog,
+                 "tooltip", _("ROC Curve"),
+                 "stock-id", "pspp-roc",
+                 NULL
+                 );
+
+    g_signal_connect (invoke_roc_dialog, "activate",
+                     G_CALLBACK (roc_dialog), de);
+  }
+
 
   {
     GtkUIManager *uim = GTK_UI_MANAGER (get_object_assert (de->builder, "uimanager1", GTK_TYPE_UI_MANAGER));
diff --git a/src/ui/gui/roc-dialog.c b/src/ui/gui/roc-dialog.c
new file mode 100644 (file)
index 0000000..6896ef7
--- /dev/null
@@ -0,0 +1,239 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2009  Free Software Foundation
+
+   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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dialog-common.h"
+#include <language/syntax-string-source.h>
+#include <ui/syntax-gen.h>
+#include <libpspp/str.h>
+
+#include "roc-dialog.h"
+#include "psppire-selector.h"
+#include "psppire-dictview.h"
+#include "psppire-dialog.h"
+
+#include "psppire-data-window.h"
+#include "psppire-var-view.h"
+
+#include "executor.h"
+#include "helper.h"
+
+#include <gtk/gtk.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+struct roc
+{
+  PsppireDict *dict;
+
+  GtkWidget *test_variables;
+  GtkWidget *state_variable;
+  GtkWidget *state_value;
+
+  GtkWidget *curve;
+  GtkWidget *reference;
+  GtkWidget *standard_error;
+  GtkWidget *coordinates;
+};
+
+
+static char * generate_syntax (const struct roc *rd);
+
+
+static void
+refresh (struct roc *rd)
+{
+  GtkTreeModel *liststore =
+    gtk_tree_view_get_model (GTK_TREE_VIEW (rd->test_variables));
+  gtk_list_store_clear (GTK_LIST_STORE (liststore));
+
+  gtk_entry_set_text (GTK_ENTRY (rd->state_variable), "");
+  gtk_entry_set_text (GTK_ENTRY (rd->state_value), "");
+
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->curve),          TRUE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->reference),      FALSE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->standard_error), FALSE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->coordinates),    FALSE);
+}
+
+
+static gboolean
+dialog_state_valid (gpointer data)
+{
+  struct roc *rd = data;
+  const gchar *text;
+
+  GtkTreeModel *liststore =
+    gtk_tree_view_get_model (GTK_TREE_VIEW (rd->test_variables));
+
+  if  (gtk_tree_model_iter_n_children (liststore, NULL) < 1)
+    return FALSE;
+
+  
+  text = gtk_entry_get_text (GTK_ENTRY (rd->state_variable));
+  if ( 0 == strcmp ("", text))
+    return FALSE;
+
+
+  text = gtk_entry_get_text (GTK_ENTRY (rd->state_value));
+  if ( 0 == strcmp ("", text))
+    return FALSE;
+
+
+  return TRUE;
+}
+
+
+/* Pops up the Roc dialog box */
+void
+roc_dialog (GObject *o, gpointer data)
+{
+  struct roc rd;
+  gint response;
+
+  GtkBuilder *xml = builder_new ("roc.ui");
+  PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
+  PsppireVarStore *vs;
+
+  GtkWidget *dialog = get_widget_assert   (xml, "roc-dialog");
+  GtkWidget *source = get_widget_assert   (xml, "dict-view");
+
+  rd.test_variables    = get_widget_assert   (xml, "psppire-var-view1");
+  rd.state_variable    = get_widget_assert   (xml, "entry1");
+  rd.state_value       = get_widget_assert   (xml, "entry2");
+
+  rd.curve          = get_widget_assert   (xml, "curve");
+  rd.reference      = get_widget_assert   (xml, "reference-line");
+  rd.standard_error = get_widget_assert   (xml, "standard-error");
+  rd.coordinates    = get_widget_assert   (xml, "co-ordinates");
+
+
+  g_object_get (de->data_editor, "var-store", &vs, NULL);
+
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de));
+
+  g_object_get (vs, "dictionary", &rd.dict, NULL);
+  g_object_set (source, "model", rd.dict, NULL);
+
+  g_signal_connect_swapped (dialog, "refresh", G_CALLBACK (refresh),  &rd);
+
+  psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (dialog),
+                                     dialog_state_valid, &rd);
+
+  response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
+
+  switch (response)
+    {
+    case GTK_RESPONSE_OK:
+      {
+       gchar *syntax = generate_syntax (&rd);
+
+       struct getl_interface *sss = create_syntax_string_source (syntax);
+       execute_syntax (sss);
+
+       g_free (syntax);
+      }
+      break;
+    case PSPPIRE_RESPONSE_PASTE:
+      {
+       gchar *syntax = generate_syntax (&rd);
+        paste_syntax_in_new_window (syntax);
+
+       g_free (syntax);
+      }
+      break;
+    default:
+      break;
+    }
+
+  g_object_unref (xml);
+}
+
+
+\f
+
+static char *
+generate_syntax (const struct roc *rd)
+{
+  gchar *text;
+  const gchar *var_name = gtk_entry_get_text (GTK_ENTRY (rd->state_variable));
+  GString *string = g_string_new ("ROC");
+
+  psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->test_variables), 0, string);
+
+  g_string_append (string, " BY ");
+
+  g_string_append (string, var_name);
+
+  g_string_append (string, " (");
+  {
+    const gchar *value = gtk_entry_get_text (GTK_ENTRY (rd->state_value));
+
+    const struct variable *var = psppire_dict_lookup_var (rd->dict, var_name);
+
+    g_return_val_if_fail (var, NULL);
+
+    if ( var_is_alpha (var))
+      {
+       struct string xx;
+       ds_init_empty (&xx);
+       syntax_gen_string (&xx, ss_cstr (value));
+       g_string_append (string, ds_cstr (&xx));
+       ds_destroy (&xx);
+      }
+    else
+      g_string_append (string, value);
+  }
+  g_string_append (string, ")");
+
+
+  /* The /PLOT subcommand */
+  g_string_append (string, "\n\t/PLOT ");
+  if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->curve)))
+    {
+      g_string_append (string, "CURVE");
+      if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference)))
+       g_string_append (string, " (REFERENCE)");
+    }
+  else
+    g_string_append (string, "NONE");
+
+
+  /* The /PRINT subcommand */
+  if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error)) ||
+       gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates)) )
+    {
+      g_string_append (string, "\n\t/PRINT");
+
+      if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error)))
+       g_string_append (string, " SE");
+
+      if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates)))
+       g_string_append (string, " COORDINATES");
+    }
+
+  g_string_append (string, ".\n");
+
+  text = string->str;
+
+  g_string_free (string, FALSE);
+
+  return text;
+}
diff --git a/src/ui/gui/roc-dialog.h b/src/ui/gui/roc-dialog.h
new file mode 100644 (file)
index 0000000..0244980
--- /dev/null
@@ -0,0 +1,25 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2009  Free Software Foundation
+
+   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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef __ROC_DIALOG_H
+#define __ROC_DIALOG_H
+
+
+#include <gtk/gtk.h>
+
+void roc_dialog (GObject *o, gpointer data);
+
+#endif
diff --git a/src/ui/gui/roc.ui b/src/ui/gui/roc.ui
new file mode 100644 (file)
index 0000000..8bb82cc
--- /dev/null
@@ -0,0 +1,317 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="psppire" version="2054.17080"/>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy project-wide -->
+  <object class="PsppireDialog" id="roc-dialog">
+    <property name="title">ROC Curve</property>
+    <property name="modal">True</property>
+    <child internal-child="hbox">
+      <object class="GtkHBox" id="dialog-hbox1">
+        <property name="visible">True</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkTable" id="table1">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="n_rows">3</property>
+            <property name="n_columns">3</property>
+            <child>
+              <object class="PsppireSelector" id="dep-selector">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="no_show_all">True</property>
+                <property name="border_width">5</property>
+                <property name="source_widget">dict-view</property>
+                <property name="dest_widget">psppire-var-view1</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="x_options"></property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="PsppireSelector" id="indep-selector">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="no_show_all">True</property>
+                <property name="border_width">5</property>
+                <property name="source_widget">dict-view</property>
+                <property name="dest_widget">entry1</property>
+              </object>
+              <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="x_options"></property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkScrolledWindow" id="variables">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="hscrollbar_policy">never</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">etched-in</property>
+                <child>
+                  <object class="PsppireDictView" id="dict-view">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="headers_visible">False</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame2">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="hscrollbar_policy">never</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <property name="shadow_type">etched-in</property>
+                        <child>
+                          <object class="PsppireVarView" id="psppire-var-view1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="border_width">5</property>
+                            <property name="headers_visible">False</property>
+                            <property name="headers_clickable">False</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="label" translatable="yes">_Test Variable:</property>
+                    <property name="use_markup">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame1">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkEntry" id="entry1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">&#x2022;</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">_State Variable:</property>
+                    <property name="use_markup">True</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkHBox" id="hbox1">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkLabel" id="label4">
+                        <property name="visible">True</property>
+                        <property name="xalign">1</property>
+                        <property name="label" translatable="yes">_Value of state variable:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">entry2</property>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkEntry" id="entry2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">&#x2022;</property>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame3">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment3">
+                        <property name="visible">True</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkVButtonBox" id="vbuttonbox1">
+                            <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkCheckButton" id="curve">
+                                <property name="label" translatable="yes">ROC C_urve</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="reference-line">
+                                <property name="label" translatable="yes">_With diagonal reference line</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">12</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="standard-error">
+                                <property name="label" translatable="yes">Standard _Error and Confidence Interval</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="co-ordinates">
+                                <property name="label" translatable="yes">_Coordinate points of the ROC Curve</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label3">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Display</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options">GTK_FILL</property>
+                <property name="x_padding">5</property>
+                <property name="y_padding">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="PsppireVButtonBox" id="psppire-vbuttonbox1">
+            <property name="visible">True</property>
+            <property name="border_width">5</property>
+            <property name="orientation">vertical</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>