- shentry_allocation.x = column_left_xpixel (sheet, sheet->active_cell.col);
- shentry_allocation.y = g_sheet_row_start_pixel (sheet->row_geometry, sheet->active_cell.row);
- if ( sheet->column_titles_visible)
- shentry_allocation.y += sheet->column_title_area.height;
-
- shentry_allocation.y -= sheet->vadjustment->value;
-
- if ( sheet->row_titles_visible)
- shentry_allocation.x += sheet->row_title_area.width;
-
- shentry_allocation.x -= sheet->hadjustment->value;
-
- shentry_allocation.width = column_width;
- shentry_allocation.height = g_sheet_row_get_height (sheet->row_geometry, sheet->active_cell.row);
-
- if (GTK_IS_ITEM_ENTRY (sheet->entry_widget))
- {
- shentry_allocation.height -= 2 * COLUMN_TITLES_HEIGHT;
- shentry_allocation.y += COLUMN_TITLES_HEIGHT;
- shentry_allocation.width = size;
-
- switch (GTK_ITEM_ENTRY (sheet_entry)->justification)
- {
- case GTK_JUSTIFY_CENTER:
- shentry_allocation.x += column_width / 2 - size / 2;
- break;
- case GTK_JUSTIFY_RIGHT:
- shentry_allocation.x += column_width - size - COLUMN_TITLES_HEIGHT;
- break;
- case GTK_JUSTIFY_LEFT:
- case GTK_JUSTIFY_FILL:
- shentry_allocation.x += COLUMN_TITLES_HEIGHT;
- break;
- }
- }
-
- if (!GTK_IS_ITEM_ENTRY (sheet->entry_widget))
- {
- shentry_allocation.x += 2;
- shentry_allocation.y += 2;
- shentry_allocation.width -= MIN (shentry_allocation.width, 3);
- shentry_allocation.height -= MIN (shentry_allocation.height, 3);
- }
-
- gtk_widget_size_allocate (sheet->entry_widget, &shentry_allocation);
-
- if (previous_style == style) g_object_unref (previous_style);
-}
-
-static void
-gtk_sheet_entry_set_max_size (GtkSheet *sheet)
-{
- gint i;
- gint size = 0;
- gint sizel = 0, sizer = 0;
- gint row, col;
- GtkJustification justification;
- gchar *s = NULL;
-
- row = sheet->active_cell.row;
- col = sheet->active_cell.col;
-
- if ( ! GTK_IS_ITEM_ENTRY (sheet->entry_widget) )
- return;
-
- justification = GTK_ITEM_ENTRY (sheet->entry_widget)->justification;
-
- switch (justification)
- {
- case GTK_JUSTIFY_FILL:
- case GTK_JUSTIFY_LEFT:
- for (i = col + 1; i <= max_visible_column (sheet); i++)
- {
- if ((s = gtk_sheet_cell_get_text (sheet, row, i)))
- {
- g_free (s);
- break;
- }
- size +=g_sheet_column_get_width (sheet->column_geometry, i);
- }
- size = MIN (size, sheet->sheet_window_width - column_left_xpixel (sheet, col));
- break;
- case GTK_JUSTIFY_RIGHT:
- for (i = col - 1; i >= min_visible_column (sheet); i--)
- {
- if ((s = gtk_sheet_cell_get_text (sheet, row, i)))
- {
- g_free (s);
- break;
- }
- size +=g_sheet_column_get_width (sheet->column_geometry, i);
- }
- break;
- case GTK_JUSTIFY_CENTER:
- for (i = col + 1; i <= max_visible_column (sheet); i++)
- {
- sizer += g_sheet_column_get_width (sheet->column_geometry, i);
- }
- for (i = col - 1; i >= min_visible_column (sheet); i--)
- {
- if ((s = gtk_sheet_cell_get_text (sheet, row, i)))
- {
- g_free (s);
- break;
- }
- sizel +=g_sheet_column_get_width (sheet->column_geometry, i);
- }
- size = 2 * MIN (sizel, sizer);
- break;
- }
-
- if (size != 0)
- size += g_sheet_column_get_width (sheet->column_geometry, col);
- GTK_ITEM_ENTRY (sheet->entry_widget)->text_max_size = size;