Name
GnomeDbCombo -- A data-bound combo box widget
Object Hierarchy
GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBox
+----GtkHBox
+----GtkCombo
+----GnomeDbCombo |
Description
The GnomeDbCombo widget is a normal combo box widget with the addition
of being data bound. That is, you can associate a GdaRecordset with it
and it will show all the rows in the recordset for the user to choose
one among the list.
This widget is specially useful for data entry screens.
Details
gnome_db_combo_new ()
GtkWidget* gnome_db_combo_new (GdaRecordset *recset,
gint pos); |
Creates a new GnomeDbCombo widget. You can optionally specify a GdaRecordset
object which will be used by the GnomeDbCombo widget
gnome_db_combo_get_editable ()
gboolean gnome_db_combo_get_editable (GnomeDbCombo *dbcombo); |
Gets the editing mode for the given GnomeDbCombo widget.
gnome_db_combo_set_editable ()
void gnome_db_combo_set_editable (GnomeDbCombo *dbcombo,
gboolean editable); |
Sets the editing mode for the given GnomeDbCombo widget. When the
editing mode is set to TRUE, it means that users can type on the combo
entry widget, thus making this widget useful for data entry screens where
you want users to be able to make modifications.
gnome_db_combo_refresh ()
Refreshes the data being displayed by the given GnomeDbCombo widget.
This means that the same query is executed on the connection associated
with this combo widget.
gnome_db_combo_get_row_count ()
Returns the number of rows being currently displayed by the given
GnomeDbCombo widget.
gnome_db_combo_get_string ()
Returns the current selection in the given GnomeDbCombo widget as
a string.
gnome_db_combo_get_recordset ()
GdaRecordset* gnome_db_combo_get_recordset (GnomeDbCombo *dbcombo); |
Gets the GdaRecordset being displayed by the given GnomeDbCombo widget
gnome_db_combo_set_recordset ()
void gnome_db_combo_set_recordset (GnomeDbCombo *dbcombo,
GdaRecordset *recset,
gint pos); |
Associates a GdaRecordset object with the given GnomeDbCombo widget. This
forces the combo widget to get the new set of rows from the database and
display them.
It's important to note that the GnomeDbCombo widget keeps a reference
to the GdaRecordset object, so it's safe if you call gda_recordset_free
on the same recordset you used in the call to this function. Note however
that if you close the recordset (by calling gda_recordset_close), this
will indeed affect the combo widget if it's keeping a reference to that
recordset.
gnome_db_combo_sync ()
Synchronizes the underlying GdaRecordset object associated with the
given GnomeDbCombo widget so that its current row is set to the row
selected in the GnomeDbCombo widget.
This is specially useful for data entry screens, where you can have a list
of all primary keys in a GnomeDbCombo widget, and, when the user selects
an entry in the combo pop-down list, other data entry widgets (such as
GnomeDbTable, for instance) update themselves with the contents of the
new selected row.