****************************************************************************** * Function: dbutil_gtk_table_sync_with_gui * Purpose: Syncronize the data displayed in the UI widget into the dbtable * Purpose: structure. This function should be called just prior to running * Purpose: one of the dbrelationset_* functions which generate the SQL. * Purpose: This ONLY syncs one dbtable... which works when calling * Purpose: dbutil_relationset_select() with the 'userelations' argument * Purpose: set to FALSE(0). * Purpose: * Arguments: dbtable_t *dbtable - The dbtable to sync with the UI widgets. * ReturnType: void ****************************************************************************** void dbutil_gtk_table_sync_with_gui(dbtable_t *dbtable); ****************************************************************************** * Function: dbutil_gtk_field_clear * Purpose: Clear the UI widget and the dbfield data for the specified * Purpose: field. 'Clear' means clear the value of the widget. * Purpose: * Purpose: * Arguments: dbfield_t *dbfield - The dbfield which should be cleared. * ReturnType: void ****************************************************************************** void dbutil_gtk_field_clear(dbfield_t *dbfield); ****************************************************************************** * Function: dbutil_gtk_field_fill * Purpose: Fill the UI widget's value with the provided string, this also * Purpose: sets the data in the dbfield structure. * Purpose: * Purpose: * Arguments: dbfield_t *dbfield - The dbfield which should be filled. * gchar *data - The string/data to set in the UI and dbfield. * ReturnType: void ****************************************************************************** void dbutil_gtk_field_fill(dbfield_t *dbfield, gchar *data); ****************************************************************************** * Function: dbutil_gtk_table_clear_fields * Purpose: Clears the data from ALL UI widgets and dbfields that belong * Purpose: to this dbtable structure. * Purpose: * Purpose: * Arguments: dbtable_t *dbtable - The dbtable which will have all it's * Arguments: fields(UI widgets and dbfields) cleared. * ReturnType: void ****************************************************************************** void dbutil_gtk_table_clear_fields(dbtable_t *dbtable); ****************************************************************************** * Function: dbutil_gtk_table_fill_fields * Purpose: Fills the data for ALL UI widgets ansd dbfields which belong to * Purpose: the specified dbtable. 'data' is an array of strings which must * Purpose: hold the data for the fields to be filled, in the order that * Purpose: the dbfields appear in the dbtable structure. * Purpose: * Purpose: * Arguments: dbtable_t *dbtable - The dbtable which will have all it's * Arguments: fields(UI widgets and dbfields) filled. * gchar **data - An array of strings to fill the fields with. * ReturnType: void ****************************************************************************** void dbutil_gtk_table_fill_fields(dbtable_t *dbtable, gchar **data); ****************************************************************************** * Function: dbutil_gtk_table_set_fields_sensitive * Purpose: Set ALL the UI widgets' sensitivity to 'sensitive' that belong * Purpose: to the specified dbtable. DBF_PRIMARYKEY fields are not * Purpose: affected by a call to this function. Use this function to * Purpose: display a table record while controlling the user's ability to * Purpose: modify the data. * Arguments: dbtable_t *dbtable - The dbtable who's field's sensitivity * Arguments: are to be set. * gboolean sensitive - Make fields sensitive or not(TRUE/FALSE). * ReturnType: void ****************************************************************************** void dbutil_gtk_table_set_fields_sensitive(dbtable_t *dbtable, gboolean sensitive); ****************************************************************************** * Function: dbutil_gtk_relationset_sync_with_gui * Purpose: Syncronize the data from the UI widgets into the dbtable * Purpose: structures of the given dbrelationset. This function will sync * Purpose: ALL the tables in the dbrelationset's tableset. This function * Purpose: should be called prior to calling one of the * Purpose: dbutil_relationset_* functions which generate SQL statements. * Purpose: This function should be used prior to calling * Purpose: dbutil_relationset_select() with the 'userelations' argument * Purpose: set to TRUE(1). * Arguments: dbrelationset_t *dbrelationset - The dbrelationset to sync from * Arguments the UI widgets. * ReturnType: void ****************************************************************************** void dbutil_gtk_relationset_sync_with_gui(dbrelationset_t *dbrelationset); ****************************************************************************** * Function: dbutil_gtk_relationset_multirow_start * Purpose: Allocate a structure to begin a multirow SQL statement against * Purpose: a GtkSheet(Gtk+Extra) widget. The returned structure can be used * Purpose: in further calls to the dbutil_gtk_relationset_multirow_next() * Purpose: function to create and SQL statement for each row in the * Purpose: GtkSheet widget. The returned structure's sqlstr member contains * Purpose: the newly allocated SQL statement. * Purpose: * Arguments: dbrelationset_t *relationset - The relationset to use for the * Arguments: multirow SQL statements. * gchar *primarytable - The primary table to be used. Must exist in * in the relationset's tableset. * gint statementtype - One of SQLH_INSERT/SQLH_UPDATE or * SQLH_DELETE. SQLH_SELECT is invalid. * ReturnType: sqlhandle_t * * Returns: On success, returns a newly allocated sqlhandle_t structure. * Returns: On error, returns NULL. ****************************************************************************** sqlhandle_t * dbutil_gtk_relationset_multirow_start(dbrelationset_t *relationset, gchar *primarytable, gint statementtype); ****************************************************************************** * Function: dbutil_gtk_relationset_multirow_next * Purpose: For the given sqlhanle_t pointer, returns the SQL statement for * Purpose: the next row in the GtkSheet widget. The newly allocated SQL * Purpose: statement is returned in the argument's sqlstr member. * Purpose: * Arguments: sqlhandle_t *handle - The sqlhandle_t* used to get the next row * Arguments: of data from. * ReturnType: gint * Returns: On success, returns 0 with the new SQL statement returned in * Returns: the argument's sqlstr member. * Returns: On error, returns -2 if no more rows are available, * Returns: -3 if the next row contained no data or * Returns: -4 if the SQL statement memory allocation failed. ****************************************************************************** gint dbutil_gtk_relationset_multirow_next(sqlhandle_t *handle); ****************************************************************************** * Function: dbutil_gtk_relationset_multirow_free * Purpose: Frees the memory associated with the given sqlhandle_t. This * Purpose: function should be called after all rows have been retrieved * Purpose: from the GtkSheet widget by the * Purpose: dbutil_gtk_relationset_multirow_next() function. * Purpose: * Arguments: sqlhandle_t *handle - The pointer of the structure to free. * ReturnType: void ****************************************************************************** void dbutil_gtk_relationset_multirow_free(sqlhandle_t *handle); ****************************************************************************** * Function: gtk_option_menu_get_active * Purpose: For a given GtkOptionMenu widget, return the currently active * Purpose: menu item's 0-referenced offset. This function should be used * Purpose: to retrieve the value to be stored in a database field of * Purpose: integer type. * Arguments: GtkOptionMenu *option_menu - The GtkOptionMenu widget. * ReturnType: gint * Returns: On success, returns the offset of the current active menu item. * Returns: On error, ****************************************************************************** gint gtk_option_menu_get_active(GtkOptionMenu *option_menu); ****************************************************************************** * Function: gtk_option_menu_set_active * Purpose: For a given GtkOptionMenu widget, set the active menu item to * Purpose: the 0-referenced item secified by the 'index'argument. This * Purpose: function should be used to set the value from a database field * Purpose: of type integer. * Arguments: GtkOptionMenu *option_menu - The GtkOptionMenu widget. * gint index - The index of the menu item to set active. * ReturnType: gint * Returns: On success, returns 0. * Returns: On error, returns -1. ****************************************************************************** gint gtk_option_menu_set_active(GtkOptionMenu *option_menu, gint index); ****************************************************************************** * Function: gtk_option_menu_get_active_text * Purpose: For a given GtkOptionMenu widget, return the currently active * Purpose: menu item's text value. This function should be used to * Purpose: retrieve the value to be stored in a database field of type * Purpose: char or varchar. * Purpose: * Arguments: GtkOptionMenu *option_menu - The GtkOptionMenu widget. * ReturnType: gchar * * Returns: On success, returns a pointer to the widgets text value.(Static) * Returns: On error, returns NULL. ****************************************************************************** gchar * gtk_option_menu_get_active_text(GtkOptionMenu *option_menu);