#include "ui/gui/psppire-encoding-selector.h"
#include "ui/gui/psppire-syntax-window.h"
#include "ui/gui/psppire-window.h"
-#include "ui/gui/psppire-data-sheet.h"
-#include "ui/gui/psppire-var-sheet.h"
#include "ui/gui/windows-menu.h"
#include "ui/gui/goto-case-dialog.h"
#include "ui/gui/psppire.h"
#include "gl/c-strcasestr.h"
#include "gl/xvasprintf.h"
+#include "ui/gui/efficient-sheet/jmd-sheet.h"
+
#include "find-dialog.h"
#include "psppire-dialog-action-1sks.h"
#include "psppire-dialog-action-aggregate.h"
static void
on_cut (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_cut (ds);
}
+#endif
}
+
+
static void
on_copy (PsppireDataWindow *dw)
{
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
- PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
- psppire_data_sheet_edit_copy (ds);
+ GtkClipboard *clip =
+ gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (dw)),
+ GDK_SELECTION_CLIPBOARD);
+
+ jmd_sheet_set_clip (JMD_SHEET (dw->data_editor->data_sheet), clip);
}
}
static void
on_paste (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_paste (ds);
}
+#endif
}
static void
on_clear_cases (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_clear_cases (ds);
}
+#endif
}
static void
on_clear_variables (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
{
psppire_var_sheet_clear_variables (PSPPIRE_VAR_SHEET (dw->data_editor->var_sheet));
}
+#endif
}
+
static void
insert_variable (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
{
psppire_var_sheet_insert_variable (PSPPIRE_VAR_SHEET (dw->data_editor->var_sheet));
}
+#endif
}
+
static void
insert_case_at_row (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_insert_case (ds);
+#endif
}
+
+
static void
goto_case (PsppireDataWindow *dw)
{
+#if SHEET_MERGE
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
goto_case_dialog (ds);
+#endif
}
-
static GtkWidget *
create_file_menu (PsppireDataWindow *dw)
{
return menuitem;
}
+
static GtkWidget *
create_edit_menu (PsppireDataWindow *dw)
{
return menuitem;
}
-
static void
psppire_data_window_finish_init (PsppireDataWindow *de,
struct dataset *ds)
G_CALLBACK (on_split_change),
de);
- g_signal_connect_swapped (de->dict, "backend-changed",
+ g_signal_connect_swapped (de->dict, "changed",
G_CALLBACK (enable_save), de);
g_signal_connect_swapped (de->dict, "variable-inserted",
G_CALLBACK (enable_save), de);
ll_push_head (&all_data_windows, &de->ll);
}
+
static void
psppire_data_window_dispose (GObject *object)
{
}
+
GtkWidget*
psppire_data_window_new (struct dataset *ds)
{
return dw;
}
+
+
bool
psppire_data_window_is_empty (PsppireDataWindow *dw)
{
return psppire_dict_get_var_cnt (dw->dict) == 0;
}
+
static void
psppire_data_window_iface_init (PsppireWindowIface *iface)
{
\f
+
PsppireDataWindow *
psppire_default_data_window (void)
{
return ll_data (ll_head (&all_data_windows), PsppireDataWindow, ll);
}
+
+
void
psppire_data_window_set_default (PsppireDataWindow *pdw)
{
ll_push_tail (&all_data_windows, &pdw->ll);
}
+
+
PsppireDataWindow *
psppire_data_window_for_dataset (struct dataset *ds)
{
return NULL;
}
+#if SHEET_MERGE
+
PsppireDataWindow *
psppire_data_window_for_data_store (PsppireDataStore *data_store)
{
return NULL;
}
+#endif
+
GtkWindow *
create_data_window (void)
{
return GTK_WINDOW (w);
}
+
+
void
open_data_window (PsppireWindow *victim, const char *file_name,
const char *encoding, gpointer hint)