{
GdaExGridPrivate *priv;
+ _Column *col;
+
g_return_if_fail (GDAEX_IS_GRID (grid));
g_return_if_fail (GDAEX_IS_GRID_COLUMN (column));
priv = GDAEX_GRID_GET_PRIVATE (grid);
- g_ptr_array_add (priv->columns, g_memdup (column, sizeof (GdaExGridColumn)));
+ col = g_new0 (_Column, 1);
+ col->view_col = NULL;
+ col->grid_col = g_memdup (column, sizeof (GdaExGridColumn));
+
+ g_ptr_array_add (priv->columns, col);
}
void
{
gchar *title;
gchar *field_name;
+ GType type;
gboolean visible;
gboolean resizable;
gboolean sortable;
priv->title = NULL;
priv->field_name = NULL;
+ priv->type = G_TYPE_NONE;
priv->visible = FALSE;
priv->resizable = FALSE;
priv->sortable = FALSE;
GdaExGridColumn
*gdaex_grid_column_new (const gchar *title,
const gchar *field_name,
+ GType type,
gboolean visible,
gboolean resizable,
gboolean sortable,
gdaex_grid_column_set_title (gdaex_grid_column, title);
gdaex_grid_column_set_field_name (gdaex_grid_column, field_name);
+ gdaex_grid_column_set_gtype (gdaex_grid_column, type);
gdaex_grid_column_set_visible (gdaex_grid_column, visible);
gdaex_grid_column_set_resizable (gdaex_grid_column, resizable);
gdaex_grid_column_set_sortable (gdaex_grid_column, sortable);
return (const gchar *)g_strdup (priv->field_name);
}
+void
+gdaex_grid_column_set_gtype (GdaExGridColumn *column, GType type)
+{
+ g_return_if_fail (GDAEX_IS_GRID_COLUMN (column));
+
+ GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (column);
+
+ priv->type = type;
+}
+
+GType
+gdaex_grid_column_get_gtype (GdaExGridColumn *column)
+{
+ g_return_val_if_fail (GDAEX_IS_GRID_COLUMN (column), G_TYPE_NONE);
+
+ GdaExGridColumnPrivate *priv = GDAEX_GRID_COLUMN_GET_PRIVATE (column);
+
+ return priv->type;
+}
+
void
gdaex_grid_column_set_visible (GdaExGridColumn *column, gboolean visible)
{
GdaExGridColumn *gdaex_grid_column_new (const gchar *title,
const gchar *field_name,
+ GType type,
gboolean visible,
gboolean resizable,
gboolean sortable,
void gdaex_grid_column_set_field_name (GdaExGridColumn *column, const gchar *field_name);
const gchar *gdaex_grid_column_get_field_name (GdaExGridColumn *column);
+void gdaex_grid_column_set_gtype (GdaExGridColumn *column, GType type);
+GType gdaex_grid_column_get_gtype (GdaExGridColumn *column);
+
void gdaex_grid_column_set_visible (GdaExGridColumn *column, gboolean visible);
gboolean gdaex_grid_column_get_visible (GdaExGridColumn *column);