$(top_builddir)/src/ui/gui/syntax-editor.ui \
$(top_builddir)/src/ui/gui/text-data-import.ui \
$(top_builddir)/src/ui/gui/t-test.ui \
- $(top_builddir)/src/ui/gui/var-sheet-dialogs.ui
+ $(top_builddir)/src/ui/gui/var-sheet-dialogs.ui \
+ $(top_builddir)/src/ui/gui/variable-info-dialog.ui
dist_src_ui_gui_psppire_DATA = \
src/ui/gui/syntax-editor.glade \
src/ui/gui/text-data-import.glade \
src/ui/gui/t-test.glade \
- src/ui/gui/var-sheet-dialogs.glade
+ src/ui/gui/var-sheet-dialogs.glade \
+ src/ui/gui/variable-info-dialog.glade
nodist_src_ui_gui_psppire_SOURCES = \
g_type_add_interface_static (dialog_type,
GTK_TYPE_BUILDABLE,
&buildable_info);
-
}
return dialog_type;
enum
{
PROP_0,
- PROP_ORIENTATION
+ PROP_ORIENTATION,
+ PROP_SLIDING
};
{
case PROP_ORIENTATION:
{
- if ( GTK_IS_VBOX (dialog->box) )
+ if ( GTK_IS_VBOX (dialog->box) || GTK_VPANED (dialog->box))
g_value_set_enum (value, PSPPIRE_VERTICAL);
- else if ( GTK_IS_HBOX (dialog->box))
+ else if ( GTK_IS_HBOX (dialog->box) || GTK_HPANED (dialog->box))
g_value_set_enum (value, PSPPIRE_HORIZONTAL);
else if ( GTK_IS_TABLE (dialog->box))
g_value_set_enum (value, PSPPIRE_TABULAR);
}
break;
+ case PROP_SLIDING:
+ g_value_set_boolean (value, dialog->slidable);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
static void
-dialog_set_orientation (PsppireDialog *dialog, const GValue *orval)
+dialog_set_container (PsppireDialog *dialog)
{
- PsppireOrientation orientation = g_value_get_enum (orval);
-
if ( dialog->box != NULL)
{
gtk_container_remove (GTK_CONTAINER (dialog), dialog->box);
}
- switch ( orientation )
+ switch (dialog->orientation)
{
case PSPPIRE_HORIZONTAL:
- dialog->box = gtk_hbox_new (FALSE, 5);
+ if ( dialog->slidable)
+ dialog->box = gtk_hpaned_new();
+ else
+ dialog->box = gtk_hbox_new (FALSE, 5);
break;
case PSPPIRE_VERTICAL:
- dialog->box = gtk_vbox_new (FALSE, 5);
+ if ( dialog->slidable)
+ dialog->box = gtk_vpaned_new();
+ else
+ dialog->box = gtk_vbox_new (FALSE, 5);
break;
case PSPPIRE_TABULAR:
dialog->box = gtk_table_new (2, 3, FALSE);
break;
}
+ gtk_widget_show_all (dialog->box);
gtk_container_add (GTK_CONTAINER (dialog), dialog->box);
}
switch (prop_id)
{
+ case PROP_SLIDING:
+ dialog->slidable = g_value_get_boolean (value);
+ break;
case PROP_ORIENTATION:
- dialog_set_orientation (dialog, value);
+ dialog->orientation = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
};
+
+ dialog_set_container (dialog);
}
{
GObjectClass *object_class = (GObjectClass *) class;
+ GParamSpec *sliding_spec ;
orientation_spec =
g_param_spec_enum ("orientation",
PSPPIRE_HORIZONTAL /* default value */,
G_PARAM_CONSTRUCT_ONLY |G_PARAM_READWRITE);
+ sliding_spec =
+ g_param_spec_boolean ("slidable",
+ "Slidable",
+ "Can the container be sized by the user",
+ FALSE,
+ G_PARAM_CONSTRUCT_ONLY |G_PARAM_READWRITE);
+
+
object_class->set_property = psppire_dialog_set_property;
object_class->get_property = psppire_dialog_get_property;
orientation_spec);
+ g_object_class_install_property (object_class,
+ PROP_SLIDING,
+ sliding_spec);
+
+
signals [DIALOG_REFRESH] =
g_signal_new ("refresh",
dialog->box = NULL;
dialog->contents_are_valid = NULL;
dialog->validity_data = NULL;
+ dialog->slidable = FALSE;
g_value_init (&value, orientation_spec->value_type);
g_param_value_set_default (orientation_spec, &value);
gtk_window_set_type_hint (GTK_WINDOW (dialog),
GDK_WINDOW_TYPE_HINT_DIALOG);
- dialog_set_orientation (dialog, &value);
-
g_value_unset (&value);
g_signal_connect (dialog, "delete-event",
GDK_WINDOW_TYPE_HINT_DIALOG);
g_object_set (dialog, "icon-name", "psppicon", NULL);
-
- gtk_widget_show_all (dialog->box);
}
typedef gboolean (*ContentsAreValid) (gpointer);
+typedef enum
+ {
+ PSPPIRE_HORIZONTAL,
+ PSPPIRE_VERTICAL,
+ PSPPIRE_TABULAR
+ } PsppireOrientation;
+
+
struct _PsppireDialog
{
ContentsAreValid contents_are_valid;
gpointer validity_data;
+ gboolean slidable;
+ PsppireOrientation orientation;
};
struct _PsppireDialogClass
GType psppire_orientation_get_type (void);
-typedef enum
- {
- PSPPIRE_HORIZONTAL,
- PSPPIRE_VERTICAL,
- PSPPIRE_TABULAR
- } PsppireOrientation;
-
#define G_TYPE_PSPPIRE_ORIENTATION (psppire_orientation_get_type ())
</widget>
</child>
</widget>
- <widget class="PsppireDialog" id="variable-info-dialog">
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="title">Variables</property>
- <property name="modal">True</property>
- <child internal-child="hbox">
- <widget class="GtkHBox" id="dialog-hbox6">
- <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">5</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow11">
- <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">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <child>
- <widget class="GtkTreeView" id="treeview2">
- <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>
- <property name="reorderable">True</property>
- <property name="fixed_height_mode">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox23">
- <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">5</property>
- <child>
- <widget class="GtkLabel" id="label24">
- <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="xalign">0</property>
- <property name="label" translatable="yes">Variable Information:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <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">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <child>
- <widget class="GtkTextView" id="textview1">
- <property name="height_request">200</property>
- <property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="editable">False</property>
- <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
- <property name="left_margin">3</property>
- <property name="cursor_visible">False</property>
- <property name="accepts_tab">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="PsppireHButtonBox" id="psppire-hbuttonbox3">
- <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="border_width">5</property>
- <property name="homogeneous">True</property>
- <property name="buttons">PSPPIRE_BUTTON_GOTO_MASK | PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK | PSPPIRE_BUTTON_PASTE_MASK</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">5</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="PsppireDialog" id="select-cases-range-dialog">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="title">Select Cases: Range</property>
gint response ;
- GtkBuilder *xml = builder_new ("psppire.ui");
+ GtkBuilder *xml = builder_new ("variable-info-dialog.ui");
GtkWidget *dialog = get_widget_assert (xml, "variable-info-dialog");
GtkWidget *treeview = get_widget_assert (xml, "treeview2");
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+ <requires lib="psppire"/>
+ <widget class="PsppireDialog" id="variable-info-dialog">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="title">Variables</property>
+ <property name="modal">True</property>
+ <property name="slidable">True</property>
+ <child internal-child="hbox">
+ <widget class="GtkHPaned" id="dialog-hbox2">
+ <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>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow13">
+ <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">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview2">
+ <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>
+ <property name="reorderable">True</property>
+ <property name="fixed_height_mode">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox23">
+ <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">5</property>
+ <child>
+ <widget class="GtkLabel" id="label24">
+ <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="xalign">0</property>
+ <property name="label" translatable="yes">Variable Information:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow14">
+ <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">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTextView" id="textview1">
+ <property name="height_request">200</property>
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
+ <property name="left_margin">3</property>
+ <property name="cursor_visible">False</property>
+ <property name="accepts_tab">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="PsppireHButtonBox" id="psppire-hbuttonbox4">
+ <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="border_width">5</property>
+ <property name="homogeneous">True</property>
+ <property name="buttons">PSPPIRE_BUTTON_GOTO_MASK | PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK | PSPPIRE_BUTTON_PASTE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>