Top |
GdauiDataSelectorGdauiDataSelector — Selecting data in a GdaDataModel |
The GdauiDataSelector interface is implemented by widgets which allow the user to select some data from a GdaDataModel. Depending on the actual widget, the selection can be a single row or more than one row.
This interface allows one to set and get the GdaDataModel from which data is to be selected and offers a few other common behaviours.
Please note that any row number in this interface is in reference to the GdaDataModel returned by
the gdaui_data_selector_get_model()
method.
GdaDataModel *
gdaui_data_selector_get_model (GdauiDataSelector *iface
);
Queries the GdaDataModel from which the data displayed by the widget implementing iface
are. Beware that the returned data model may be different than the one used when the
widget was created in case it internally uses a GdaDataProxy.
Since: 4.2
void gdaui_data_selector_set_model (GdauiDataSelector *iface
,GdaDataModel *model
);
Sets the data model from which the data being displayed are. Also see gdaui_data_selector_get_model()
iface |
an object which implements the GdauiDataSelector interface |
|
model |
a GdaDataModel to use |
Since: 4.2
GArray *
gdaui_data_selector_get_selected_rows (GdauiDataSelector *iface
);
Gat an array of selected rows. If no row is selected, the the returned value is NULL
.
Please note that rows refers to the "visible" rows at the time it's being called, which may change if the widget implementing this interface uses a GdaDataProxy (as is the case for example for the GdauiRawForm, GdauiForm, GdauiRawGrid and GdauiGrid).
an array of gint values, one for each selected row. Use g_array_free()
when finished (passing TRUE
as the last argument).
[transfer full][element-type gint]
Since: 4.2
GdaDataModelIter *
gdaui_data_selector_get_data_set (GdauiDataSelector *iface
);
Get the GdaDataModelIter object represented the current selected row in iface
. This
function may return either NULL
or an invalid iterator (see gda_data_model_iter_is_valid()
) if
the selection cannot be represented by a single selected row.
Note that the returned GdaDataModelIter is actually an iterator iterating on the GdaDataModel
returned by the gdaui_data_selector_get_model()
method.
Since: 4.2
gboolean gdaui_data_selector_select_row (GdauiDataSelector *iface
,gint row
);
Force the selection of a specific row.
Please note that row
refers to the "visible" row
at the time it's being called, which may change if the widget implementing this interface
uses a GdaDataProxy (as is the case for example for the GdauiRawForm, GdauiForm, GdauiRawGrid
and GdauiGrid).
Since: 4.2
void gdaui_data_selector_unselect_row (GdauiDataSelector *iface
,gint row
);
Please note that row
refers to the "visible" row
at the time it's being called, which may change if the widget implementing this interface
uses a GdaDataProxy (as is the case for example for the GdauiRawForm, GdauiForm, GdauiRawGrid
and GdauiGrid).
Since: 4.2
void gdaui_data_selector_set_column_visible (GdauiDataSelector *iface
,gint column
,gboolean visible
);
Shows or hides the data at column column
iface |
an object which implements the GdauiDataSelector interface |
|
column |
a column number, starting at |
|
visible |
required visibility of the data in the |
Since: 4.2