static void gtk_sheet_row_title_button_draw (GtkSheet *sheet, gint row);
-static void gtk_sheet_set_row_height (GtkSheet * sheet,
- gint row,
+static void gtk_sheet_set_row_height (GtkSheet *sheet,
+ gint row,
guint height);
static gboolean gtk_sheet_cell_empty (const GtkSheet *, gint, gint);
/* Memory allocation routines */
-static void gtk_sheet_real_range_clear (GtkSheet *sheet,
- const GtkSheetRange *range);
-
static void gtk_sheet_real_cell_clear (GtkSheet *sheet,
gint row,
gint column);
return g_sheet_column_get_column_count (sheet->column_geometry);
}
-guint
-gtk_sheet_get_rows_count (GtkSheet *sheet)
-{
- g_return_val_if_fail (sheet != NULL, 0);
- g_return_val_if_fail (GTK_IS_SHEET (sheet), 0);
-
- return g_sheet_row_get_row_count (sheet->row_geometry);
-}
-
-void
-gtk_sheet_set_selection_mode (GtkSheet *sheet, gint mode)
-{
- g_return_if_fail (sheet != NULL);
- g_return_if_fail (GTK_IS_SHEET (sheet));
-
- if (GTK_WIDGET_REALIZED (sheet))
- gtk_sheet_real_unselect_range (sheet, NULL);
-
- sheet->selection_mode = mode;
-}
-
static void
gtk_sheet_set_column_width (GtkSheet * sheet,
gint column,
}
}
-
-
-void
-gtk_sheet_set_row_titles_width (GtkSheet *sheet, guint width)
-{
- if (width < COLUMN_MIN_WIDTH) return;
-
- sheet->row_title_area.width = width;
-
- adjust_scrollbars (sheet);
-
- if (sheet->hadjustment)
- g_signal_emit_by_name (sheet->hadjustment,
- "value_changed");
- size_allocate_global_button (sheet);
-}
-
-void
-gtk_sheet_set_column_titles_height (GtkSheet *sheet, guint height)
-{
- if (height < default_row_height (sheet))
- return;
-
- sheet->column_title_area.height = height;
-
- adjust_scrollbars (sheet);
-
- if (sheet->vadjustment)
- g_signal_emit_by_name (sheet->vadjustment,
- "value_changed");
- size_allocate_global_button (sheet);
-}
-
void
gtk_sheet_show_column_titles (GtkSheet *sheet)
{
}
-void
-gtk_sheet_columns_set_resizable (GtkSheet *sheet, gboolean resizable)
-{
- g_return_if_fail (sheet != NULL);
- g_return_if_fail (GTK_IS_SHEET (sheet));
-
- sheet->columns_resizable = resizable;
-}
-
-gboolean
+static gboolean
gtk_sheet_columns_resizable (GtkSheet *sheet)
{
g_return_val_if_fail (sheet != NULL, FALSE);
}
-void
-gtk_sheet_rows_set_resizable (GtkSheet *sheet, gboolean resizable)
-{
- g_return_if_fail (sheet != NULL);
- g_return_if_fail (GTK_IS_SHEET (sheet));
-
- sheet->rows_resizable = resizable;
-}
-
-gboolean
+static gboolean
gtk_sheet_rows_resizable (GtkSheet *sheet)
{
g_return_val_if_fail (sheet != NULL, FALSE);
dispose_string (sheet, old_text);
}
-void
-gtk_sheet_range_clear (GtkSheet *sheet, const GtkSheetRange *range)
-{
- g_return_if_fail (sheet != NULL);
- g_return_if_fail (GTK_IS_SHEET (sheet));
-
- gtk_sheet_real_range_clear (sheet, range);
-}
-
-static void
-gtk_sheet_real_range_clear (GtkSheet *sheet, const GtkSheetRange *range)
-{
- gint i, j;
- GtkSheetRange clear;
-
- if (!range)
- {
- clear.row0 = 0;
- clear.rowi = g_sheet_row_get_row_count (sheet->row_geometry) - 1;
- clear.col0 = 0;
- clear.coli = g_sheet_column_get_column_count (sheet->column_geometry) - 1;
- }
- else
- clear=*range;
-
- clear.row0 = MAX (clear.row0, 0);
- clear.col0 = MAX (clear.col0, 0);
- clear.rowi = MIN (clear.rowi, g_sheet_row_get_row_count (sheet->row_geometry) - 1 );
- clear.coli = MIN (clear.coli, g_sheet_column_get_column_count (sheet->column_geometry) - 1 );
-
- for (i = clear.row0; i <= clear.rowi; i++)
- for (j = clear.col0; j <= clear.coli; j++)
- {
- gtk_sheet_real_cell_clear (sheet, i, j);
- }
-
- gtk_sheet_range_draw (sheet, NULL);
-}
static gboolean
G_BEGIN_DECLS
-
-typedef enum
-{
- GTK_SHEET_FOREGROUND,
- GTK_SHEET_BACKGROUND,
- GTK_SHEET_FONT,
- GTK_SHEET_JUSTIFICATION,
- GTK_SHEET_BORDER,
- GTK_SHEET_BORDER_COLOR,
- GTK_SHEET_IS_EDITABLE,
- GTK_SHEET_IS_VISIBLE
-} GtkSheetAttrType;
-
/* sheet->state */
-
enum
{
GTK_SHEET_NORMAL,
#define GTK_IS_SHEET(obj) GTK_CHECK_TYPE (obj, gtk_sheet_get_type ())
-
-
typedef struct _GtkSheetClass GtkSheetClass;
typedef struct _GtkSheetCellAttr GtkSheetCellAttr;
typedef struct _GtkSheetCell GtkSheetCell;
/* get cell contents */
gchar *gtk_sheet_cell_get_text (const GtkSheet *sheet, gint row, gint col);
-/* clear cell contents */
-void gtk_sheet_cell_clear (GtkSheet *sheet, gint row, gint col);
-
-/* clear range contents. If range==NULL the whole sheet will be cleared */
-void gtk_sheet_range_clear (GtkSheet *sheet,
- const GtkSheetRange *range);
-
/* get cell attributes of the given cell */
/* TRUE means that the cell is currently allocated */
gint row, gint col,
GtkSheetCellAttr *attributes);
-void gtk_sheet_set_model (GtkSheet *sheet,
+void gtk_sheet_set_model (GtkSheet *sheet,
GSheetModel *model);
GSheetModel * gtk_sheet_get_model (const GtkSheet *sheet);