projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch #5209
[pspp]
/
src
/
ui
/
gui
/
data-sheet.c
diff --git
a/src/ui/gui/data-sheet.c
b/src/ui/gui/data-sheet.c
index 1edeb330f8d101abae48aebd58a22ece2f89e433..87dcc5006531b6cddfbad2ee6f0046eab35ea01e 100644
(file)
--- a/
src/ui/gui/data-sheet.c
+++ b/
src/ui/gui/data-sheet.c
@@
-24,24
+24,22
@@
#include <ctype.h>
#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 "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"
#include "menu-actions.h"
#include "data-sheet.h"
-#define _(A) A
-#define N_(A) A
extern GladeXML *xml;
extern GladeXML *xml;
@@
-70,9
+68,10
@@
static gboolean
click2column(GtkWidget *w, gint col, gpointer data)
{
gint current_row, current_column;
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");
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);
gtk_sheet_get_active_cell(GTK_SHEET(var_sheet),
¤t_row, ¤t_column);
@@
-83,29
+82,38
@@
click2column(GtkWidget *w, gint col, gpointer data)
/* Update the data_ref_entry with the reference of the active cell */
/* 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));
/* 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;
}
return FALSE;
}
@@
-119,13
+127,8
@@
psppire_data_sheet_create (gchar *widget_name, gchar *string1, gchar *string2,
gint int1, gint int2)
{
GtkWidget *sheet;
gint int1, gint int2)
{
GtkWidget *sheet;
- gint i;
-
- const gint rows = 10046;
-
- GObject *row_geometry = g_sheet_uniform_row_new(25, rows);
- sheet = gtk_sheet_new(G_SHEET_ROW(
row_geometry
),
+ sheet = gtk_sheet_new(G_SHEET_ROW(
data_store
),
G_SHEET_COLUMN(data_store), "data sheet", 0);
G_SHEET_COLUMN(data_store), "data sheet", 0);
@@
-141,6
+144,7
@@
psppire_data_sheet_create (gchar *widget_name, gchar *string1, gchar *string2,
GTK_SIGNAL_FUNC (click2column),
0);
GTK_SIGNAL_FUNC (click2column),
0);
+ gtk_sheet_set_active_cell(GTK_SHEET(sheet), -1, -1);
gtk_widget_show(sheet);
return sheet;
gtk_widget_show(sheet);
return sheet;