-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.0 on Tue Jun 16 22:17:34 2009 -->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="output-viewer-window">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="default_width">600</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="GtkImageMenuItem" id="file_save">
+ <property name="label">gtk-save</property>
<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">gtk-save</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="label">gtk-save-as</property>
<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">gtk-save-as</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</widget>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkImageMenuItem" id="imagemenuitem7">
+ <property name="label">gtk-copy</property>
<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">gtk-copy</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</widget>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <widget class="GtkHPaned" id="hpaned1">
<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_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="position">112</property>
+ <property name="position_set">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkTreeView" id="overview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
<child>
- <widget class="GtkLayout" id="output">
+ <widget 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">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkLayout" id="output">
+ <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>
+ </widget>
+ </child>
</widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
</child>
</widget>
<packing>
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
-
+enum
+ {
+ COL_TITLE, /* Table title. */
+ N_COLS
+ };
static void psppire_output_window_base_finalize (PsppireOutputWindowClass *, gpointer);
static void psppire_output_window_base_init (PsppireOutputWindowClass *class);
cairo_t *cairo = gdk_cairo_create (GDK_DRAWABLE (window));
struct outp_driver *driver = xr_create_driver (cairo); /* XXX can fail */
struct tab_table *t = entity->ext;
+ GtkTreeStore *store;
+ GtkTreeIter item;
+ GtkTreePath *path;
GtkWidget *drawing_area;
void *rendering;
int tw, th;
gtk_layout_set_size (the_output_viewer->output,
the_output_viewer->max_width, the_output_viewer->y);
+
+ store = GTK_TREE_STORE (gtk_tree_view_get_model (
+ the_output_viewer->overview));
+ if (entity->table_num != the_output_viewer->last_table_num)
+ {
+ gtk_tree_store_append (store, &item, NULL);
+ gtk_tree_store_set (store, &item, COL_TITLE, entity->command_name,
+ -1);
+
+ /* XXX shouldn't save a GtkTreeIter */
+ the_output_viewer->last_table_num = entity->table_num;
+ the_output_viewer->last_top_level = item;
+ }
+ gtk_tree_store_append (store, &item,
+ &the_output_viewer->last_top_level);
+ gtk_tree_store_set (store, &item, COL_TITLE,
+ t->title ? t->title : "(unnamed)", -1);
+
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (store),
+ &the_output_viewer->last_top_level);
+ gtk_tree_view_expand_row (the_output_viewer->overview, path, TRUE);
+ gtk_tree_path_free (path);
}
gtk_window_set_urgency_hint (GTK_WINDOW (the_output_viewer), TRUE);
static void
psppire_output_window_init (PsppireOutputWindow *window)
{
- GtkBuilder *xml = builder_new ("output-viewer.ui");
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkBuilder *xml;
+
+ xml = builder_new ("output-viewer.ui");
gtk_widget_reparent (get_widget_assert (xml, "vbox1"), GTK_WIDGET (window));
window->output = GTK_LAYOUT (get_widget_assert (xml, "output"));
window->y = 0;
+ window->overview = GTK_TREE_VIEW (get_widget_assert (xml, "overview"));
+ gtk_tree_view_set_model (window->overview,
+ GTK_TREE_MODEL (gtk_tree_store_new (
+ N_COLS,
+ G_TYPE_STRING))); /* COL_TITLE */
+ window->last_table_num = -1;
+
+ column = gtk_tree_view_column_new ();
+ gtk_tree_view_append_column (GTK_TREE_VIEW (window->overview), column);
+ renderer = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_start (column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute (column, renderer, "text", COL_TITLE);
+
gtk_widget_modify_bg (GTK_WIDGET (window->output), GTK_STATE_NORMAL,
>k_widget_get_style (GTK_WIDGET (window->output))->base[GTK_STATE_NORMAL]);