#include <ctype.h>
-#include "gtksheet.h"
+#include <gtksheet/gtksheet.h>
-#include "gsheet-uniform-row.h"
+#include <gtksheet/gsheet-uniform-row.h>
#include "psppire-dict.h"
#include "psppire-variable.h"
#include "psppire-data-store.h"
#include "helper.h"
-#include "value-labels.h"
-#include "case.h"
-#include "data-in.h"
+#include <data/value-labels.h>
+#include <data/case.h>
+#include <data/data-in.h>
#include "menu-actions.h"
#include "data-sheet.h"
-#define _(A) A
-#define N_(A) A
extern GladeXML *xml;
click2column(GtkWidget *w, gint col, gpointer data)
{
gint current_row, current_column;
- select_sheet(PAGE_VAR_SHEET);
GtkWidget *var_sheet = get_widget_assert(xml, "variable_sheet");
+ select_sheet(PAGE_VAR_SHEET);
+
gtk_sheet_get_active_cell(GTK_SHEET(var_sheet),
¤t_row, ¤t_column);
/* Update the data_ref_entry with the reference of the active cell */
-static gint
-update_data_ref_entry(GtkSheet *sheet, gint row, gint col)
+gint
+update_data_ref_entry(const GtkSheet *sheet, gint row, gint col)
{
+
/* The entry where the reference to the current cell is displayed */
GtkEntry *cell_ref_entry;
PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(sheet));
+ if (data_store)
+ {
+ const struct PsppireVariable *pv =
+ psppire_dict_get_variable(data_store->dict, col);
+ gchar *text ;
+ gchar *s ;
- if ( !xml)
- return FALSE;
-
- const struct PsppireVariable *pv =
- psppire_dict_get_variable(data_store->dict, col);
+ if ( !xml)
+ return FALSE;
- gchar *text = g_strdup_printf("%d: %s", row,
- pv ? psppire_variable_get_name(pv) : "");
+ text = g_strdup_printf("%d: %s", row,
+ pv ? psppire_variable_get_name(pv) : "");
- cell_ref_entry = GTK_ENTRY(get_widget_assert(xml, "cell_ref_entry"));
+ cell_ref_entry = GTK_ENTRY(get_widget_assert(xml, "cell_ref_entry"));
+
+ s = pspp_locale_to_utf8(text, -1, 0);
+
+ g_free(text);
- gtk_entry_set_text(cell_ref_entry, text);
+ gtk_entry_set_text(cell_ref_entry, s);
- g_free(text);
+ g_free(s);
+ }
return FALSE;
}
gint int1, gint int2)
{
GtkWidget *sheet;
- gint i;
const gint rows = 10046;
GTK_SIGNAL_FUNC (click2column),
0);
+ gtk_sheet_set_active_cell(GTK_SHEET(sheet), -1, -1);
gtk_widget_show(sheet);
return sheet;