54 GnucashSheet *sheet = cursor->sheet;
55 VirtualCellLocation vcell_loc;
61 vcell_loc.virt_row = cursor->row;
62 vcell_loc.virt_col = cursor->col;
64 block = gnucash_sheet_get_block (sheet, vcell_loc);
72 for (col = 0; col < vcell->cellblock->num_cols; col++)
77 if (cell && cell->cell_name)
83 cd = gnucash_style_get_cell_dimensions (block->
style, 0, col);
89 for (col = vcell->cellblock->num_cols - 1; col >= 0; col--)
94 if (cell && cell->cell_name)
98 *h = block->
style->dimensions->height;
100 cd = gnucash_style_get_cell_dimensions (block->
style, 0, col);
102 *w = cd->origin_x + cd->pixel_width - *x;
104 *w = block->
style->dimensions->width - *x;
109 gnucash_cursor_set_style (
GnucashCursor *cursor, SheetBlockStyle *style)
111 g_return_if_fail (cursor != NULL);
112 g_return_if_fail (GNUCASH_IS_CURSOR(cursor));
114 cursor->style = style;
119 gnucash_cursor_get_virt (
GnucashCursor *cursor, VirtualLocation *virt_loc)
121 g_return_if_fail (cursor != NULL);
122 g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
124 virt_loc->vcell_loc.virt_row = cursor->row;
125 virt_loc->vcell_loc.virt_col = cursor->col;
127 virt_loc->phys_row_offset = cursor->cell.row;
128 virt_loc->phys_col_offset = cursor->cell.col;
135 gint x = 0, y = 0, w = 0, h = 0;
137 g_return_if_fail (cursor != NULL);
138 g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
143 g_return_if_fail (GTK_IS_LAYOUT (cursor->sheet));
145 gnucash_cursor_get_pixel_coords (cursor, &x, &y, &w, &h);
151 gnucash_sheet_style_get_cell_pixel_rel_coords (cursor->style,
152 cursor->cell.row, cursor->cell.col,
161 gnucash_cursor_set_block (
GnucashCursor *cursor, VirtualCellLocation vcell_loc)
165 g_return_if_fail (cursor != NULL);
166 g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
168 sheet = cursor->sheet;
170 if (vcell_loc.virt_row < 0 ||
171 vcell_loc.virt_row >= sheet->num_virt_rows ||
172 vcell_loc.virt_col < 0 ||
173 vcell_loc.virt_col >= sheet->num_virt_cols)
176 cursor->style = gnucash_sheet_get_style (sheet, vcell_loc);
177 cursor->row = vcell_loc.virt_row;
178 cursor->col = vcell_loc.virt_col;
183 gnucash_cursor_set_cell (
GnucashCursor *cursor, gint cell_row, gint cell_col)
185 SheetBlockStyle *style;
187 g_return_if_fail (cursor != NULL);
188 g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
190 style = cursor->style;
192 if (cell_row < 0 || cell_row >= style->nrows ||
193 cell_col < 0 || cell_col >= style->ncols)
196 cursor->cell.row = cell_row;
197 cursor->cell.col = cell_col;
202 gnucash_cursor_set (
GnucashCursor *cursor, VirtualLocation virt_loc)
206 g_return_if_fail (cursor != NULL);
207 g_return_if_fail (GNUCASH_IS_CURSOR (cursor));
209 sheet = cursor->sheet;
211 gnucash_cursor_set_block (cursor, virt_loc.vcell_loc);
212 gnucash_cursor_set_cell (cursor,
213 virt_loc.phys_row_offset,
214 virt_loc.phys_col_offset);
216 gnucash_cursor_configure (cursor);
218 g_object_set (G_OBJECT(sheet->header_item),
220 cursor->style->cursor->cursor_name,
226 gnucash_cursor_set_property (GObject *
object,
233 cursor = GNUCASH_CURSOR (
object);
239 GNUCASH_SHEET (g_value_get_object (value));
254 gnucash_cursor_get_property (GObject *
object,
264 g_value_take_object (value, cursor->sheet);
281 GObjectClass *object_class;
283 object_class = G_OBJECT_CLASS (klass);
286 object_class->set_property = gnucash_cursor_set_property;
287 object_class->get_property = gnucash_cursor_get_property;
290 g_object_class_install_property
293 g_param_spec_object (
"sheet",
302 gnucash_cursor_new (GnucashSheet *sheet)
304 return GNUCASH_CURSOR(
305 g_object_new (gnucash_cursor_get_type(),
holds information about each virtual cell.
Convenience wrapper around GdkRGBA for use in Register Gnome classes.
Public declarations for GnucashCursor class.
VirtualCell * gnc_table_get_virtual_cell(Table *table, VirtualCellLocation vcell_loc)
returns the virtual cell associated with a particular virtual location.
Public declarations of GnucashRegister class.
Private declarations for GnucashSheet class.
SheetBlockStyle * style
The style for this block.
Styling functions for RegisterGnome.
gint origin_y
x origin of block
BasicCell * gnc_cellblock_get_cell(CellBlock *cellblock, int row, int col)
Retrieve the Cell at the specified coordinates.