mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
updates from rob browning
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@893 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
167058962d
commit
d63896c7a6
@ -97,12 +97,18 @@ void xaccInitComboCell (ComboCell *cell)
|
|||||||
static
|
static
|
||||||
void destroyCombo (BasicCell *bcell)
|
void destroyCombo (BasicCell *bcell)
|
||||||
{
|
{
|
||||||
ComboCell *cell;
|
ComboCell *cell = (ComboCell *) bcell;
|
||||||
|
PopBox *box = (PopBox *) (cell->cell.gui_private);
|
||||||
|
|
||||||
cell = (ComboCell *) bcell;
|
/* HACK: I had to put the three extra tests in the guard so that
|
||||||
|
we don't get a segfault on register window closes. I haven't checked
|
||||||
if (!(cell->cell.realize)) {
|
to be sure this is exactly the right thing to do, but it works.
|
||||||
PopBox *box = (PopBox *) (cell->cell.gui_private);
|
|
||||||
|
Actually, almost all of the combobox (and table-gtk for that
|
||||||
|
matter) code is an ugly hack that should go away when we have a
|
||||||
|
real table widget... */
|
||||||
|
|
||||||
|
if (!(cell->cell.realize) && box && box->table && box->table->entry_frame) {
|
||||||
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
|
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
|
||||||
GTK_WIDGET(box->combobox));
|
GTK_WIDGET(box->combobox));
|
||||||
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),
|
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),
|
||||||
|
@ -614,6 +614,8 @@ xaccCreateTable (Table *table, GtkWidget * parent)
|
|||||||
}
|
}
|
||||||
gtk_clist_thaw(GTK_CLIST(reg));
|
gtk_clist_thaw(GTK_CLIST(reg));
|
||||||
}
|
}
|
||||||
|
gtk_clist_set_policy(GTK_CLIST(reg),
|
||||||
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||||
|
|
||||||
gtk_clist_freeze(GTK_CLIST(reg));
|
gtk_clist_freeze(GTK_CLIST(reg));
|
||||||
for(i = num_header_rows; i < table->num_phys_rows; i++) {
|
for(i = num_header_rows; i < table->num_phys_rows; i++) {
|
||||||
@ -712,7 +714,7 @@ void
|
|||||||
xaccRefreshTableGUI (Table * table)
|
xaccRefreshTableGUI (Table * table)
|
||||||
{
|
{
|
||||||
CellBlock *curs;
|
CellBlock *curs;
|
||||||
GtkWidget * reg;
|
GtkCList * reg;
|
||||||
int num_header_rows = 0;
|
int num_header_rows = 0;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -722,7 +724,7 @@ xaccRefreshTableGUI (Table * table)
|
|||||||
/* The 0'th row of the handlers is defined as the header */
|
/* The 0'th row of the handlers is defined as the header */
|
||||||
curs = table->handlers[0][0];
|
curs = table->handlers[0][0];
|
||||||
num_header_rows = curs->numRows;
|
num_header_rows = curs->numRows;
|
||||||
reg = table->table_widget;
|
reg = GTK_CLIST(table->table_widget);
|
||||||
|
|
||||||
printf (" refresh numphysrows=%d numphyscols=%d \n",
|
printf (" refresh numphysrows=%d numphyscols=%d \n",
|
||||||
table->num_phys_rows, table->num_phys_cols);
|
table->num_phys_rows, table->num_phys_cols);
|
||||||
@ -733,20 +735,24 @@ xaccRefreshTableGUI (Table * table)
|
|||||||
table->entries[i][3]);
|
table->entries[i][3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_clist_freeze(GTK_CLIST(reg));
|
gtk_clist_freeze(reg);
|
||||||
|
|
||||||
while(GTK_CLIST(reg)->rows < (table->num_phys_rows - num_header_rows)) {
|
/* Adjust table to have the right number of rows */
|
||||||
gtk_clist_append(GTK_CLIST(reg), NULL);
|
while(reg->rows < (table->num_phys_rows - num_header_rows)) {
|
||||||
|
gtk_clist_append(reg, NULL);
|
||||||
|
}
|
||||||
|
while(reg->rows > (table->num_phys_rows - num_header_rows)) {
|
||||||
|
gtk_clist_remove(reg, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = num_header_rows; i < table->num_phys_rows; i++)
|
for(i = num_header_rows; i < table->num_phys_rows; i++)
|
||||||
{
|
{
|
||||||
for(j = 0; j < table->num_phys_cols; j++) {
|
for(j = 0; j < table->num_phys_cols; j++) {
|
||||||
gtk_clist_set_text(GTK_CLIST(reg), i - num_header_rows, j,
|
gtk_clist_set_text(reg, i - num_header_rows, j, table->entries[i][j]);
|
||||||
table->entries[i][j]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gtk_clist_thaw(GTK_CLIST(reg));
|
|
||||||
|
gtk_clist_thaw(reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================== end of file ======================= */
|
/* ================== end of file ======================= */
|
||||||
|
Loading…
Reference in New Issue
Block a user