Rework the date input for the print check dialog. (#95022) Move the

third check upward on the page by 1/2 inch. (#95016)  Print the memo
field on the check. (#95015)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7297 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2002-10-12 22:17:31 +00:00
parent 9337273406
commit 33cddb3ae7
6 changed files with 628 additions and 186 deletions
+26
View File
@@ -1,5 +1,31 @@
2002-10-12 David Hampton <hampton@employees.org>
* src/scm/printing/print-check.scm (gnc:*stock-check-positions*):
Move the bottom check up by 1/2 inch. #95016 (gnc:print-check):
Actually print the memo field on the check. #95015
* src/gnome/window-register.c (gnc_register_print_check_cb): Print
the Notes field of the transaction, not the memo field of the
split. #95015
* src/gnome/dialog-print-check.c
(gnc_ui_print_compute_new_format): Update the sample date value in
the dialog box any time one of the controls is updated.
(gnc_ui_print_check_format_changed_cb): New callback function.
(gnc_ui_print_check_dialog_create): Update for new controls and
for the dynamicly updating sample date string. #95022
* src/gnome-utils/dialog-utils.c (gnc_option_menu_init_w_signal):
Set up an option menu with an attached callback so that the
program knows when the user changes the setting of the option
menu.
* src/engine/date.c (getDateFormat): New routines for getting
preferred date style. (getDateFormatString): Get the numeric
format string for a date, i.e. "12/31/2000".
(getDateTextFormatString): Get the textual format string for a
date, i.e. "December 31, 2000".
* src/engine/gnc-session.c:
* src/app-file/gnc-file.c:
* src/app-utils/gnc-ui-util.c: Move gnc_get_current_session() into
+172 -55
View File
@@ -28,6 +28,7 @@
#include <gnome.h>
#include <guile/gh.h>
#include "date.h"
#include "messages.h"
#include "dialog-print-check.h"
#include "dialog-utils.h"
@@ -40,13 +41,125 @@
#define CHECK_PRINT_NUM_DATEFORMATS 9
#define CHECK_PRINT_NUM_UNITS 4
#define MAX_DATE_LEN 80
/* Used by glade_xml_signal_autoconnect_full */
void gnc_ui_print_check_dialog_ok_cb(GtkButton * button,
gpointer user_data);
void gnc_ui_print_check_dialog_cancel_cb(GtkButton * button,
gpointer user_data);
void gnc_ui_print_check_dialog_help_cb(GtkButton * button,
gpointer user_data);
void gnc_ui_print_check_format_changed_cb(GtkWidget *unused,
gpointer user_data);
static gboolean saved_include_century = TRUE;
static gboolean saved_month_name = FALSE;
static gboolean saved_month_name_long = FALSE;
static int gnc_ui_print_get_option_menu_item (GtkWidget *widget)
{
GtkWidget * menu, * menuitem;
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(widget));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
return GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
"option_index"));
}
static void
gnc_ui_print_enable_month (PrintCheckDialog *pcd, gboolean sensitive)
{
gtk_widget_set_sensitive(pcd->month_label, sensitive);
gtk_widget_set_sensitive(pcd->month_name, sensitive);
}
static void
gnc_ui_print_enable_year (PrintCheckDialog *pcd, gboolean sensitive)
{
gtk_widget_set_sensitive(pcd->year_label, sensitive);
gtk_widget_set_sensitive(pcd->include_century, sensitive);
}
static void
gnc_ui_print_enable_format (PrintCheckDialog *pcd, gboolean sensitive)
{
gtk_widget_set_sensitive(pcd->custom_label, sensitive);
gtk_widget_set_sensitive(pcd->custom_format, sensitive);
}
static void
gnc_ui_print_compute_new_format (PrintCheckDialog *pcd)
{
int sel_option = gnc_ui_print_get_option_menu_item(pcd->dformat_picker);
static gchar *format, *c;
gchar date_string[MAX_DATE_LEN];
time_t secs_now;
struct tm today;
if (pcd->format_string) {
g_free(pcd->format_string);
pcd->format_string = NULL;
}
if (sel_option >= DATE_FORMAT_LOCALE) {
format = g_strdup(gtk_entry_get_text(GTK_ENTRY(pcd->custom_format)));
gtk_widget_set_sensitive(pcd->month_name_long, FALSE);
gnc_ui_print_enable_month(pcd, FALSE);
gnc_ui_print_enable_year(pcd, FALSE);
gnc_ui_print_enable_format(pcd, TRUE);
goto finish;
}
gnc_ui_print_enable_year(pcd, TRUE);
gnc_ui_print_enable_format(pcd, FALSE);
if (sel_option == DATE_FORMAT_ISO) {
gnc_ui_print_enable_month(pcd, FALSE);
gtk_widget_set_sensitive(pcd->month_name_long, FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcd->month_name),
FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcd->month_name_long),
FALSE);
} else {
gnc_ui_print_enable_month(pcd, TRUE);
}
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pcd->month_name))) {
format = g_strdup(getDateFormatString(sel_option));
gtk_widget_set_sensitive(pcd->month_name_long, FALSE);
} else {
format = g_strdup(getDateTextFormatString(sel_option));
gtk_widget_set_sensitive(pcd->month_name_long, TRUE);
if (gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(pcd->month_name_long))) {
c = strchr(format, 'b');
if (c)
*c = 'B';
}
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pcd->include_century))) {
c = strchr(format, 'y');
if (c)
*c = 'Y';
}
finish:
pcd->format_string = format;
secs_now = time(NULL);
localtime_r(&secs_now, &today);
strftime(date_string, MAX_DATE_LEN, format, &today);
gtk_label_set_text(GTK_LABEL(pcd->sample_date), date_string);
}
void
gnc_ui_print_check_format_changed_cb(GtkWidget *unused,
gpointer user_data)
{
PrintCheckDialog * pcd = user_data;
gnc_ui_print_compute_new_format(pcd);
}
static void gnc_ui_print_check_dialog_ok_cb(GtkButton * button,
gpointer user_data);
static void gnc_ui_print_check_dialog_cancel_cb(GtkButton * button,
gpointer user_data);
static void gnc_ui_print_check_dialog_help_cb(GtkButton * button,
gpointer user_data);
/********************************************************************\
@@ -55,23 +168,14 @@ static void gnc_ui_print_check_dialog_help_cb(GtkButton * button,
\********************************************************************/
PrintCheckDialog *
gnc_ui_print_check_dialog_create(SCM callback) {
gnc_ui_print_check_dialog_create(SCM callback)
{
PrintCheckDialog * pcd = g_new0(PrintCheckDialog, 1);
GladeXML *xml;
xml = gnc_glade_xml_new ("print.glade", "Print Check Dialog");
glade_xml_signal_connect_data
(xml, "gnc_ui_print_check_dialog_ok_cb",
GTK_SIGNAL_FUNC (gnc_ui_print_check_dialog_ok_cb), pcd);
glade_xml_signal_connect_data
(xml, "gnc_ui_print_check_dialog_cancel_cb",
GTK_SIGNAL_FUNC (gnc_ui_print_check_dialog_cancel_cb), pcd);
glade_xml_signal_connect_data
(xml, "gnc_ui_print_check_dialog_help_cb",
GTK_SIGNAL_FUNC (gnc_ui_print_check_dialog_help_cb), pcd);
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, pcd);
pcd->dialog = glade_xml_get_widget (xml, "Print Check Dialog");
pcd->callback = callback;
@@ -81,6 +185,15 @@ gnc_ui_print_check_dialog_create(SCM callback) {
pcd->position_picker = glade_xml_get_widget (xml, "check_position_picker");
pcd->dformat_picker = glade_xml_get_widget (xml, "date_format_picker");
pcd->month_label = glade_xml_get_widget (xml, "month_label");
pcd->month_name = glade_xml_get_widget (xml, "month_name");
pcd->month_name_long = glade_xml_get_widget (xml, "month_name_long");
pcd->year_label = glade_xml_get_widget (xml, "year_label");
pcd->include_century = glade_xml_get_widget (xml, "include_century");
pcd->sample_date = glade_xml_get_widget (xml, "sample_date");
pcd->custom_label = glade_xml_get_widget (xml, "custom_label");
pcd->custom_format = glade_xml_get_widget (xml, "custom_format");
pcd->payee_x = glade_xml_get_widget (xml, "payee_x_entry");
pcd->payee_y = glade_xml_get_widget (xml, "payee_y_entry");
pcd->date_x = glade_xml_get_widget (xml, "date_x_entry");
@@ -95,15 +208,28 @@ gnc_ui_print_check_dialog_create(SCM callback) {
pcd->format_entry = glade_xml_get_widget (xml, "date_format_entry");
pcd->units_picker = glade_xml_get_widget (xml, "units_picker");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcd->include_century),
saved_include_century);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcd->month_name),
saved_month_name);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pcd->month_name_long),
saved_month_name_long);
/* fix the option menus so we can diagnose which option is
selected */
gnc_option_menu_init(pcd->format_picker);
gnc_option_menu_init(pcd->position_picker);
gnc_option_menu_init(pcd->dformat_picker);
gnc_option_menu_init_w_signal(pcd->dformat_picker,
gnc_ui_print_check_format_changed_cb, pcd);
gnc_option_menu_init(pcd->units_picker);
scm_protect_object(pcd->callback);
/* Set initial format to gnucash default */
gtk_option_menu_set_history(GTK_OPTION_MENU(pcd->dformat_picker),
getDateFormat());
gnc_ui_print_compute_new_format(pcd);
gtk_widget_show_all(pcd->dialog);
return pcd;
@@ -115,18 +241,22 @@ gnc_ui_print_check_dialog_create(SCM callback) {
\********************************************************************/
void
gnc_ui_print_check_dialog_destroy(PrintCheckDialog * pcd) {
gnc_ui_print_check_dialog_destroy(PrintCheckDialog * pcd)
{
gnome_dialog_close(GNOME_DIALOG(pcd->dialog));
scm_unprotect_object(pcd->callback);
if (pcd->format_string)
g_free(pcd->format_string);
pcd->dialog = NULL;
g_free(pcd);
}
static double
entry_to_double(GtkWidget * entry) {
entry_to_double(GtkWidget * entry)
{
char * text = gtk_entry_get_text(GTK_ENTRY(entry));
double retval = 0.0;
@@ -139,46 +269,35 @@ entry_to_double(GtkWidget * entry) {
* gnc_ui_print_check_dialog_ok_cb
\********************************************************************/
static void
void
gnc_ui_print_check_dialog_ok_cb(GtkButton * button,
gpointer user_data) {
gpointer user_data)
{
PrintCheckDialog * pcd = user_data;
SCM make_check_format = gh_eval_str("make-print-check-format");
SCM callback;
SCM fmt, posn, cust_format, date_format;
GtkWidget * menu, * menuitem;
int sel_option;
double multip = 72.0;
char * formats[] = { "quicken", "custom" };
char * positions[] = { "top", "middle", "bottom", "custom" };
char * dateformats[] = { "%B %e, %Y",
"%e %B, %Y",
"%b %e, %Y",
"%e %b, %Y",
"%m/%d/%Y",
"%m/%d/%y",
"%d/%m/%Y",
"%d/%m/%y",
"custom" };
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(pcd->format_picker));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
sel_option = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
"option_index"));
saved_include_century =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pcd->include_century));
saved_month_name =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pcd->month_name));
saved_month_name_long =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pcd->month_name_long));
sel_option = gnc_ui_print_get_option_menu_item(pcd->format_picker);
fmt = gh_symbol2scm(formats[sel_option]);
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(pcd->position_picker));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
sel_option = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
"option_index"));
sel_option = gnc_ui_print_get_option_menu_item(pcd->position_picker);
posn = gh_symbol2scm(positions[sel_option]);
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(pcd->units_picker));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
sel_option = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
"option_index"));
sel_option = gnc_ui_print_get_option_menu_item(pcd->units_picker);
switch(sel_option) {
case 0: multip = 72.0; break; /* inches */
case 1: multip = 28.346; break; /* cm */
@@ -186,11 +305,7 @@ gnc_ui_print_check_dialog_ok_cb(GtkButton * button,
case 3: multip = 1.0; break; /* points */
}
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(pcd->dformat_picker));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
sel_option = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
"option_index"));
date_format = gh_str02scm(dateformats[sel_option]);
date_format = gh_str02scm(pcd->format_string);
cust_format =
SCM_LIST7
@@ -232,9 +347,10 @@ gnc_ui_print_check_dialog_ok_cb(GtkButton * button,
* gnc_ui_print_check_dialog_cancel_cb
\********************************************************************/
static void
void
gnc_ui_print_check_dialog_cancel_cb(GtkButton * button,
gpointer user_data) {
gpointer user_data)
{
PrintCheckDialog * pcd = user_data;
gnc_ui_print_check_dialog_destroy(pcd);
@@ -244,8 +360,9 @@ gnc_ui_print_check_dialog_cancel_cb(GtkButton * button,
* gnc_ui_print_check_dialog_help_cb
\********************************************************************/
static void
void
gnc_ui_print_check_dialog_help_cb(GtkButton * button,
gpointer user_data) {
gpointer user_data)
{
helpWindow(NULL, NULL, HH_PRINTCHECK);
}
+6
View File
@@ -46,6 +46,12 @@ typedef struct {
GtkWidget * format_entry;
GtkWidget * units_picker;
GtkWidget * month_label, * year_label;
GtkWidget * month_name, * month_name_long;
GtkWidget * include_century, * sample_date;
GtkWidget * custom_label, * custom_format;
gchar *format_string;
SCM callback;
+415 -129
View File
@@ -66,8 +66,7 @@
<signal>
<name>clicked</name>
<handler>gnc_ui_print_check_dialog_ok_cb</handler>
<data>Print_Check_Dialog</data>
<last_modification_time>Tue, 28 Mar 2000 19:36:10 GMT</last_modification_time>
<last_modification_time>Fri, 11 Oct 2002 00:26:43 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
@@ -80,8 +79,7 @@
<signal>
<name>clicked</name>
<handler>gnc_ui_print_check_dialog_cancel_cb</handler>
<data>Print_Check_Dialog</data>
<last_modification_time>Tue, 28 Mar 2000 19:36:22 GMT</last_modification_time>
<last_modification_time>Fri, 11 Oct 2002 00:26:56 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
@@ -94,8 +92,7 @@
<signal>
<name>clicked</name>
<handler>gnc_ui_print_check_dialog_help_cb</handler>
<data>Print_Check_Dialog</data>
<last_modification_time>Tue, 28 Mar 2000 19:36:37 GMT</last_modification_time>
<last_modification_time>Fri, 11 Oct 2002 00:27:08 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_HELP</stock_button>
</widget>
@@ -119,150 +116,439 @@
</child>
<widget>
<class>GtkVBox</class>
<name>vbox10</name>
<class>GtkTable</class>
<name>table1</name>
<border_width>5</border_width>
<rows>8</rows>
<columns>4</columns>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<row_spacing>0</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkHBox</class>
<name>hbox15</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<class>GtkLabel</class>
<name>label847677</name>
<label>Check format:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox11</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>5</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label847678</name>
<label>Check position:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label699</name>
<label>Check format:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label847679</name>
<label>Date format:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label700</name>
<label>Check position:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>month_name_long</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>gnc_ui_print_check_format_changed_cb</handler>
<last_modification_time>Fri, 11 Oct 2002 01:10:55 GMT</last_modification_time>
</signal>
<label>use long name</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>3</left_attach>
<right_attach>4</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label713</name>
<label>Date format:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>month_name</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>gnc_ui_print_check_format_changed_cb</handler>
<last_modification_time>Fri, 11 Oct 2002 01:11:07 GMT</last_modification_time>
</signal>
<label>use name</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox12</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCheckButton</class>
<name>include_century</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>gnc_ui_print_check_format_changed_cb</handler>
<last_modification_time>Fri, 11 Oct 2002 01:11:20 GMT</last_modification_time>
</signal>
<label>include century</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>check_format_picker</name>
<can_focus>True</can_focus>
<items>Quicken/QuickBooks (tm) US-Letter
<widget>
<class>GtkOptionMenu</class>
<name>check_format_picker</name>
<can_focus>True</can_focus>
<items>Quicken/QuickBooks (tm) US-Letter
Custom
</items>
<initial_choice>0</initial_choice>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<initial_choice>0</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>4</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>check_position_picker</name>
<can_focus>True</can_focus>
<items>Top
<widget>
<class>GtkOptionMenu</class>
<name>check_position_picker</name>
<can_focus>True</can_focus>
<items>Top
Middle
Bottom
Custom
</items>
<initial_choice>0</initial_choice>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<initial_choice>0</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>4</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>date_format_picker</name>
<can_focus>True</can_focus>
<items>December 31, 2000
31 December, 2000
Dec 31, 2000
31 Dec, 2000
12/31/2000
12/31/00
31/12/2000
31/12/00
<widget>
<class>GtkOptionMenu</class>
<name>date_format_picker</name>
<can_focus>True</can_focus>
<items>US
UK
Europe
ISO
Locale
Custom
</items>
<initial_choice>0</initial_choice>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
<initial_choice>5</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>4</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>month_label</name>
<label>Months:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>year_label</name>
<label>Years:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>custom_label</name>
<label>Format:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>custom_format</name>
<tooltip>Specify the format for the date with strftime(3) formatting codes.</tooltip>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>gnc_ui_print_check_format_changed_cb</handler>
<last_modification_time>Sat, 12 Oct 2002 21:43:29 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>%Y-%m-%d</text>
<child>
<left_attach>2</left_attach>
<right_attach>4</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label847680</name>
<label>Sample:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>7</top_attach>
<bottom_attach>8</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>sample_date</name>
<label>December 31, 2000</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>4</right_attach>
<top_attach>7</top_attach>
<bottom_attach>8</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>placeholder</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>6</top_attach>
<bottom_attach>7</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
+3 -1
View File
@@ -1065,7 +1065,9 @@ gnc_register_print_check_cb(GtkWidget * widget, gpointer data)
gh_procedure_p(print_check))
{
payee = xaccTransGetDescription(trans);
memo = xaccSplitGetMemo(split);
memo = xaccTransGetNotes(trans);
if (memo == NULL)
memo = "";
amount = xaccSplitGetAmount(split);
amount = gnc_numeric_abs (amount);
date = xaccTransGetDate(trans);
+6 -1
View File
@@ -70,7 +70,7 @@
(define gnc:*stock-check-positions*
'((top . 540.0)
(middle . 288.0)
(bottom . 0.0)))
(bottom . 36.0)))
(define (gnc:print-check payee amount date memo)
(define (print-check-callback format-info)
@@ -132,6 +132,11 @@
(+ offset (caddr words-pos)))
(gnc:print-session-text ps (number-to-words amount 100)))
(let ((memo-pos (assq 'memo format)))
(gnc:print-session-moveto ps (cadr memo-pos)
(+ offset (caddr memo-pos)))
(gnc:print-session-text ps memo))
(gnc:print-session-done ps #t)
(gnc:print-session-print ps)))