X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-sheet.c;h=970da7dfbcb491c81ce21e3f0ee5a3cb38c51189;hb=fc3f48c05a02829466ab0dc472c96be3e14259e3;hp=dfd5ce1c4c7732ad1f102309da2de65313599368;hpb=f481fd69631024bcdc7dc2369bbc1592d7a43ac7;p=pspp diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c index dfd5ce1c4c..970da7dfbc 100644 --- a/src/ui/gui/psppire-var-sheet.c +++ b/src/ui/gui/psppire-var-sheet.c @@ -225,8 +225,8 @@ on_var_column_edited (GtkCellRendererText *cell, format = *var_get_print_format (var); fmt_change_width (&format, width, var_sheet->format_use); - var_set_print_format (var, &format); var_set_width (var, fmt_var_width (&format)); + var_set_both_formats (var, &format); } break; @@ -342,16 +342,10 @@ render_var_cell (PsppSheetViewColumn *tree_column, break; case VS_WIDTH: - { - int step = fmt_step_width (print->type); - if (var_is_numeric (var)) - set_spin_cell (cell, print->w, - fmt_min_width (print->type, var_sheet->format_use), - fmt_max_width (print->type, var_sheet->format_use), - step); - else - set_spin_cell (cell, print->w, 0, 0, step); - } + set_spin_cell (cell, print->w, + fmt_min_width (print->type, var_sheet->format_use), + fmt_max_width (print->type, var_sheet->format_use), + fmt_step_width (print->type)); break; case VS_DECIMALS: @@ -1060,6 +1054,16 @@ psppire_var_sheet_row_number_double_clicked (PsppireCellRendererButton *button, gtk_tree_path_free (path); } +static void +psppire_var_sheet_variables_column_clicked (PsppSheetViewColumn *column, + PsppireVarSheet *var_sheet) +{ + PsppSheetView *sheet_view = PSPP_SHEET_VIEW (var_sheet); + PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); + + pspp_sheet_selection_select_all (selection); +} + static PsppSheetViewColumn * make_row_number_column (PsppireVarSheet *var_sheet) { @@ -1074,9 +1078,14 @@ make_row_number_column (PsppireVarSheet *var_sheet) column = pspp_sheet_view_column_new_with_attributes (_("Variable"), renderer, NULL); + pspp_sheet_view_column_set_clickable (column, TRUE); pspp_sheet_view_column_set_cell_data_func ( column, renderer, render_row_number_cell, var_sheet, NULL); pspp_sheet_view_column_set_fixed_width (column, 50); + g_signal_connect (column, "clicked", + G_CALLBACK (psppire_var_sheet_variables_column_clicked), + var_sheet); + return column; }