PROP_QUICK_EDIT,
PROP_SELECTED,
PROP_SELECTABLE,
- PROP_ROW_HEAD
+ PROP_ROW_HEAD,
+ PROP_TABBABLE
};
enum
P_("If true, this column is a \"row head\", equivalent to a column head. If rectangular selection is enabled, then shift+click and control+click in the column select row ranges and toggle row selection, respectively. The column should ordinarily include a button cell; clicking on the button will select the row (and deselect all other rows)."),
FALSE,
GTK_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_TABBABLE,
+ g_param_spec_boolean ("tabbable",
+ P_("Tabbable"),
+ P_("If true, Tab and Shift+Tab visit this column. If false, Tab and Shift+Tab skip this column."),
+ TRUE,
+ GTK_PARAM_READWRITE));
}
static void
tree_column->selected = FALSE;
tree_column->selectable = TRUE;
tree_column->row_head = FALSE;
+ tree_column->tabbable = TRUE;
tree_column->sort_order = GTK_SORT_ASCENDING;
tree_column->show_sort_indicator = FALSE;
tree_column->property_changed_signal = 0;
g_value_get_boolean (value));
break;
+ case PROP_TABBABLE:
+ pspp_sheet_view_column_set_tabbable (tree_column,
+ g_value_get_boolean (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
pspp_sheet_view_column_get_row_head (tree_column));
break;
+ case PROP_TABBABLE:
+ g_value_set_boolean (value,
+ pspp_sheet_view_column_get_tabbable (tree_column));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
if (pspp_sheet_selection_get_mode (selection) == PSPP_SHEET_SELECTION_RECTANGLE)
{
pspp_sheet_selection_select_all (selection);
- pspp_sheet_selection_unselect_all_columns (selection);
- pspp_sheet_selection_select_column (selection, column);
+ if (pspp_sheet_view_column_get_row_head (column))
+ pspp_sheet_selection_select_all_columns (selection);
+ else
+ {
+ pspp_sheet_selection_unselect_all_columns (selection);
+ pspp_sheet_selection_select_column (selection, column);
+ }
sheet_view->priv->anchor_column = column;
return TRUE;
}
* Return value: the title of the column. This string should not be
* modified or freed.
**/
-G_CONST_RETURN gchar *
+const gchar *
pspp_sheet_view_column_get_title (PsppSheetViewColumn *tree_column)
{
g_return_val_if_fail (PSPP_IS_SHEET_VIEW_COLUMN (tree_column), NULL);
{
g_return_if_fail (PSPP_IS_SHEET_VIEW_COLUMN (tree_column));
- expand = expand?TRUE:FALSE;
+ expand = !!expand;
if (tree_column->expand == expand)
return;
tree_column->expand = expand;
/* if (reorderable)
pspp_sheet_view_column_set_clickable (tree_column, TRUE);*/
- if (tree_column->reorderable == (reorderable?TRUE:FALSE))
+ reorderable = !!reorderable;
+ if (tree_column->reorderable == reorderable)
return;
- tree_column->reorderable = (reorderable?TRUE:FALSE);
+ tree_column->reorderable = reorderable;
pspp_sheet_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "reorderable");
}
quick_edit = !!quick_edit;
if (tree_column->quick_edit != quick_edit)
{
- tree_column->quick_edit = (quick_edit?TRUE:FALSE);
+ tree_column->quick_edit = quick_edit;
g_object_notify (G_OBJECT (tree_column), "quick-edit");
}
}
if (tree_column->tree_view != NULL)
gtk_widget_queue_draw (GTK_WIDGET (tree_column->tree_view));
- tree_column->selected = (selected?TRUE:FALSE);
+ tree_column->selected = selected;
g_object_notify (G_OBJECT (tree_column), "selected");
sheet_view = PSPP_SHEET_VIEW (pspp_sheet_view_column_get_tree_view (
{
if (tree_column->tree_view != NULL)
gtk_widget_queue_draw (GTK_WIDGET (tree_column->tree_view));
- tree_column->selectable = (selectable?TRUE:FALSE);
+ tree_column->selectable = selectable;
g_object_notify (G_OBJECT (tree_column), "selectable");
}
}
row_head = !!row_head;
if (tree_column->row_head != row_head)
{
- tree_column->row_head = (row_head?TRUE:FALSE);
+ tree_column->row_head = row_head;
g_object_notify (G_OBJECT (tree_column), "row_head");
}
}
}
+/**
+ * pspp_sheet_view_column_set_tabbable:
+ * @tree_column: A #PsppSheetViewColumn
+ * @tabbable: If true, the column is "tabbable", meaning that Tab and Shift+Tab
+ * in the sheet visit this column. If false, Tab and Shift+Tab skip this
+ * column.
+ **/
+void
+pspp_sheet_view_column_set_tabbable (PsppSheetViewColumn *tree_column,
+ gboolean tabbable)
+{
+ g_return_if_fail (PSPP_IS_SHEET_VIEW_COLUMN (tree_column));
+
+ tabbable = !!tabbable;
+ if (tree_column->tabbable != tabbable)
+ {
+ tree_column->tabbable = tabbable;
+ g_object_notify (G_OBJECT (tree_column), "tabbable");
+ }
+}
+
+/**
+ * pspp_sheet_view_column_get_tabbable:
+ * @tree_column: A #PsppSheetViewColumn
+ *
+ * Returns %TRUE if the column is tabbable.
+ *
+ * Return value: %TRUE if the column is tabbable.
+ **/
+gboolean
+pspp_sheet_view_column_get_tabbable (PsppSheetViewColumn *tree_column)
+{
+ g_return_val_if_fail (PSPP_IS_SHEET_VIEW_COLUMN (tree_column), FALSE);
+
+ return tree_column->tabbable;
+}
+
+
/**
* pspp_sheet_view_column_set_sort_column_id:
* @tree_column: a #PsppSheetViewColumn