![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Signals |
GdauiDataSelectorGdauiDataSelector — Selecting data in a GdaDataModel |
GdauiDataSelector; GdaDataModel * gdaui_data_selector_get_model (GdauiDataSelector *iface
); void gdaui_data_selector_set_model (GdauiDataSelector *iface
,GdaDataModel *model
); GArray * gdaui_data_selector_get_selected_rows (GdauiDataSelector *iface
); GdaDataModelIter * gdaui_data_selector_get_data_set (GdauiDataSelector *iface
); gboolean gdaui_data_selector_select_row (GdauiDataSelector *iface
,gint row
); void gdaui_data_selector_unselect_row (GdauiDataSelector *iface
,gint row
); void gdaui_data_selector_set_column_visible (GdauiDataSelector *iface
,gint column
,gboolean visible
);
GdauiDataSelector is implemented by GdauiCloud, GdauiCombo, GdauiForm, GdauiGrid, GdauiProviderSelector, GdauiRawForm and GdauiRawGrid.
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 uses a GdaDataProxy.
|
an object which implements the GdauiDataSelector interface |
Returns : |
the GdaDataModel. [transfer none] |
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()
|
an object which implements the GdauiDataSelector interface |
|
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 object which implements the GdauiDataSelector interface |
Returns : |
an array of gint values, one for each selected row. Use g_array_free() when finished (passing TRUE as the last argument). [transfer full]
|
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.
|
an object which implements the GdauiDataSelector interface |
Returns : |
a pointer to a GdaDataModelIter object, or NULL . [transfer none]
|
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).
|
an object which implements the GdauiDataSelector interface |
|
the row to select |
Returns : |
TRUE if the row has been selected |
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).
|
an object which implements the GdauiDataSelector interface |
|
the row to unselect |
Since 4.2
void gdaui_data_selector_set_column_visible (GdauiDataSelector *iface
,gint column
,gboolean visible
);
Shows or hides the data at column column
|
an object which implements the GdauiDataSelector interface |
|
a column number, starting at 0 , or -1 tp apply to all the columns |
|
required visibility of the data in the column column |
Since 4.2
"selection-changed"
signalvoid user_function (GdauiDataSelector *gdauidataselector,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |