mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
misc cleanup, fix tabing for stock ledgers
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@623 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
+19
-6
@@ -133,9 +133,9 @@ configLayout (BasicRegister *reg, int type)
|
||||
SET (DEBT_CELL, 5, 0, 12, DEBIT_STR);
|
||||
SET (CRED_CELL, 6, 0, 12, CREDIT_STR);
|
||||
SET (BALN_CELL, 7, 0, 12, BALN_STR);
|
||||
SET (SHRS_CELL, -1, -1, 12, TOT_SHRS_STR);
|
||||
SET (PRIC_CELL, -1, -1, 9, PRICE_STR);
|
||||
SET (VALU_CELL, -1, -1, 12, VALUE_STR);
|
||||
SET (VALU_CELL, -1, -1, 10, VALUE_STR);
|
||||
SET (SHRS_CELL, -1, -1, 10, TOT_SHRS_STR);
|
||||
|
||||
switch (type) {
|
||||
case BANK_LEDGER:
|
||||
@@ -150,16 +150,16 @@ configLayout (BasicRegister *reg, int type)
|
||||
reg->num_header_rows = 1;
|
||||
SET (XTO_CELL, -1, -1, 14, XFTO_STR);
|
||||
SET (PRIC_CELL, -1, -1, 9, PRICE_STR);
|
||||
SET (VALU_CELL, -1, -1, 12, VALUE_STR);
|
||||
SET (SHRS_CELL, -1, -1, 12, TOT_SHRS_STR);
|
||||
SET (VALU_CELL, -1, -1, 10, VALUE_STR);
|
||||
SET (SHRS_CELL, -1, -1, 10, TOT_SHRS_STR);
|
||||
break;
|
||||
|
||||
case STOCK_LEDGER:
|
||||
reg->num_cols = 11;
|
||||
SET (XTO_CELL, -1, -1, 14, XFTO_STR);
|
||||
SET (PRIC_CELL, 7, 0, 9, PRICE_STR);
|
||||
SET (VALU_CELL, 8, 0, 12, VALUE_STR);
|
||||
SET (SHRS_CELL, 9, 0, 12, TOT_SHRS_STR);
|
||||
SET (VALU_CELL, 8, 0, 10, VALUE_STR);
|
||||
SET (SHRS_CELL, 9, 0, 10, TOT_SHRS_STR);
|
||||
SET (BALN_CELL, 10, 0, 12, BALN_STR);
|
||||
|
||||
default:
|
||||
@@ -233,9 +233,22 @@ configTraverse (BasicRegister *reg, int type)
|
||||
xaccNextRight (curs, CRED_CELL_R, CRED_CELL_C, ACTN_CELL_R, ACTN_CELL_C);
|
||||
xaccNextRight (curs, ACTN_CELL_R, ACTN_CELL_C, MEMO_CELL_R, MEMO_CELL_C);
|
||||
xaccNextRight (curs, MEMO_CELL_R, MEMO_CELL_C, -1-DATE_CELL_R, -1-DATE_CELL_C);
|
||||
break;
|
||||
|
||||
case STOCK_LEDGER:
|
||||
xaccNextRight (curs, DATE_CELL_R, DATE_CELL_C, NUM_CELL_R, NUM_CELL_C);
|
||||
xaccNextRight (curs, NUM_CELL_R, NUM_CELL_C, XFRM_CELL_R, XFRM_CELL_C);
|
||||
xaccNextRight (curs, XFRM_CELL_R, XFRM_CELL_C, DESC_CELL_R, DESC_CELL_C);
|
||||
xaccNextRight (curs, DESC_CELL_R, DESC_CELL_C, DEBT_CELL_R, DEBT_CELL_C);
|
||||
xaccNextRight (curs, DEBT_CELL_R, DEBT_CELL_C, CRED_CELL_R, CRED_CELL_C);
|
||||
xaccNextRight (curs, CRED_CELL_R, CRED_CELL_C, PRIC_CELL_R, PRIC_CELL_C);
|
||||
xaccNextRight (curs, PRIC_CELL_R, PRIC_CELL_C, ACTN_CELL_R, ACTN_CELL_C);
|
||||
xaccNextRight (curs, ACTN_CELL_R, ACTN_CELL_C, MEMO_CELL_R, MEMO_CELL_C);
|
||||
xaccNextRight (curs, MEMO_CELL_R, MEMO_CELL_C, -1-DATE_CELL_R, -1-DATE_CELL_C);
|
||||
break;
|
||||
|
||||
default:
|
||||
xaccNextRight (curs, DATE_CELL_R, DATE_CELL_C, -1-DATE_CELL_R, -1-DATE_CELL_C);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,15 @@
|
||||
* register.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* implements a basic display register/ledger
|
||||
* Implements a basic display register/ledger.
|
||||
* This object makes specific cell have specific properties
|
||||
* (price, text, date, etc). and specific names that correspond.
|
||||
* it also determines the actual phyisical layout, arrengement
|
||||
* of columns, etc.
|
||||
*
|
||||
* DESIGN HOPES:
|
||||
* Should probably move at least some of the layout to a config
|
||||
* file. Might make good sense to use scheme/guile for the layout.
|
||||
*
|
||||
* HISTORY:
|
||||
* Copyright (c) 1998 Linas Vepstas
|
||||
|
||||
+29
-9
@@ -1,6 +1,35 @@
|
||||
/*
|
||||
* FILE:
|
||||
* table.c
|
||||
*
|
||||
* FUNCTION:
|
||||
* Implements the infrastructure for the displayed table.
|
||||
* This is the Motif implementation; this needs to be
|
||||
* ported to GTK, etc.
|
||||
*
|
||||
* HISTORY:
|
||||
* Copyright (c) 1988 Linas Vepstas
|
||||
*/
|
||||
|
||||
/********************************************************************\
|
||||
* 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 the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
\********************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xbae/Matrix.h>
|
||||
|
||||
#include "cellblock.h"
|
||||
@@ -867,8 +896,6 @@ traverseCB (Widget mw, XtPointer cd, XtPointer cb)
|
||||
row = cbs->row;
|
||||
col = cbs->column;
|
||||
|
||||
printf ("traverse from %d %d %s %d\n", row, col, cbs->param, cbs->qparam);
|
||||
|
||||
/* If the quark is zero, then it is likely that we are
|
||||
* here because we traversed out of a cell that had a
|
||||
* ComboBox in it. The ComboCell is clever enough to put
|
||||
@@ -890,7 +917,6 @@ printf ("traverse from %d %d %s %d\n", row, col, cbs->param, cbs->qparam);
|
||||
cbs->qparam = QRight;
|
||||
row = table->prev_phys_traverse_row;
|
||||
col = table->prev_phys_traverse_col;
|
||||
printf ("null quark emulate rows %d %d \n", row, col);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -928,14 +954,8 @@ printf ("null quark emulate rows %d %d \n", row, col);
|
||||
|
||||
table->prev_phys_traverse_row = cbs->next_row;
|
||||
table->prev_phys_traverse_col = cbs->next_column;
|
||||
|
||||
printf ("traverse all said & done %d %d \n",
|
||||
table->prev_phys_traverse_row,
|
||||
table->prev_phys_traverse_col);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
Widget
|
||||
|
||||
Reference in New Issue
Block a user