mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-08-13 14:35:00 -05:00
Make 'notes' field span columns. Work on header drawing.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3491 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -67,10 +67,12 @@ gnucash_header_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
||||
SheetBlockStyle *style = header->style;
|
||||
Table *table = header->sheet->table;
|
||||
VirtualLocation virt_loc;
|
||||
VirtualCell *vcell;
|
||||
CellDimensions *cd;
|
||||
GdkColor *bg_color;
|
||||
int xpaint, ypaint;
|
||||
const char *text;
|
||||
CellBlock *cb;
|
||||
GdkFont *font;
|
||||
guint32 argb;
|
||||
int i, j;
|
||||
@@ -109,10 +111,15 @@ gnucash_header_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
||||
gdk_gc_set_foreground (header->gc, &gn_black);
|
||||
font = gnucash_register_font;
|
||||
|
||||
vcell = gnc_table_get_virtual_cell
|
||||
(table, table->current_cursor_loc.vcell_loc);
|
||||
cb = vcell ? vcell->cellblock : NULL;
|
||||
|
||||
ypaint = -y;
|
||||
h = 0;
|
||||
|
||||
for (i = 0; i < style->nrows; i++) {
|
||||
for (i = 0; i < style->nrows; i++)
|
||||
{
|
||||
xpaint = -x;
|
||||
virt_loc.phys_row_offset = i;
|
||||
|
||||
@@ -120,9 +127,12 @@ gnucash_header_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
||||
Can we abstract at least the cell drawing routine?
|
||||
That way we'll be sure everything is drawn
|
||||
consistently, and cut down on maintenance issues. */
|
||||
for (j = 0; j < style->ncols; j++) {
|
||||
|
||||
for (j = 0; j < style->ncols; j++)
|
||||
{
|
||||
gint x_offset, y_offset;
|
||||
GdkRectangle rect;
|
||||
CellBlockCell *cb_cell;
|
||||
|
||||
virt_loc.phys_col_offset = j;
|
||||
|
||||
@@ -133,6 +143,13 @@ gnucash_header_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
||||
else
|
||||
w = cd->pixel_width;
|
||||
|
||||
cb_cell = gnc_cellblock_get_cell (cb, i, j);
|
||||
if (!cb_cell || cb_cell->cell_type < 0)
|
||||
{
|
||||
xpaint += w;
|
||||
continue;
|
||||
}
|
||||
|
||||
h = cd->pixel_height;
|
||||
|
||||
gdk_draw_rectangle (drawable, header->gc, FALSE,
|
||||
@@ -161,7 +178,8 @@ gnucash_header_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
||||
case CELL_ALIGN_CENTER:
|
||||
if (w < gdk_string_measure (font, text))
|
||||
x_offset = CELL_HPADDING;
|
||||
else {
|
||||
else
|
||||
{
|
||||
x_offset = w / 2;
|
||||
x_offset -= gdk_string_measure (font, text) / 2;
|
||||
}
|
||||
|
||||
@@ -273,8 +273,11 @@ set_cell (SplitRegister *reg, CellBlock *cursor,
|
||||
cb_cell->label = g_strdup (hcell->value);
|
||||
cb_cell->sample_text = g_strdup (_(ss->string + ss->offset));
|
||||
cb_cell->alignment = cell_alignments[cell_type];
|
||||
cb_cell->expandable = reg->cells[cell_type] == (BasicCell *) reg->descCell;
|
||||
cb_cell->span = reg->cells[cell_type] == (BasicCell *) reg->memoCell;
|
||||
cb_cell->expandable =
|
||||
reg->cells[cell_type] == (BasicCell *) reg->descCell;
|
||||
cb_cell->span =
|
||||
reg->cells[cell_type] == (BasicCell *) reg->memoCell ||
|
||||
reg->cells[cell_type] == (BasicCell *) reg->notesCell;
|
||||
|
||||
cb_cell = gnc_cellblock_get_cell (reg->cursor_header, row, col);
|
||||
|
||||
@@ -287,7 +290,9 @@ set_cell (SplitRegister *reg, CellBlock *cursor,
|
||||
cb_cell->alignment = cell_alignments[cell_type];
|
||||
cb_cell->expandable =
|
||||
reg->cells[cell_type] == (BasicCell *) reg->descCell;
|
||||
cb_cell->span = reg->cells[cell_type] == (BasicCell *) reg->memoCell;
|
||||
cb_cell->span =
|
||||
reg->cells[cell_type] == (BasicCell *) reg->memoCell ||
|
||||
reg->cells[cell_type] == (BasicCell *) reg->notesCell;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user