src/calculation: some cleanup and renaming of functions to be longer

and more descriptive.

src/gnome/dialog-transfer: add the Num field and APIs for changing
                           some of the values

src/gnome/dialog-fincalc.c: use new function names for calculator


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2606 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2000-07-21 20:16:35 +00:00
parent 17d6719688
commit c1ce3c8236
8 changed files with 166 additions and 83 deletions

View File

@@ -1,3 +1,12 @@
2000-07-21 Dave Peticolas <dave@krondo.com>
* src/calculation/fin.c: Some cleanup and renaming of function
names to be longer and more descriptive.
* src/gnome/dialog-transfer.c: Add Num field to the transfer
dialog. Add APIs to change the amount, the description, and the
accounts. Fix a bug in the default sense of the show/hide buttons.
2000-07-20 Dave Peticolas <dave@krondo.com>
* src/gnome/top-level.c (gnc_ui_destroy_all_subwindows): destroy

View File

@@ -592,7 +592,7 @@ parser_env_ptr pe)
/* parse next token from string
*/
static unsigned char next_token(
static void next_token(
parser_env_ptr pe)
{
unsigned char *nstr,
@@ -627,7 +627,7 @@ parser_env_ptr pe)
} /* endif */
/* test for numeric token
*/
} else if ( number = (pe->trans_numeric)(str_parse,pe->radix_point,pe->group_char,&nstr) ) {
} else if ( (number = (pe->trans_numeric)(str_parse,pe->radix_point,pe->group_char,&nstr)) ) {
pe->Token = NUM_TOKEN;
pe->numeric_value = number;
str_parse = nstr;

View File

@@ -699,10 +699,12 @@
* can afford larger payments.
*
*================================================================================
* NOTE: For Payment Frequencies, PF, semi-monthly or less, i.e., PF == 12 or PF == 24,
* a 360 day calender year and 30 day month are used. For Payment Frequencies, PF,
* greater than semi-monthly, PF > 24, the actual number of days per year and per payment
* period are used. The actual values are computed using the built-in 'jdn' function
* NOTE: For Payment Frequencies, PF, semi-monthly or less, i.e., PF
* == 12 or PF == 24, a 360 day calender year and 30 day month are
* used. For Payment Frequencies, PF, greater than semi-monthly, PF
* > 24, the actual number of days per year and per payment period
* are used. The actual values are computed using the built-in
* 'julian_day_number' function
*
* *****************************************************************************
*
@@ -1126,8 +1128,7 @@
* 1. PPC ROM User's Manual
* pages 148 - 164
*
*
*/
* */
#include <time.h>
#include <stdio.h>
@@ -1151,7 +1152,7 @@ unsigned places)
unsigned char buf[50]; /* make buffer large enough */
if ( places >= 0 ) {
sprintf(buf,"%.*f",places,x);
sprintf(buf,"%.*f",(int)places,x);
sscanf(buf,"%lf",&r);
} else r = x;
@@ -1206,11 +1207,11 @@ unsigned beg) {
/* compute Number of Periods from preset data
*/
unsigned N(
unsigned fi_calc_num_payments(
fi_ptr fi)
{
return fi->npp = (unsigned)rnd(_N(fi->ir,fi->pv,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),0);
} /* N */
return fi->npp = (unsigned)rnd(_fi_calc_num_payments(fi->ir,fi->pv,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),0);
} /* fi_calc_num_payments */
/* Compute number of periods from:
* 1. Nominal Interest
@@ -1218,7 +1219,7 @@ fi_ptr fi)
* 3. Periodic Payment
* 4. Future Value
*/
double _N(
double _fi_calc_num_payments(
double nint, /* nominal interest rate */
double pv, /* present value */
double pmt, /* periodic payment */
@@ -1233,18 +1234,18 @@ unsigned bep) /* beginning/end of period payment flag */
CC = (CC - fv)/(CC + pv);
return (CC > 0.0) ? log(CC)/log(1.0 + eint) : 0.0;
} /* _N */
} /* _fi_calc_num_payments */
/* compute Interest from preset data
*/
double I(
double fi_calc_interest(
fi_ptr fi)
{
if ( fi->npp ) fi->ir = _I(fi->npp,fi->pv,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep);
if ( fi->npp ) fi->ir = _fi_calc_interest(fi->npp,fi->pv,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep);
/* else print "Number of periods is zero, probably not specified"; */
return fi->ir;
} /* I */
} /* fi_calc_interest */
double ratio = 1e4; /* ratio used in iterative solution for interest */
@@ -1254,7 +1255,7 @@ double ratio = 1e4; /* ratio used in iterative solution for interest */
* 3. Periodic Payment
* 4. Future Value
*/
double _I(
double _fi_calc_interest(
unsigned per, /* number of periods */
double pv, /* present value */
double pmt, /* periodic payment */
@@ -1292,15 +1293,15 @@ unsigned bep) /* beginning/end of period payment flag */
} /* endif */
return 100.0 * nom_int(eint,CF,PF,disc);
} /* _I */
} /* _fi_calc_interest */
/* compute Present value from preset data
*/
double PV(
double fi_calc_present_value(
fi_ptr fi)
{
return fi->pv = rnd(_PV(fi->npp,fi->ir,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* PV */
return fi->pv = rnd(_fi_calc_present_value(fi->npp,fi->ir,fi->pmt,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* fi_calc_present_value */
/* Compute Present Value from:
* 1. Number of periods
@@ -1308,7 +1309,7 @@ fi_ptr fi)
* 3. Periodic Payment
* 4. Future Value
*/
double _PV(
double _fi_calc_present_value(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pmt, /* periodic payment */
@@ -1323,15 +1324,15 @@ unsigned bep) /* beginning/end of period payment flag */
double CC = _C(eint,pmt,bep);
return -(fv + (AA * CC))/(AA + 1.0);
} /* _PV */
} /* _fi_calc_present_value */
/* compute Periodic Payment from preset data
*/
double PMT(
double fi_calc_payment(
fi_ptr fi)
{
return fi->pmt = rnd(_PMT(fi->npp,fi->ir,fi->pv,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* PMT */
return fi->pmt = rnd(_fi_calc_payment(fi->npp,fi->ir,fi->pv,fi->fv,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* fi_calc_payment */
/* Compute Periodic Payment from:
* 1. Number of periods
@@ -1339,7 +1340,7 @@ fi_ptr fi)
* 3. Present Value
* 4. Future Value
*/
double _PMT(
double _fi_calc_payment(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pv, /* present value */
@@ -1354,15 +1355,15 @@ unsigned bep) /* beginning/end of period payment flag */
double BB = _B(eint,bep);
return -(fv + pv * (AA + 1.0))/(AA * BB);
} /* _PMT */
} /* _fi_calc_payment */
/* compute Future Value from preset data
*/
double FV(
double fi_calc_future_value(
fi_ptr fi)
{
return fi->fv = rnd(_FV(fi->npp,fi->ir,fi->pv,fi->pmt,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* FV */
return fi->fv = rnd(_fi_calc_future_value(fi->npp,fi->ir,fi->pv,fi->pmt,fi->CF,fi->PF,fi->disc,fi->bep),fi->prec);
} /* fi_calc_future_value*/
/* Compute Future Value from:
* 1. Number of periods
@@ -1370,7 +1371,7 @@ fi_ptr fi)
* 3. Present Value
* 4. Periodic Payments
*/
double _FV(
double _fi_calc_future_value(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pv, /* present value */
@@ -1385,7 +1386,7 @@ unsigned bep) /* beginning/end of period payment flag */
double CC = _C(eint,pmt,bep);
return -(pv + AA * (pv + CC));
} /* _FV */
} /* _fi_calc_future_value */
/* compute Nominal Interest Rate from Effective Interest Rate
*/
@@ -1506,7 +1507,7 @@ fi_ptr fi)
/* compute Julian Day Number from calender date
*/
unsigned long jdn(
unsigned long julian_day_number(
unsigned year,
unsigned month,
unsigned day)
@@ -1526,7 +1527,7 @@ unsigned day)
if ( gregorian ) ljdn += -(long)(yr/100.0) + (long)(yr/400.0) + 2;
return ljdn;
} /* jdn */
} /* julian_day_number */
amort_sched_ptr Amortization_init(
amort_sched_ptr amortsched)
@@ -1548,13 +1549,13 @@ amort_sched_ptr amortsched)
unsigned long s,
d,
days_to_yr_end,
Eff_Date_jdn = jdn(amortsched->year_E,amortsched->month_E,amortsched->day_E),
Init_Date_jdn = jdn(amortsched->year_I,amortsched->month_I,amortsched->day_I);
Eff_Date_jdn = julian_day_number(amortsched->year_E,amortsched->month_E,amortsched->day_E),
Init_Date_jdn = julian_day_number(amortsched->year_I,amortsched->month_I,amortsched->day_I);
amortsched->Eff_Date_jdn = Eff_Date_jdn;
amortsched->Init_Date_jdn = Init_Date_jdn;
amortsched->yday_E = Eff_Date_jdn - jdn(amortsched->year_E,1,1);
amortsched->yday_I = Init_Date_jdn - jdn(amortsched->year_I,1,1);
amortsched->yday_E = Eff_Date_jdn - julian_day_number(amortsched->year_E,1,1);
amortsched->yday_I = Init_Date_jdn - julian_day_number(amortsched->year_I,1,1);
amortsched->eint = eint = eff_int(nint/100.0,CF,PF,disc);
amortsched->fv_case = dabs(fv) > dabs(pv);
amortsched->bp = bep ? 1.0 : 0.0;
@@ -1564,7 +1565,7 @@ amort_sched_ptr amortsched)
* use actual number of days
*/
s = Init_Date_jdn - Eff_Date_jdn;
days_to_yr_end = jdn(amortsched->year_I + 1,1,0) - Init_Date_jdn;
days_to_yr_end = julian_day_number(amortsched->year_I + 1,1,0) - Init_Date_jdn;
d = 366 / PF;
} else {
/* Payment frequency per year bi-monthly or less
@@ -1611,11 +1612,11 @@ amort_sched_ptr amortsched)
/*
* option 3, compute new periodic payment
*/
amortsched->new_pmt = new_pmt = rnd(_PMT(n,nint,pve,fv,CF,PF,disc,bep),prec);
amortsched->new_pmt = new_pmt = rnd(_fi_calc_payment(n,nint,pve,fv,CF,PF,disc,bep),prec);
/*
* option 4: compute new number of total payments, new_n
*/
amortsched->new_n = new_n = (unsigned)rnd(_N(nint,pve,pmt,fv,CF,PF,disc,bep),0);
amortsched->new_n = new_n = (unsigned)rnd(_fi_calc_num_payments(nint,pve,pmt,fv,CF,PF,disc,bep),0);
/* following used in QTAwk to insure integer value, not needed in C
*/
@@ -1639,16 +1640,16 @@ amort_sched_ptr amortsched)
if ( bep ) {
amortsched->final_pmt_opt_3 = rnd(_FV(n - 1,nint,pv,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
amortsched->final_pmt_opt_4 = rnd(_FV(n - 1,nint,pve,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
amortsched->final_pmt_opt_5 = rnd(_FV(n - 1,nint,pve,new_pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
if ( new_n ) amortsched->final_pmt_opt_6 = rnd(_FV(new_n - 1,nint,pve,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
amortsched->final_pmt_opt_3 = rnd(_fi_calc_future_value(n - 1,nint,pv,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
amortsched->final_pmt_opt_4 = rnd(_fi_calc_future_value(n - 1,nint,pve,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
amortsched->final_pmt_opt_5 = rnd(_fi_calc_future_value(n - 1,nint,pve,new_pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
if ( new_n ) amortsched->final_pmt_opt_6 = rnd(_fi_calc_future_value(new_n - 1,nint,pve,pmt,CF,PF,disc,bep) - (fv/(1.0 + eint)),prec);
else amortsched->final_pmt_opt_6 = 0.0;
} else {
amortsched->final_pmt_opt_3 = rnd(_FV(n - 1,nint,pv,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
amortsched->final_pmt_opt_4 = rnd(_FV(n - 1,nint,pve,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
amortsched->final_pmt_opt_5 = rnd(_FV(n - 1,nint,pve,new_pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
if ( new_n ) amortsched->final_pmt_opt_6 = rnd(_FV(new_n - 1,nint,pve,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
amortsched->final_pmt_opt_3 = rnd(_fi_calc_future_value(n - 1,nint,pv,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
amortsched->final_pmt_opt_4 = rnd(_fi_calc_future_value(n - 1,nint,pve,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
amortsched->final_pmt_opt_5 = rnd(_fi_calc_future_value(n - 1,nint,pve,new_pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
if ( new_n ) amortsched->final_pmt_opt_6 = rnd(_fi_calc_future_value(new_n - 1,nint,pve,pmt,CF,PF,disc,bep) * (1.0 + eint) - fv,prec);
else amortsched->final_pmt_opt_6 = 0.0;
} /* endif */
@@ -1684,7 +1685,7 @@ amort_sched_ptr amortsched)
s,
yr,
per_cnt,
pmt_cnt,
pmt_cnt = 0,
k = 0,
sum_prt;
@@ -2309,7 +2310,7 @@ amort_sched_ptr amortsched)
yr_fv = fv;
yr_int = rnd(((jj - 1) * pmt) + hpv + final_pmt,prec);
} else {
yr_fv = -rnd(_FV(yr_pmt,nint,hpv,pmt,CF,PF,disc,bep),prec);
yr_fv = -rnd(_fi_calc_future_value(yr_pmt,nint,hpv,pmt,CF,PF,disc,bep),prec);
yr_int = rnd((yr_pmt * pmt) + hpv - yr_fv,prec);
} /* * endif */

View File

@@ -90,7 +90,7 @@ static void free_var(
var_store_ptr value,
parser_env_ptr pe);
/* Line Number: 596 */
static unsigned char next_token(
static void next_token(
parser_env_ptr pe);
/* Line Number: 426 */
static void assignment_op(

View File

@@ -24,10 +24,10 @@
/* fin.c
*/
/* Line Number: 1209 */
unsigned N(
unsigned fi_calc_num_payments(
fi_ptr fi);
/* Line Number: 1221 */
double _N(
double _fi_calc_num_payments(
double nint, /* nominal interest rate */
double pv, /* present value */
double pmt, /* periodic payment */
@@ -37,10 +37,10 @@ double _N(
unsigned disc, /* discrete/continuous compounding flag */
unsigned bep); /* beginning/end of period payment flag */
/* Line Number: 1240 */
double I(
double fi_calc_interest(
fi_ptr fi);
/* Line Number: 1257 */
double _I(
double _fi_calc_interest(
unsigned per, /* number of periods */
double pv, /* present value */
double pmt, /* periodic payment */
@@ -50,10 +50,10 @@ double _I(
unsigned disc, /* discrete/continuous compounding flag */
unsigned bep); /* beginning/end of period payment flag */
/* Line Number: 1300 */
double PV(
double fi_calc_present_value(
fi_ptr fi);
/* Line Number: 1312 */
double _PV(
double _fi_calc_present_value(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pmt, /* periodic payment */
@@ -63,10 +63,10 @@ double _PV(
unsigned disc, /* discrete/continuous compounding flag */
unsigned bep); /* beginning/end of period payment flag */
/* Line Number: 1332 */
double PMT(
double fi_calc_payment(
fi_ptr fi);
/* Line Number: 1344 */
double _PMT(
double _fi_calc_payment(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pv, /* present value */
@@ -76,10 +76,10 @@ double _PMT(
unsigned disc, /* discrete/continuous compounding flag */
unsigned bep); /* beginning/end of period payment flag */
/* Line Number: 1363 */
double FV(
double fi_calc_future_value(
fi_ptr fi);
/* Line Number: 1375 */
double _FV(
double _fi_calc_future_value(
unsigned per, /* number of periods */
double nint, /* nominal interest rate */
double pv, /* present value */
@@ -92,7 +92,7 @@ double _FV(
void set_default(
fi_ptr fi);
/* Line Number: 1511 */
unsigned long jdn(
unsigned long julian_day_number(
unsigned year,
unsigned month,
unsigned day);

View File

@@ -294,7 +294,7 @@ init_fi(FinCalcDialog *fcd)
fcd->financial_info.disc = TRUE;
fcd->financial_info.prec = lc->frac_digits;
FV(&fcd->financial_info);
fi_calc_future_value(&fcd->financial_info);
}
/* Determine whether the value can be calculated. If it can, return
@@ -374,19 +374,19 @@ calc_value(FinCalcDialog *fcd, FinCalcValue value)
switch (value)
{
case PAYMENT_PERIODS:
N(&fcd->financial_info);
fi_calc_num_payments(&fcd->financial_info);
break;
case INTEREST_RATE:
I(&fcd->financial_info);
fi_calc_interest(&fcd->financial_info);
break;
case PRESENT_VALUE:
PV(&fcd->financial_info);
fi_calc_present_value(&fcd->financial_info);
break;
case PERIODIC_PAYMENT:
PMT(&fcd->financial_info);
fi_calc_payment(&fcd->financial_info);
break;
case FUTURE_VALUE:
FV(&fcd->financial_info);
fi_calc_future_value(&fcd->financial_info);
break;
default:
PERR("Unknown financial variable");

View File

@@ -57,6 +57,7 @@ struct _xferDialog
GtkWidget * amount_entry;
GtkWidget * date_entry;
GtkWidget * num_entry;
GtkWidget * description_entry;
GtkWidget * memo_entry;
@@ -126,7 +127,7 @@ gnc_xfer_dialog_create_tree_frame(gchar *title,
button = gtk_check_button_new_with_label(SHOW_INC_EXP_STR);
*set_show_button = button;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_tooltips_set_tip(tooltips, button, SHOW_INC_EXP_MSG, NULL);
@@ -240,6 +241,54 @@ gnc_xfer_dialog_select_to_account(XferDialog *xferData, Account *account)
}
/********************************************************************\
* gnc_xfer_dialog_set_amount *
* set the amount in the given xfer dialog *
* *
* Args: xferData - xfer dialog structure *
* amount - the amount to set *
* Return: none *
\********************************************************************/
void
gnc_xfer_dialog_set_amount(XferDialog *xferData, double amount)
{
Account *account;
const char *currency;
gchar *string;
if (xferData == NULL)
return;
account = gnc_account_tree_get_current_account(xferData->from);
if (account == NULL)
account = gnc_account_tree_get_current_account(xferData->to);
currency = xaccAccountGetCurrency(account);
string = xaccPrintAmount(amount, PRTSEP, currency);
gtk_entry_set_text(GTK_ENTRY(xferData->amount_entry), string);
}
/********************************************************************\
* gnc_xfer_dialog_set_description *
* set the description in the given xfer dialog *
* *
* Args: xferData - xfer dialog structure *
* description - the description to set *
* Return: none *
\********************************************************************/
void
gnc_xfer_dialog_set_description(XferDialog *xferData, const char *description)
{
if (xferData == NULL)
return;
gtk_entry_set_text(GTK_ENTRY(xferData->description_entry), description);
}
static void
gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
{
@@ -286,6 +335,9 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
xaccTransBeginEdit(trans, GNC_T);
xaccTransSetDateSecs(trans, time);
string = gtk_entry_get_text(GTK_ENTRY(xferData->num_entry));
xaccTransSetNum(trans, string);
string = gtk_entry_get_text(GTK_ENTRY(xferData->description_entry));
xaccTransSetDescription(trans, string);
@@ -387,7 +439,7 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
tooltips = gtk_tooltips_new();
/* contains amount, date, description, and notes */
/* contains amount, date, num, description, and memo */
{
GtkWidget *frame, *vbox, *hbox, *label;
@@ -441,16 +493,23 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
gtk_box_pack_start(GTK_BOX(vbox), sep, TRUE, TRUE, 3);
}
/* Contains description and memo */
/* Contains num, description, and memo */
hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
{
GtkWidget *vbox;
gchar *string;
vbox = gtk_vbox_new(TRUE, 5);
gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
string = g_strconcat(NUM_STR, ":", NULL);
label = gtk_label_new(string);
g_free(string);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
label = gtk_label_new(DESC_C_STR);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
@@ -461,20 +520,25 @@ gnc_xfer_dialog_create(GtkWidget * parent, XferDialog *xferData)
}
{
GtkWidget *vbox, *desc, *memo;
GtkWidget *vbox, *entry;
vbox = gtk_vbox_new(TRUE, 5);
gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
desc = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(vbox), desc, TRUE, TRUE, 0);
xferData->description_entry = desc;
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(desc));
entry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(vbox), entry, TRUE, TRUE, 0);
xferData->num_entry = entry;
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(entry));
memo = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(vbox), memo, TRUE, TRUE, 0);
xferData->memo_entry = memo;
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(memo));
entry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(vbox), entry, TRUE, TRUE, 0);
xferData->description_entry = entry;
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(entry));
entry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(vbox), entry, TRUE, TRUE, 0);
xferData->memo_entry = entry;
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(entry));
}
}

View File

@@ -30,4 +30,13 @@ XferDialog * gnc_xfer_dialog(GtkWidget * parent, Account *initial);
void gnc_ui_destroy_xfer_windows();
void gnc_xfer_dialog_select_from_account(XferDialog *xferData,
Account *account);
void gnc_xfer_dialog_select_to_account(XferDialog *xferData,
Account *account);
void gnc_xfer_dialog_set_amount(XferDialog *xferData, double amount);
void gnc_xfer_dialog_set_description(XferDialog *xferData,
const char *description);
#endif