27 #include <glib/gi18n.h> 34 static QofLogModule log_module = GNC_MOD_REGISTER;
38 gnc_register_add_cell (TableLayout* layout,
39 const char* cell_name,
40 const char* cell_type_name,
41 const char* sample_text,
42 CellAlignment alignment,
48 g_return_if_fail (layout != NULL);
49 g_return_if_fail (cell_type_name != NULL);
51 cell = gnc_register_make_cell (cell_type_name);
53 gnc_basic_cell_set_name (cell, cell_name);
54 gnc_basic_cell_set_type_name (cell, cell_type_name);
55 gnc_basic_cell_set_sample_text (cell, sample_text);
56 gnc_basic_cell_set_alignment (cell, alignment);
57 gnc_basic_cell_set_expandable (cell, expandable);
58 gnc_basic_cell_set_span (cell, span);
60 gnc_table_layout_add_cell (layout, cell);
68 for (col = 0; col < from->num_cols; col++)
73 if (!cell || !cell->cell_name)
76 gnc_table_layout_set_cell (layout, to, cell->cell_name, row, col);
81 gnc_split_register_set_cells (SplitRegister* reg, TableLayout* layout)
88 case REG_TYPE_GROUP_CURRENCY:
90 curs = gnc_table_layout_get_cursor (layout,
91 CURSOR_SINGLE_LEDGER);
93 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
94 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
95 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
96 gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
97 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
100 gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
101 gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
105 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5);
106 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6);
108 gnc_table_layout_set_cell (layout, curs, BALN_CELL, 0, 7);
109 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
112 curs = gnc_table_layout_get_cursor (layout,
113 CURSOR_DOUBLE_LEDGER);
115 copy_cursor_row (layout, curs, curs_last, 0);
117 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 1);
118 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
119 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
120 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
122 curs = gnc_table_layout_get_cursor (layout,
123 CURSOR_DOUBLE_LEDGER_NUM_ACTN);
125 copy_cursor_row (layout, curs, curs_last, 0);
127 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
128 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
129 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
130 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
132 curs = gnc_table_layout_get_cursor (layout,
133 CURSOR_SINGLE_JOURNAL);
135 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
136 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
137 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
138 gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 5);
139 gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 6);
140 gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0, 7);
141 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
144 curs = gnc_table_layout_get_cursor (layout,
145 CURSOR_DOUBLE_JOURNAL);
147 copy_cursor_row (layout, curs, curs_last, 0);
149 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
150 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
151 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
153 curs = gnc_table_layout_get_cursor (layout,
154 CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
156 copy_cursor_row (layout, curs, curs_last, 0);
158 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
159 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
160 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
161 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
163 curs = gnc_table_layout_get_cursor (layout,
166 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
167 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
168 gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
169 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
170 if (reg->is_template)
172 gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
173 gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
177 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5);
178 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6);
180 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
186 case REG_TYPE_GROUP_APAR:
188 curs = gnc_table_layout_get_cursor (layout,
189 CURSOR_SINGLE_LEDGER);
191 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
192 gnc_table_layout_set_cell (layout, curs, TYPE_CELL, 0, 1);
193 gnc_table_layout_set_cell (layout, curs, DDUE_CELL, 0, 2);
194 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 3);
195 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 4);
196 gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 5);
197 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 6);
198 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 7);
199 gnc_table_layout_set_cell (layout, curs, BALN_CELL, 0, 8);
200 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 9);
203 curs = gnc_table_layout_get_cursor (layout,
204 CURSOR_DOUBLE_LEDGER);
206 copy_cursor_row (layout, curs, curs_last, 0);
208 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 1);
209 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 3);
210 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
212 curs = gnc_table_layout_get_cursor (layout,
213 CURSOR_DOUBLE_LEDGER_NUM_ACTN);
215 copy_cursor_row (layout, curs, curs_last, 0);
217 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 1);
218 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 3);
219 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
221 curs = gnc_table_layout_get_cursor (layout,
222 CURSOR_SINGLE_JOURNAL);
224 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
225 gnc_table_layout_set_cell (layout, curs, TYPE_CELL, 0, 1);
226 gnc_table_layout_set_cell (layout, curs, DDUE_CELL, 0, 2);
227 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 3);
228 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 4);
230 gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 6);
231 gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 7);
232 gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0, 8);
233 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 9);
236 curs = gnc_table_layout_get_cursor (layout,
237 CURSOR_DOUBLE_JOURNAL);
239 copy_cursor_row (layout, curs, curs_last, 0);
241 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
243 curs = gnc_table_layout_get_cursor (layout,
244 CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
246 copy_cursor_row (layout, curs, curs_last, 0);
248 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 1);
249 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 3);
250 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 1, 4);
252 curs = gnc_table_layout_get_cursor (layout,
255 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 3);
256 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 4);
257 gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 5);
258 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 6);
259 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 7);
265 case REG_TYPE_GROUP_JOURNAL:
267 curs = gnc_table_layout_get_cursor (layout,
268 CURSOR_SINGLE_LEDGER);
270 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
271 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 0, 1);
272 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
273 gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
274 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
275 if (reg->is_template)
277 gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
278 gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
279 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7);
283 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5);
284 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6);
285 if (!reg->mismatched_commodities)
287 gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
288 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
293 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7);
298 curs = gnc_table_layout_get_cursor (layout,
299 CURSOR_DOUBLE_LEDGER);
301 copy_cursor_row (layout, curs, curs_last, 0);
303 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 1);
304 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
305 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
306 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
308 curs = gnc_table_layout_get_cursor (layout,
309 CURSOR_DOUBLE_LEDGER_NUM_ACTN);
311 copy_cursor_row (layout, curs, curs_last, 0);
313 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 1);
314 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
315 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
316 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
318 curs = gnc_table_layout_get_cursor (layout,
319 CURSOR_SINGLE_JOURNAL);
321 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
322 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 0, 1);
323 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
324 gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 5);
325 gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 6);
326 if (reg->is_template)
327 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7);
330 if (!reg->mismatched_commodities)
332 gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
333 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
338 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7);
343 curs = gnc_table_layout_get_cursor (layout,
344 CURSOR_DOUBLE_JOURNAL);
346 copy_cursor_row (layout, curs, curs_last, 0);
348 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
349 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
350 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
352 curs = gnc_table_layout_get_cursor (layout,
353 CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
355 copy_cursor_row (layout, curs, curs_last, 0);
357 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
358 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
359 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
361 curs = gnc_table_layout_get_cursor (layout,
364 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
365 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
366 gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
367 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
368 if (reg->is_template)
370 gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5);
371 gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 6);
372 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 7);
376 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 5);
377 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 6);
378 gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
385 case REG_TYPE_GROUP_STOCK:
387 curs = gnc_table_layout_get_cursor (layout,
388 CURSOR_SINGLE_LEDGER);
390 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
391 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
392 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
393 gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
394 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
395 gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
396 gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
397 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
398 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
399 gnc_table_layout_set_cell (layout, curs, BALN_CELL, 0, 9);
402 curs = gnc_table_layout_get_cursor (layout,
403 CURSOR_DOUBLE_LEDGER);
405 copy_cursor_row (layout, curs, curs_last, 0);
407 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 1);
408 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
409 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
410 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
412 curs = gnc_table_layout_get_cursor (layout,
413 CURSOR_DOUBLE_LEDGER_NUM_ACTN);
415 copy_cursor_row (layout, curs, curs_last, 0);
417 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
418 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
419 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
420 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
422 curs = gnc_table_layout_get_cursor (layout,
423 CURSOR_SINGLE_JOURNAL);
425 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
426 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
427 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
428 gnc_table_layout_set_cell (layout, curs, TSHRS_CELL, 0, 5);
429 gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 7);
430 gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 8);
431 gnc_table_layout_set_cell (layout, curs, TBALN_CELL, 0, 9);
434 curs = gnc_table_layout_get_cursor (layout,
435 CURSOR_DOUBLE_JOURNAL);
437 copy_cursor_row (layout, curs, curs_last, 0);
439 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
440 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
441 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
443 curs = gnc_table_layout_get_cursor (layout,
444 CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
446 copy_cursor_row (layout, curs, curs_last, 0);
448 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
449 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
450 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
451 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
453 curs = gnc_table_layout_get_cursor (layout,
456 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
457 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
458 gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
459 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
460 gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
461 gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
462 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
463 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
469 case REG_TYPE_GROUP_PORTFOLIO:
471 curs = gnc_table_layout_get_cursor (layout,
472 CURSOR_SINGLE_LEDGER);
474 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
475 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
476 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
477 gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
478 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
479 gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
480 gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
481 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
482 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
485 curs = gnc_table_layout_get_cursor (layout,
486 CURSOR_DOUBLE_LEDGER);
488 copy_cursor_row (layout, curs, curs_last, 0);
490 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 1, 1);
491 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
492 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
493 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
495 curs = gnc_table_layout_get_cursor (layout,
496 CURSOR_DOUBLE_LEDGER_NUM_ACTN);
498 copy_cursor_row (layout, curs, curs_last, 0);
500 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
501 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
502 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
503 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
505 curs = gnc_table_layout_get_cursor (layout,
506 CURSOR_SINGLE_JOURNAL);
508 gnc_table_layout_set_cell (layout, curs, DATE_CELL, 0, 0);
509 gnc_table_layout_set_cell (layout, curs, NUM_CELL, 0, 1);
510 gnc_table_layout_set_cell (layout, curs, DESC_CELL, 0, 2);
511 gnc_table_layout_set_cell (layout, curs, TSHRS_CELL, 0, 5);
512 gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 7);
513 gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 8);
516 curs = gnc_table_layout_get_cursor (layout,
517 CURSOR_DOUBLE_JOURNAL);
519 copy_cursor_row (layout, curs, curs_last, 0);
521 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
522 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
523 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
525 curs = gnc_table_layout_get_cursor (layout,
526 CURSOR_DOUBLE_JOURNAL_NUM_ACTN);
528 copy_cursor_row (layout, curs, curs_last, 0);
530 gnc_table_layout_set_cell (layout, curs, TNUM_CELL, 1, 1);
531 gnc_table_layout_set_cell (layout, curs, NOTES_CELL, 1, 2);
532 gnc_table_layout_set_cell (layout, curs, VNOTES_CELL, 1, 3);
533 gnc_table_layout_set_cell (layout, curs, DOCLINK_CELL, 1, 4);
535 curs = gnc_table_layout_get_cursor (layout,
538 gnc_table_layout_set_cell (layout, curs, ACTN_CELL, 0, 1);
539 gnc_table_layout_set_cell (layout, curs, MEMO_CELL, 0, 2);
540 gnc_table_layout_set_cell (layout, curs, XFRM_CELL, 0, 3);
541 gnc_table_layout_set_cell (layout, curs, RECN_CELL, 0, 4);
542 gnc_table_layout_set_cell (layout, curs, SHRS_CELL, 0, 5);
543 gnc_table_layout_set_cell (layout, curs, PRIC_CELL, 0, 6);
544 gnc_table_layout_set_cell (layout, curs, DEBT_CELL, 0, 7);
545 gnc_table_layout_set_cell (layout, curs, CRED_CELL, 0, 8);
552 PERR (
"unknown register group type for %d \n", reg->type);
558 gnc_split_register_layout_add_cursors (SplitRegister* reg,
569 case CREDIT_REGISTER:
570 case LIABILITY_REGISTER:
571 case INCOME_REGISTER:
572 case EXPENSE_REGISTER:
573 case EQUITY_REGISTER:
574 case TRADING_REGISTER:
578 case PAYABLE_REGISTER:
579 case RECEIVABLE_REGISTER:
584 case GENERAL_JOURNAL:
586 if (reg->is_template || reg->mismatched_commodities)
593 case CURRENCY_REGISTER:
597 case PORTFOLIO_LEDGER:
602 PERR (
"Bad register type");
608 gnc_table_layout_add_cursor (layout, cursor);
612 gnc_table_layout_add_cursor (layout, cursor);
614 gnc_table_layout_set_primary_cursor (layout, cursor);
617 gnc_table_layout_add_cursor (layout, cursor);
620 gnc_table_layout_add_cursor (layout, cursor);
624 gnc_table_layout_add_cursor (layout, cursor);
627 gnc_table_layout_add_cursor (layout, cursor);
630 gnc_table_layout_add_cursor (layout, cursor);
633 gnc_table_layout_add_cursor (layout, cursor);
637 gnc_split_register_layout_add_cells (SplitRegister* reg,
640 gnc_register_add_cell (layout,
646 C_ (
"sample",
"22/02/2000"),
651 gnc_register_add_cell (layout,
654 C_ (
"sample",
"22/02/2000"),
659 gnc_register_add_cell (layout,
665 C_ (
"sample",
"99999"),
670 gnc_register_add_cell (layout,
672 BASIC_CELL_TYPE_NAME,
673 C_ (
"sample",
"99999"),
678 gnc_register_add_cell (layout,
680 COMPLETION_CELL_TYPE_NAME,
681 C_ (
"sample",
"Description of a transaction"),
686 gnc_register_add_cell (layout,
688 PRICE_CELL_TYPE_NAME,
694 gnc_register_add_cell (layout,
697 C_ (
"Column header for 'Reconciled'",
"R"),
702 gnc_register_add_cell (layout,
704 DOCLINK_CELL_TYPE_NAME,
705 C_ (
"Column header for 'Document Link'",
"L"),
710 gnc_register_add_cell (layout,
712 PRICE_CELL_TYPE_NAME,
713 C_ (
"sample",
"999,999.000"),
718 gnc_register_add_cell (layout,
720 COMBO_CELL_TYPE_NAME,
726 gnc_register_add_cell (layout,
728 COMBO_CELL_TYPE_NAME,
729 C_ (
"sample",
"Expenses:Automobile:Gasoline"),
734 gnc_register_add_cell (layout,
736 COMBO_CELL_TYPE_NAME,
737 C_ (
"sample",
"Expenses:Automobile:Gasoline"),
742 gnc_register_add_cell (layout,
744 QUICKFILL_CELL_TYPE_NAME,
745 C_ (
"sample",
"Memo field sample text string"),
750 gnc_register_add_cell (layout,
752 PRICE_CELL_TYPE_NAME,
753 C_ (
"sample",
"999,999.000"),
758 gnc_register_add_cell (layout,
760 PRICE_CELL_TYPE_NAME,
761 C_ (
"sample",
"999,999.000"),
766 gnc_register_add_cell (layout,
768 PRICE_CELL_TYPE_NAME,
769 C_ (
"sample",
"999,999.000"),
776 gnc_register_add_cell (layout,
778 PRICE_CELL_TYPE_NAME,
779 C_ (
"sample",
"999,999.000"),
784 gnc_register_add_cell (layout,
786 PRICE_CELL_TYPE_NAME,
787 C_ (
"sample",
"999,999.000"),
792 gnc_register_add_cell (layout,
794 PRICE_CELL_TYPE_NAME,
795 C_ (
"sample",
"999,999.000"),
800 gnc_register_add_cell (layout,
802 PRICE_CELL_TYPE_NAME,
803 C_ (
"sample",
"999,999.000"),
808 gnc_register_add_cell (layout,
810 PRICE_CELL_TYPE_NAME,
811 C_ (
"sample",
"999,999.000"),
816 gnc_register_add_cell (layout,
819 C_ (
"Column header for 'Type'",
"T"),
824 gnc_register_add_cell (layout,
826 QUICKFILL_CELL_TYPE_NAME,
827 C_ (
"sample",
"Notes field sample text string"),
832 gnc_register_add_cell (layout,
834 BASIC_CELL_TYPE_NAME,
835 C_ (
"sample",
"No Particular Reason"),
840 gnc_register_add_cell (layout,
842 FORMULA_CELL_TYPE_NAME,
843 C_ (
"sample",
"(x + 0.33 * y + (x+y) )"),
848 gnc_register_add_cell (layout,
850 FORMULA_CELL_TYPE_NAME,
851 C_ (
"sample",
"(x + 0.33 * y + (x+y) )"),
856 gnc_register_add_cell (layout,
858 PRICE_CELL_TYPE_NAME,
859 C_ (
"sample",
"999,999.000"),
873 gnc_split_register_layout_add_cells (reg, layout);
874 gnc_split_register_layout_add_cursors (reg, layout);
875 gnc_split_register_set_cells (reg, layout);
SplitRegisterTypeGroup gnc_split_register_get_register_group(SplitRegister *reg)
Group registers for common layouts.
Create the actual register visual layout.
#define PERR(format, args...)
Log a serious error.
TableLayout * gnc_table_layout_new(void)
API Declarations.
#define CURSOR_HEADER
Standard Cursor Names.
All type declarations for the whole Gnucash engine.
TableLayout * gnc_split_register_layout_new(SplitRegister *reg)
Generate the split register layout.
CellBlock * gnc_cellblock_new(int rows, int cols, const char *cursor_name)
Create a new CellBlock on the heap.
BasicCell * gnc_cellblock_get_cell(CellBlock *cellblock, int row, int col)
Retrieve the Cell at the specified coordinates.