[Gnucash-changes] r14389 - gnucash/branches/deprecated-cleanup - Another GtkOptionMenu to GtkComboBox conversion.
David Hampton
hampton at cvs.gnucash.org
Sun Jun 18 21:44:11 EDT 2006
Author: hampton
Date: 2006-06-18 21:44:10 -0400 (Sun, 18 Jun 2006)
New Revision: 14389
Trac: http://svn.gnucash.org/trac/changeset/14389
Modified:
gnucash/branches/deprecated-cleanup/ChangeLog
gnucash/branches/deprecated-cleanup/src/gnome/druid-loan.c
gnucash/branches/deprecated-cleanup/src/gnome/glade/sched-xact.glade
Log:
Another GtkOptionMenu to GtkComboBox conversion.
Modified: gnucash/branches/deprecated-cleanup/ChangeLog
===================================================================
--- gnucash/branches/deprecated-cleanup/ChangeLog 2006-06-19 01:43:41 UTC (rev 14388)
+++ gnucash/branches/deprecated-cleanup/ChangeLog 2006-06-19 01:44:10 UTC (rev 14389)
@@ -1,3 +1,12 @@
+2006-06-18 David Hampton <hampton at employees.org>
+
+ * src/gnome/druid-loan.c:
+ * src/gnome/glade/sched-xact.glade: Another GtkOptionMenu to
+ GtkComboBox conversion.
+
+ * src/gnome-utils/dialog-options.c: Another GtkCList ->
+ GtkTreeView/GtkListStore conversion.
+
2006-06-17 David Hampton <hampton at employees.org>
* src/import-export/import-main-matcher.c:
Modified: gnucash/branches/deprecated-cleanup/src/gnome/druid-loan.c
===================================================================
--- gnucash/branches/deprecated-cleanup/src/gnome/druid-loan.c 2006-06-19 01:43:41 UTC (rev 14388)
+++ gnucash/branches/deprecated-cleanup/src/gnome/druid-loan.c 2006-06-19 01:44:10 UTC (rev 14389)
@@ -65,6 +65,7 @@
# define PARAM_TABLE "param_table"
# define ORIG_PRINC_ENTRY "orig_princ_ent"
# define IRATE_SPIN "irate_spin"
+# define TYPE_COMBOBOX "type_combobox"
# define VAR_CONTAINER "type_freq_frame"
# define LENGTH_SPIN "len_spin"
# define LENGTH_OPT "len_opt"
@@ -257,7 +258,7 @@
GNCAccountSel *prmAccountGAS;
GNCAmountEdit *prmOrigPrincGAE;
GtkSpinButton *prmIrateSpin;
- GtkOptionMenu *prmType;
+ GtkComboBox *prmType;
GtkFrame *prmVarFrame;
GNCFrequency *prmVarGncFreq;
GNCDateEdit *prmStartDateGDE;
@@ -335,7 +336,7 @@
static void ld_destroy( GtkObject *o, gpointer ud );
static void ld_cancel_check( GnomeDruid *gd, LoanDruidData *ldd );
-static void ld_prm_type_changed( GtkWidget *w, gint index, gpointer ud );
+static void ld_prm_type_changed( GtkWidget *w, gpointer ud );
static void ld_calc_upd_rem_payments( GtkWidget *w, gpointer ud );
static void ld_escrow_toggle( GtkToggleButton *tb, gpointer ud );
@@ -550,26 +551,9 @@
gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame), FALSE );
{
- GtkAlignment *a;
- GNCOptionInfo typeOptInfo[] = {
- { _("Fixed"), _("A Fixed-Rate loan"), ld_prm_type_changed, ldd },
- { _("3/1 Year"),
- /* Translators: ARM = Adjustable Rate Mortgage; that is a
- loan where the rate is constant for the period before
- the '/', e.g. 5 years, and then may change. See also
- http://www.fanniemae.com/tools/glossary.jhtml */
- _("A 3/1 Year ARM"), ld_prm_type_changed, ldd },
- { _("5/1 Year"), _("A 5/1 Year ARM"), ld_prm_type_changed, ldd },
- { _("7/1 Year"), _("A 7/1 Year ARM"), ld_prm_type_changed, ldd },
- { _("10/1 Year"), _("A 10/1 Year ARM"), ld_prm_type_changed, ldd },
- };
- ldd->prmType =
- GTK_OPTION_MENU( gnc_build_option_menu( typeOptInfo, 5 ) );
- a = GTK_ALIGNMENT( gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ) );
- gtk_container_add( GTK_CONTAINER(a), GTK_WIDGET(ldd->prmType) );
- gtk_table_attach( ldd->prmTable, GTK_WIDGET(a),
- 3, 4, 2, 3,
- 0, 0, 2, 2 );
+ g_signal_connect( ldd->prmType, "changed",
+ G_CALLBACK( ld_prm_type_changed ),
+ ldd );
}
{
@@ -607,8 +591,6 @@
gtk_spin_button_set_adjustment( ldd->prmRemainSpin, a );
}
- gnc_option_menu_init( GTK_WIDGET(ldd->prmType) );
-
g_signal_connect( ldd->optEscrowCb, "toggled",
G_CALLBACK(ld_escrow_toggle), ldd );
gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), FALSE );
@@ -862,6 +844,8 @@
GET_CASTED_WIDGET( GTK_TABLE, PARAM_TABLE );
ldd->prmIrateSpin =
GET_CASTED_WIDGET( GTK_SPIN_BUTTON, IRATE_SPIN );
+ ldd->prmType =
+ GET_CASTED_WIDGET( GTK_COMBO_BOX, TYPE_COMBOBOX );
ldd->prmVarFrame =
GET_CASTED_WIDGET( GTK_FRAME, VAR_CONTAINER );
/* ldd->prmStartDateGDE */
@@ -1055,11 +1039,13 @@
static
void
-ld_prm_type_changed( GtkWidget *w, gint index, gpointer ud )
+ld_prm_type_changed( GtkWidget *w, gpointer ud )
{
LoanDruidData *ldd;
+ gint index;
ldd = (LoanDruidData*)ud;
+ index = gtk_combo_box_get_active( ldd->prmType );
gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame),
index != FIXED );
}
@@ -1170,7 +1156,7 @@
}
ldd->ld.principal = gnc_amount_edit_get_amount( ldd->prmOrigPrincGAE );
ldd->ld.interestRate = gtk_spin_button_get_value( ldd->prmIrateSpin );
- ldd->ld.type = gnc_option_menu_get_active( GTK_WIDGET(ldd->prmType) );
+ ldd->ld.type = gtk_combo_box_get_active( ldd->prmType );
if ( ldd->ld.type != FIXED ) {
gnc_frequency_save_state( ldd->prmVarGncFreq,
ldd->ld.loanFreq,
@@ -1212,7 +1198,7 @@
ldd = (LoanDruidData*)ud;
gnc_amount_edit_set_amount( ldd->prmOrigPrincGAE, ldd->ld.principal );
gtk_spin_button_set_value( ldd->prmIrateSpin, ldd->ld.interestRate );
- gtk_option_menu_set_history( ldd->prmType, ldd->ld.type );
+ gtk_combo_box_set_active( ldd->prmType, ldd->ld.type );
if ( ldd->ld.type != FIXED ) {
gnc_frequency_setup( ldd->prmVarGncFreq,
ldd->ld.loanFreq,
Modified: gnucash/branches/deprecated-cleanup/src/gnome/glade/sched-xact.glade
===================================================================
--- gnucash/branches/deprecated-cleanup/src/gnome/glade/sched-xact.glade 2006-06-19 01:43:41 UTC (rev 14388)
+++ gnucash/branches/deprecated-cleanup/src/gnome/glade/sched-xact.glade 2006-06-19 01:44:10 UTC (rev 14389)
@@ -5001,6 +5001,26 @@
<property name="y_options">expand|shrink|fill</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkComboBox" id="type_combobox">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Fixed Rate
+3/1 Year ARM
+5/1 Year ARM
+7/1 Year ARM
+10/1 Year ARM</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
More information about the gnucash-changes
mailing list