From b59549d0d6c94f49cdcfcf844c4c214217fd369b Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Wed, 25 Mar 1998 06:00:38 +0000 Subject: [PATCH] add docs, destroy method git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@719 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/register/datecell.c | 11 ++++++++++ src/register/datecell.h | 48 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/register/datecell.c b/src/register/datecell.c index 49486fa35f..e1997608eb 100644 --- a/src/register/datecell.c +++ b/src/register/datecell.c @@ -367,6 +367,17 @@ xaccInitDateCell (DateCell *cell) /* ================================================ */ +void +xaccDestroyDateCell (DateCell *cell) +{ + cell->date.tm_mday = 0; + cell->date.tm_mon = 0; + cell->date.tm_year = 0; + xaccDestroyBasicCell ( &(cell->cell)); +} + +/* ================================================ */ + void xaccSetDateCellValue (DateCell *cell, int day, int mon, int year) { diff --git a/src/register/datecell.h b/src/register/datecell.h index b01b9488f5..45d4d13130 100644 --- a/src/register/datecell.h +++ b/src/register/datecell.h @@ -3,12 +3,57 @@ * datecell.h * * FUNCTION: - * Implements date handling + * The DateCell object implements a date handling cell. It + * is able to display dates in several formats, it is also + * able to accept date input, and also supports a number of accelerator + * keys. * + * On output, this cell will display a date as mm/dd/yy + * The actual date formate is compile-time configurable. + * + * hack alert -- make the display format run-time configurable, and + * appropriately internationalized. + * + * One input, this cell is able to parse dates that are entered. + * It rejects any input that is not in the form of a date. Input + * also includes a number of accelerators: + * + * '+': + * '=': increment day + * + * '_': + * '-': decrement day + * + * '}': + * ']': increment month + * + * '{': + * '[': decrment month + * + * 'M': + * 'm': begining of month + * + * 'H': + * 'h': end of month + * + * 'Y': + * 'y': begining of year + * + * 'R': + * 'r': end of year + * + * 'T': + * 't': today + * + * + * METHODS: * The xaccSetDateCellValue() method accepts a numeric date and * sets the contents of the date cell to that value. The * value day, month, year should follow the regular written * conventions, i.e. day==(1..31), mon==(1..12), year==4 digits + * + * HISTORY: + * Copyright (c) 1998 Linas Vepstas */ #ifndef __XACC_DATE_CELL_C__ @@ -25,6 +70,7 @@ typedef struct _DateCell { /* installs a callback to handle date recording */ DateCell * xaccMallocDateCell (void); void xaccInitDateCell (DateCell *); +void xaccDestroyDateCell (DateCell *); void xaccSetDateCellValue (DateCell *, int day, int mon, int year);