libgnomedbmm Reference Documentation |
Inheritance diagram for Gnome::Db::Combo:
Public Member Functions | ||||
void | add_undef_choice (bool add_undef_choice=true) | |||
Tells if combo should add a special entry representing an "undefined choice". | ||||
Combo (const Glib::RefPtr<Gda::DataModel>& model) | ||||
Create a new Combo widget with a model. | ||||
Combo (const Glib::RefPtr<Gda::DataModel>& model, const Glib::ArrayHandle<int>& cols_index) | ||||
Create a new Combo widget with a model. | ||||
Combo () | ||||
Glib::RefPtr<const Gda::DataModel> | get_model () const | |||
This function returns the Gda::DataModel from which combo displays values. | ||||
Glib::RefPtr<Gda::DataModel> | get_model () | |||
This function returns the Gda::DataModel from which combo displays values. | ||||
Glib::SListHandle<Gda::Value> | get_values (const Glib::ArrayHandle<int>& cols_index) const | |||
Get a list of the currently selected values in particular columns. | ||||
Glib::SListHandle<Gda::Value> | get_values () const | |||
Get a list of the currently selected values in combo . | ||||
const GnomeDbCombo* | gobj () const | |||
Provides access to the underlying C GtkObject. | ||||
GnomeDbCombo* | gobj () | |||
Provides access to the underlying C GtkObject. | ||||
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gda::DataModel >> | property_model () const | |||
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | ||||
Glib::PropertyProxy< Glib::RefPtr< Gda::DataModel > > | property_model () | |||
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | ||||
void | set_model (const Glib::RefPtr<Gda::DataModel>& model) | |||
void | set_model (const Glib::RefPtr<Gda::DataModel>& model, const Glib::ArrayHandle<int>& cols_index) | |||
bool | set_values (const Glib::SListHandle<Gda::Value>& values, const Glib::ArrayHandle<int>& cols_index) | |||
Sets the currently selected row of combo from the values stored in values , assuming that these values correspond to the columns listed in cols_index . | ||||
bool | set_values (const Glib::SListHandle<Gda::Value>& values) | |||
Sets the currently selected row of combo from the values stored in values . | ||||
bool | undef_selected () const | |||
Tell if the currently selected entry represents the "undefined choice" entry. | ||||
void | unset_model () | |||
Make the combo empty and disassociate the previous model, if any. | ||||
virtual | ~Combo () | |||
Related Functions | ||||
(Note that these are not member functions.) | ||||
Gnome::Db::Combo* | wrap (GnomeDbCombo* object, bool take_copy=false) | |||
|
This widget acts like the Gtk::ComboBox widget which it inherits, but displays data from a provided Gda::DataModel and it is easy to set the currently selected row or retrieve values of the currently selected row.
Specifically, it is possible to show only some columns of the data model by providing an array of integers (containing the column number of each column to display).
virtual Gnome::Db::Combo::~Combo | ( | ) | [virtual] |
Gnome::Db::Combo::Combo | ( | ) |
Gnome::Db::Combo::Combo | ( | const Glib::RefPtr< Gda::DataModel > & | model, | |
const Glib::ArrayHandle< int > & | cols_index | |||
) |
Create a new Combo widget with a model.
See set_model() for more information.
model | A Gda::DataModel object. | |
cols_index | The indexes of the columns in the model to be shown. |
Gnome::Db::Combo::Combo | ( | const Glib::RefPtr< Gda::DataModel > & | model | ) | [explicit] |
Create a new Combo widget with a model.
See set_model() for more information.
model | A Gda::DataModel object. |
void Gnome::Db::Combo::add_undef_choice | ( | bool | add_undef_choice = true |
) |
Tells if combo should add a special entry representing an "undefined choice".
The default is that only the available choices in combo 's model are presented.
Glib::RefPtr<const Gda::DataModel> Gnome::Db::Combo::get_model | ( | ) | const |
This function returns the Gda::DataModel from which combo displays values.
Reimplemented from Gtk::ComboBox.
Glib::RefPtr<Gda::DataModel> Gnome::Db::Combo::get_model | ( | ) |
This function returns the Gda::DataModel from which combo displays values.
Reimplemented from Gtk::ComboBox.
Glib::SListHandle<Gda::Value> Gnome::Db::Combo::get_values | ( | const Glib::ArrayHandle< int > & | cols_index | ) | const |
Get a list of the currently selected values in particular columns.
cols_index | An array of indexes indicating which columns to get a value for. |
Glib::SListHandle<Gda::Value> Gnome::Db::Combo::get_values | ( | ) | const |
Get a list of the currently selected values in combo .
The list itself must be free'd using Glib::slist_free(), but not the values it contains.
WARNING: values will contain one value for each column set to be displayed when the data model was associated to combo .
0
if there is no displayed data in combo . const GnomeDbCombo* Gnome::Db::Combo::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::ComboBox.
Reimplemented in Gnome::Db::ProviderSelector.
GnomeDbCombo* Gnome::Db::Combo::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::ComboBox.
Reimplemented in Gnome::Db::ProviderSelector.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gda::DataModel> > Gnome::Db::Combo::property_model | ( | ) | const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Reimplemented from Gtk::ComboBox.
Glib::PropertyProxy< Glib::RefPtr<Gda::DataModel> > Gnome::Db::Combo::property_model | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Reimplemented from Gtk::ComboBox.
void Gnome::Db::Combo::set_model | ( | const Glib::RefPtr< Gda::DataModel > & | model | ) |
void Gnome::Db::Combo::set_model | ( | const Glib::RefPtr< Gda::DataModel > & | model, | |
const Glib::ArrayHandle< int > & | cols_index | |||
) |
bool Gnome::Db::Combo::set_values | ( | const Glib::SListHandle< Gda::Value > & | values, | |
const Glib::ArrayHandle< int > & | cols_index | |||
) |
Sets the currently selected row of combo from the values stored in values , assuming that these values correspond to the columns listed in cols_index .
cols_index must contain at least as many int
as there are elements in values ;
if cols_index is 0
, then it is assumed that values has the same number of columns than combo 's data model and that the values in values are ordered in the same way as the columns of combo 's data model.
values | A list of G::Value objects. | |
cols_index | Array of int , index of column to which each value in values corresponds, or 0 . |
true
if a row in the model was found to match the list of values. bool Gnome::Db::Combo::set_values | ( | const Glib::SListHandle< Gda::Value > & | values | ) |
Sets the currently selected row of combo from the values stored in values .
WARNING: values must contain one value for each column set to be displayed when the data model was associated to combo .
values | A list of G::Value. |
true
if a row in the model was found to match the list of values. bool Gnome::Db::Combo::undef_selected | ( | ) | const |
Tell if the currently selected entry represents the "undefined choice" entry.
void Gnome::Db::Combo::unset_model | ( | ) |
Make the combo empty and disassociate the previous model, if any.
Gnome::Db::Combo* wrap | ( | GnomeDbCombo * | object, | |
bool | take_copy = false | |||
) | [related] |
object | The C instance |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |