## GnomeDbGrid

GnomeDbGrid — Database grid widget

##

# Synopsis

    void        (*GnomeDbGridForeachFunc)       (GnomeDbGrid *grid,
                                                 gint row,
                                                 gpointer user_data);
    struct      GnomeDbGrid;
    GType       gnome_db_grid_get_type          (void);
    GtkWidget*  gnome_db_grid_new               (void);
    GtkWidget*  gnome_db_grid_new_with_select_query
                                                (GnomeDbQuery *query,
                                                 GnomeDbTarget *modified);
    GtkWidget*  gnome_db_grid_new_with_gda_model
                                                (GnomeDbDict *dict,
                                                 GdaDataModel *model);
    void        gnome_db_grid_set_sample_size   (GnomeDbGrid *grid,
                                                 gint sample_size);
    void        gnome_db_grid_set_sample_start  (GnomeDbGrid *grid,
                                                 gint sample_start);
    void        gnome_db_grid_get_selection_mode
                                                (GnomeDbGrid *grid,
                                                 GtkSelectionMode mode);
    GList*      gnome_db_grid_get_selection     (GnomeDbGrid *grid);
    void        gnome_db_grid_select_all        (GnomeDbGrid *grid);
    void        gnome_db_grid_unselect_all      (GnomeDbGrid *grid);
    void        gnome_db_grid_foreach_selected  (GnomeDbGrid *grid,
                                                 GnomeDbGridForeachFunc foreach_func,
                                                 gpointer user_data);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----GtkVBox
                                     +----GnomeDbGrid

## Implemented Interfaces

GnomeDbGrid implements AtkImplementorIface and GnomeDbDataWidget.

## Properties

      "actions-visible"      gboolean             : Write
      "info-cell-visible"    gboolean             : Write
      "title-string"         gchararray           : Write
      "title-visible"        gboolean             : Write

## Signal Prototypes

    "double-clicked"
                void        user_function      (GnomeDbGrid *dbgrid,
                                                gint arg1,
                                                gpointer user_data);
    "populate-popup"
                void        user_function      (GnomeDbGrid *dbgrid,
                                                gpointer arg1,
                                                gpointer user_data);
    "selection-changed"
                void        user_function      (GnomeDbGrid *dbgrid,
                                                gboolean arg1,
                                                gpointer user_data);

## Description

## Details

### GnomeDbGridForeachFunc ()

    void        (*GnomeDbGridForeachFunc)       (GnomeDbGrid *grid,
                                                 gint row,
                                                 gpointer user_data);

`grid` : |
`row` : |
`user_data` : |

### struct GnomeDbGrid

    struct GnomeDbGrid;

### gnome_db_grid_get_type ()

    GType       gnome_db_grid_get_type          (void);

Returns : |

### gnome_db_grid_new ()

    GtkWidget*  gnome_db_grid_new               (void);

Creates a new GnomeDbGrid widget

Returns : | the new widget

### gnome_db_grid_new_with_select_query ()

    GtkWidget*  gnome_db_grid_new_with_select_query
                                                (GnomeDbQuery *query,
                                                 GnomeDbTarget *modified);

Creates a new GnomeDbGrid widget.

`query` must be a SELECT query (no union, etc selection query)

The `modified` target must belong to `query` and represent modifiable entity (a GnomeDbTable for example). If `modified` is `NULL` then no modification will be allowed.

`query` : | a GnomeDbQuery object
`modified` : | a GnomeDbTarget object, or `NULL`
Returns : | the new widget

### gnome_db_grid_new_with_gda_model ()

    GtkWidget*  gnome_db_grid_new_with_gda_model
                                                (GnomeDbDict *dict,
                                                 GdaDataModel *model);

Creates a new GnomeDbGrid widget suitable to display the data in `model`

`dict` : | a GnomeDbDict dictionary, or `NULL`
`model` : | a GdaDataModel
Returns : | the new widget

### gnome_db_grid_set_sample_size ()

    void        gnome_db_grid_set_sample_size   (GnomeDbGrid *grid,
                                                 gint sample_size);

`grid` : |
`sample_size` : |

### gnome_db_grid_set_sample_start ()

    void        gnome_db_grid_set_sample_start  (GnomeDbGrid *grid,
                                                 gint sample_start);

`grid` : |
`sample_start` : |

### gnome_db_grid_get_selection_mode ()

    void        gnome_db_grid_get_selection_mode
                                                (GnomeDbGrid *grid,
                                                 GtkSelectionMode mode);

`grid` : |
`mode` : |

### gnome_db_grid_get_selection ()

    GList*      gnome_db_grid_get_selection     (GnomeDbGrid *grid);

Returns the list of the currently selected rows in a GnomeDbGrid widget. The returned value is a list of integers, which represent each of the selected rows.

If new rows have been inserted, then those new rows will have a row number equal to -1.

`grid` : | a GnomeDbGrid widget
Returns : | a new list, should be freed (by calling g_list_free) when no longer needed.

### gnome_db_grid_select_all ()

    void        gnome_db_grid_select_all        (GnomeDbGrid *grid);

`grid` : |

### gnome_db_grid_unselect_all ()

    void        gnome_db_grid_unselect_all      (GnomeDbGrid *grid);

`grid` : |

### gnome_db_grid_foreach_selected ()

    void        gnome_db_grid_foreach_selected  (GnomeDbGrid *grid,
                                                 GnomeDbGridForeachFunc foreach_func,
                                                 gpointer user_data);

`grid` : |
`foreach_func` : |
`user_data` : |

## Properties

"`actions-visible`" (gboolean : Write) |
"`info-cell-visible`" (gboolean : Write) |
"`title-string`" (gchararray : Write) |
"`title-visible`" (gboolean : Write) |

## Signals

### The "double-clicked" signal

    void        user_function                  (GnomeDbGrid *dbgrid,
                                                gint arg1,
                                                gpointer user_data);

`dbgrid` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.

### The "populate-popup" signal

    void        user_function                  (GnomeDbGrid *dbgrid,
                                                gpointer arg1,
                                                gpointer user_data);

`dbgrid` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.

### The "selection-changed" signal

    void        user_function                  (GnomeDbGrid *dbgrid,
                                                gboolean arg1,
                                                gpointer user_data);

`dbgrid` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.