create price cell

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@396 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-01-09 02:14:04 +00:00
parent c628823cb4
commit b17c29bba4
4 changed files with 33 additions and 42 deletions

View File

@ -24,7 +24,7 @@ LIBXMHTML= ../lib/XmHTML-1.1.0/src/libXmHTML.a
LIBXBAE = ../lib/Xbae-4.6.2-linas/libXbae.a
LIBCOMBO = ../lib/ComboBox-1.33/libComboBox.a
######################################################################
SRCS = single.c
SRCS = cell.c price.c single.c
OBJS = ${SRCS:.c=.o}
######################################################################

View File

@ -1,32 +1,6 @@
/* cell types */
enum {
DATE,
PRICE, /* two-digit float point display */
AMOUNT, /* three-digit float point display */
TEXT, /* string text */
COMBO, /* combobox */
};
/* The modify-verify callback is called when a user
* makes a change to a cell. The input is a changed string.
* It must return a string, or void if it rejects the change.
*/
typedef struct _SingleCell {
short type; /* cell type */
short row; /* relative row position */
short col; /* relative column position */
short width; /* column width, in chars, not pixels */
char * value; /* current value */
char * (*modify_verify) (char *) /* modify verify callback */
} SingleCell;
#include <Xm/Xm.h>
#include "single.h"
typedef struct _CellArray {
@ -38,9 +12,6 @@ typedef struct _CellArray {
Widget reg; /* the XbaeMatrix */
} CellArray;
SingleCell * xaccMallocSingleCell (void);
void xaccInitSingleCell (SingleCell *);
CellArray * xaccMallocCellArray (void);
void xaccInitCellArray (CellArray *, int numrows, int numcols);
@ -50,13 +21,3 @@ void xaccDestroyCellArray (CellArray *);
void xaccAddCell (SingleCell *);
/* installs a callback to handle price recording */
void xaccInitPriceCell (SingleCell *);
SingleCell * xaccMallocSingleCell (void)
{
}

18
src/register/pricecell.c Normal file
View File

@ -0,0 +1,18 @@
#include <string.h>
#include "price.h"
#include "single.h"
static char * PriceMV (char * input)
{
return strdup (input);
}
void
xaccInitPriceCell (SingleCell *cell)
{
cell ->modify_verify = PriceMV;
}
/* --------------- end of file ---------------------- */

12
src/register/pricecell.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef __XACC_PRICE_C__
#define __XACC_PRICE_C__
#include "single.h"
/* installs a callback to handle price recording */
void xaccInitPriceCell (SingleCell *);
#endif /* __XACC_PRICE_C__ */
/* --------------- end of file ---------------------- */