X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgtk-contrib%2Fpsppire-sheet.c;h=4119037d9c0ef02ed74e4cf69bb8c35ccdc9f609;hb=ebda03f4d53b24d1af3de9fd7dcbbf448401d5a9;hp=74b8be9723185e39d4ad59b64072a696c926b4f7;hpb=b16fdbecf0fb0ffc27b7d77e92c62e7f847c7248;p=pspp-builds.git diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c index 74b8be97..4119037d 100644 --- a/lib/gtk-contrib/psppire-sheet.c +++ b/lib/gtk-contrib/psppire-sheet.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2006, 2008 Free Software Foundation + Copyright (C) 2006, 2008, 2009 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -69,7 +69,9 @@ #include "psppire-sheet.h" #include #include +#include #include + #include /* sheet flags */ @@ -2098,6 +2100,13 @@ psppire_sheet_unmap (GtkWidget *widget) gtk_widget_unmap (sheet->button); } +/* get cell attributes of the given cell */ +/* TRUE means that the cell is currently allocated */ +static gboolean psppire_sheet_get_attributes (const PsppireSheet *sheet, + gint row, gint col, + PsppireSheetCellAttr *attributes); + + static void psppire_sheet_cell_draw (PsppireSheet *sheet, gint row, gint col) @@ -4747,6 +4756,26 @@ draw_button (PsppireSheet *sheet, GdkWindow *window, allocation.x, allocation.y, allocation.width, allocation.height); + if ( button->overstruck) + { + GdkPoint points[2] = { + {allocation.x, allocation.y}, + {allocation.x + allocation.width, + allocation.y + allocation.height} + }; + + gtk_paint_polygon (sheet->button->style, + window, + button->state, + shadow_type, + NULL, + GTK_WIDGET (sheet), + "button", + points, + 2, + TRUE); + } + if (button->label_visible) { text_height = DEFAULT_ROW_HEIGHT - @@ -5228,7 +5257,7 @@ set_row_height (PsppireSheet *sheet, } } -gboolean +static gboolean psppire_sheet_get_attributes (const PsppireSheet *sheet, gint row, gint col, PsppireSheetCellAttr *attr) { @@ -5251,8 +5280,6 @@ psppire_sheet_get_attributes (const PsppireSheet *sheet, gint row, gint col, attr->border.mask = 0; attr->border.color = GTK_WIDGET (sheet)->style->black; - attr->is_editable = psppire_sheet_model_is_editable (sheet->model, row, col); - colormap = gtk_widget_get_colormap (GTK_WIDGET (sheet)); fg = psppire_sheet_model_get_foreground (sheet->model, row, col); if ( fg ) @@ -5335,6 +5362,7 @@ psppire_sheet_button_new (void) button->label = NULL; button->label_visible = TRUE; button->justification = GTK_JUSTIFY_FILL; + button->overstruck = FALSE; return button; }