PROP_RUBBER_BANDING,
PROP_ENABLE_GRID_LINES,
PROP_TOOLTIP_COLUMN,
- PROP_SPECIAL_CELLS
+ PROP_SPECIAL_CELLS,
+ PROP_FIXED_HEIGHT,
+ PROP_FIXED_HEIGHT_SET
};
/* object signals */
PSPP_SHEET_VIEW_SPECIAL_CELLS_DETECT,
GTK_PARAM_READWRITE));
+ g_object_class_install_property (o_class,
+ PROP_FIXED_HEIGHT,
+ g_param_spec_int ("fixed-height",
+ P_("Fixed Height"),
+ P_("Height of a single row. Normally the height of a row is determined automatically. Writing this property sets fixed-height-set to true, preventing this property's value from changing."),
+ -1,
+ G_MAXINT,
+ -1,
+ GTK_PARAM_READWRITE));
+
+ g_object_class_install_property (o_class,
+ PROP_FIXED_HEIGHT_SET,
+ g_param_spec_boolean ("fixed-height-set",
+ P_("Fixed Height Set"),
+ P_("Whether fixed-height was set externally."),
+ FALSE,
+ GTK_PARAM_READWRITE));
+
/* Style properties */
#define _TREE_VIEW_EXPANDER_SIZE 12
#define _TREE_VIEW_VERTICAL_SEPARATOR 2
tree_view->priv->presize_handler_timer = 0;
tree_view->priv->scroll_sync_timer = 0;
tree_view->priv->fixed_height = -1;
+ tree_view->priv->fixed_height_set = FALSE;
pspp_sheet_view_set_adjustments (tree_view, NULL, NULL);
tree_view->priv->selection = _pspp_sheet_selection_new_with_tree_view (tree_view);
tree_view->priv->enable_search = TRUE;
case PROP_SPECIAL_CELLS:
pspp_sheet_view_set_special_cells (tree_view, g_value_get_enum (value));
break;
+ case PROP_FIXED_HEIGHT:
+ pspp_sheet_view_set_fixed_height (tree_view, g_value_get_int (value));
+ break;
+ case PROP_FIXED_HEIGHT_SET:
+ if (g_value_get_boolean (value))
+ {
+ if (!tree_view->priv->fixed_height_set
+ && tree_view->priv->fixed_height >= 0)
+ {
+ tree_view->priv->fixed_height_set = true;
+ g_object_notify (G_OBJECT (tree_view), "fixed-height-set");
+ }
+ }
+ else
+ {
+ if (tree_view->priv->fixed_height_set)
+ {
+ tree_view->priv->fixed_height_set = false;
+ g_object_notify (G_OBJECT (tree_view), "fixed-height-set");
+ install_presize_handler (tree_view);
+ }
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_SPECIAL_CELLS:
g_value_set_enum (value, tree_view->priv->special_cells);
break;
+ case PROP_FIXED_HEIGHT:
+ g_value_set_int (value, pspp_sheet_view_get_fixed_height (tree_view));
+ break;
+ case PROP_FIXED_HEIGHT_SET:
+ g_value_set_boolean (value, tree_view->priv->fixed_height_set);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
if (!tree_view->priv->row_count)
return;
+ if (tree_view->priv->fixed_height_set)
+ return;
+
if (tree_view->priv->fixed_height < 0)
{
GtkTreeIter iter;
tree_view->priv->fixed_height = validate_row (tree_view, node, &iter, path);
gtk_tree_path_free (path);
+
+ g_object_notify (G_OBJECT (tree_view), "fixed-height");
}
}
}
}
+int
+pspp_sheet_view_get_fixed_height (const PsppSheetView *tree_view)
+{
+ /* XXX (re)calculate fixed_height if necessary */
+ return tree_view->priv->fixed_height;
+}
+
+void
+pspp_sheet_view_set_fixed_height (PsppSheetView *tree_view,
+ int fixed_height)
+{
+ g_return_if_fail (fixed_height > 0);
+
+ if (tree_view->priv->fixed_height != fixed_height)
+ {
+ tree_view->priv->fixed_height = fixed_height;
+ g_object_notify (G_OBJECT (tree_view), "fixed-height");
+ }
+ if (!tree_view->priv->fixed_height_set)
+ {
+ tree_view->priv->fixed_height_set = TRUE;
+ g_object_notify (G_OBJECT (tree_view), "fixed-height-set");
+ }
+}
+
/**
* pspp_sheet_view_set_tooltip_row:
* @tree_view: a #PsppSheetView