actually supply a header row now, and connect the buttons. The window

is still very ugly, colors are b0rked, and the dialog buttons
are in the wrong place.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6152 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2001-11-30 22:32:27 +00:00
parent 04eb2a6d6d
commit 9652b0362b
3 changed files with 51 additions and 9 deletions

View File

@ -179,6 +179,7 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
GtkWidget *vbox, *regWidget;
GncEntryLedger *entry_ledger;
GnomeDialog *owd;
GList *entries;
ow = g_new0 (OrderWindow, 1);
@ -196,6 +197,9 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
/* Build the ledger */
entry_ledger = gnc_entry_ledger_new (ow->book, GNCENTRY_LEDGER);
entries = gncOrderGetEntries (order);
/* Set watches on entries*/
gnc_entry_ledger_load (entry_ledger, entries);
/* Watch the order of operations, here... */
gnucash_register_set_initial_rows( 6 );
@ -214,6 +218,13 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
gtk_signal_connect (GTK_OBJECT (ow->dialog), "destroy",
GTK_SIGNAL_FUNC(gnc_order_window_destroy_cb), ow);
gnome_dialog_button_connect (owd, 0,
GTK_SIGNAL_FUNC(gnc_order_window_ok_cb), ow);
gnome_dialog_button_connect (owd, 1,
GTK_SIGNAL_FUNC(gnc_order_window_cancel_cb), ow);
gnome_dialog_button_connect (owd, 2,
GTK_SIGNAL_FUNC(gnc_order_window_help_cb), ow);
/* Setup initial values */
if (order != NULL) {
ow->dialog_type = EDIT_ORDER;

View File

@ -37,15 +37,15 @@
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area1</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
@ -71,7 +71,7 @@
<name>button2</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<widget>
@ -79,7 +79,7 @@
<name>button3</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
<stock_button>GNOME_STOCK_BUTTON_HELP</stock_button>
</widget>
</widget>
@ -90,8 +90,8 @@
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>

View File

@ -80,7 +80,10 @@ GncEntry * gnc_entry_ledger_get_current_entry (GncEntryLedger *ledger)
}
/* Copy GncEntry information from the list to the rows of the Ledger. */
void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list);
void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list)
{
GncEntry *entry;
}
/* Create and return a new GncEntry Ledger */
@ -107,8 +110,36 @@ GncEntryLedger * gnc_entry_ledger_new (GNCBook *book, GncEntryLedgerType type)
/* config_cells? */
/* set up header */
{
VirtualCellLocation vcell_loc = { 0, 0 };
CellBlock *header;
header = gnc_table_layout_get_cursor (ledger->table->layout, CURSOR_HEADER);
gnc_table_set_vcell (ledger->table, header, NULL, TRUE, TRUE, vcell_loc);
}
/* set up first initial row */
{
VirtualLocation vloc;
CellBlock *cursor;
vloc.vcell_loc.virt_row = 1;
vloc.vcell_loc.virt_col = 0;
vloc.phys_row_offset = 0;
vloc.phys_col_offset = 0;
cursor = gnc_table_layout_get_cursor (ledger->table->layout, "cursor");
gnc_table_set_vcell (ledger->table, cursor, NULL, TRUE, TRUE, vloc.vcell_loc);
if (gnc_table_find_close_valid_cell (ledger->table, &vloc, FALSE))
gnc_table_move_cursor (ledger->table, vloc);
else
{
g_warning ("Can't find valid initial location");
}
}
return ledger;
}
@ -124,7 +155,7 @@ void gnc_entry_ledger_destroy (GncEntryLedger *ledger)
Table * gnc_entry_ledger_get_table (GncEntryLedger *ledger)
{
if (!ledger) return;
if (!ledger) return NULL;
return ledger->table;
}