Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

tables.c File Reference

Functions to handle the table information pane. More...

#include <string.h>
#include "callbacks.h"
#include "dialogs.h"
#include "drag.h"
#include "guiapi.h"
#include "menus.h"
#include "queries.h"
#include "tables.h"

Include dependency graph for tables.c:

Include dependency graph

Go to the source code of this file.

Functions

GtkWidget * tables_create_popup (void)
 Creates the popup menu for the table notebook.

gboolean on_info_clist_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
 'click' event for table pane.

int display_table_named (char *tablename)
 Selects the table with the specified name.

GtkCList * get_current_table (void)
 Return the currently visible table pane.

char * get_current_table_name (void)
char * get_selected_table_fields (void)
GtkCList * get_table_no (int n)
 Returns the n'th table.

GtkWidget * init_tables_pane (void)
 Initialises the table pane.

void tables_connection_closed (void)
 Removes all tables from the table notebook.

void tables_new_connection (void)
 Initialises table display for a new connection.

void on_delete_query_activate (GtkMenuItem *menuitem, gpointer user_data)
 'Delete Query' action function.

void on_insert_query_activate (GtkMenuItem *menuitem, gpointer user_data)
 'Insert Query' action function.

void on_select_query_activate (GtkMenuItem *menuitem, gpointer user_data)
 'select query' action function.

void on_update_query_activate (GtkMenuItem *menuitem, gpointer user_data)
 'update query' action function.


Variables

GtkWidget * tableNotebook
 The table notebook.

GtkWidget * tablePopupDeleteQueryItem
 Generate a DELETE query.

GtkWidget * tablePopupInsertQueryItem
 Generate a INSERT query.

GtkWidget * tablePopupRefreshItem
 Refresh the table listing.

GtkWidget * tablePopupSelectQueryItem
 Generate a SELECT query.

GtkWidget * tablePopupUpdateQueryItem
 Generate a UPDATE query.

SubMenu tablePopupTemplate []
 Template for table popup menu.


Detailed Description

Functions to handle the table information pane.

Author:
Lionel ULMER , Darryl Luff

Definition in file tables.c.


Function Documentation

int display_table_named char *    tablename
 

Selects the table with the specified name.

The named table is located in the table pane and displayed.

Definition at line 76 of file tables.c.

References tableNotebook.

GtkCList* get_current_table void   
 

Return the currently visible table pane.

The returned item is the GtkCList containing the table fields.

Definition at line 99 of file tables.c.

References get_table_no(), and tableNotebook.

Referenced by get_selected_table_fields().

char* get_current_table_name void   
 

Returns:
The name of the currently visible table pane.

Definition at line 108 of file tables.c.

References tableNotebook.

Referenced by on_delete_query_activate(), on_insert_query_activate(), on_select_query_activate(), and on_update_query_activate().

char* get_selected_table_fields void   
 

Returns:
A list of the selected table fields. The list is returned as a comma-separated text string. If no fields are selected, returns "*".

Definition at line 128 of file tables.c.

References get_current_table().

Referenced by on_insert_query_activate(), and on_select_query_activate().

GtkCList* get_table_no int    n
 

Returns the n'th table.

Parameters:
n  The table to return.
Returns:
A pointer to the clist that the table info is contained in.

Definition at line 165 of file tables.c.

References tableNotebook.

Referenced by get_current_table().

GtkWidget* init_tables_pane void   
 

Initialises the table pane.

Returns:
The container widget to insert into the notebook.

Definition at line 192 of file tables.c.

References tableNotebook.

Referenced by init_top_hpane().

void on_delete_query_activate GtkMenuItem *    menuitem,
gpointer    user_data
 

'Delete Query' action function.

Called from the toolbar and menus.

Definition at line 311 of file tables.c.

References get_current_table_name(), and query_get_current().

gboolean on_info_clist_button_press_event GtkWidget *    widget,
GdkEventButton *    event,
gpointer    user_data
 

'click' event for table pane.

Pops up the popup menu on button 3 being pressed.

Definition at line 334 of file tables.c.

References tables_create_popup().

void on_insert_query_activate GtkMenuItem *    menuitem,
gpointer    user_data
 

'Insert Query' action function.

Called by menu and toolbar actions.

Definition at line 356 of file tables.c.

References get_current_table_name(), get_selected_table_fields(), and query_get_current().

void on_select_query_activate GtkMenuItem *    menuitem,
gpointer    user_data
 

'select query' action function.

Generates a default 'select' query from the currently selected table fields.

Definition at line 389 of file tables.c.

References get_current_table_name(), get_selected_table_fields(), and query_get_current().

void on_update_query_activate GtkMenuItem *    menuitem,
gpointer    user_data
 

'update query' action function.

Generates a default 'update' query from the currently selected table fields.

Definition at line 419 of file tables.c.

References get_current_table_name(), and query_get_current().

void tables_connection_closed void   
 

Removes all tables from the table notebook.

This is called when a database connection is closed.

Definition at line 210 of file tables.c.

References db_conn::DBfree_table_def, gui_get_connection(), and tableNotebook.

Referenced by gui_disconnect(), and on_tableRefresh_activate().

GtkWidget * tables_create_popup void   
 

Creates the popup menu for the table notebook.

The popup menu is stored in the tablePopup global variable.

Definition at line 253 of file tables.c.

References create_menu().

Referenced by on_info_clist_button_press_event().

void tables_new_connection void   
 

Initialises table display for a new connection.

The list of tables is recalled and field displays created.

Definition at line 224 of file tables.c.

References create_standard_dialog(), db_conn::DBget_table, db_conn::DBget_table_def, db_conn::DBget_table_num, gui_get_connection(), DBTableDef::name, and tableNotebook.

Referenced by gui_set_connection(), and on_tableRefresh_activate().


Variable Documentation

SubMenu tablePopupTemplate[]
 

Initial value:

 {
    {"<- SELECT Query", on_select_query_activate, NULL, &tablePopupSelectQueryItem, NORM_BUTTON},
    {"<- INSERT Query", on_insert_query_activate, NULL, &tablePopupInsertQueryItem, NORM_BUTTON},
    {"<- UPDATE Query", on_update_query_activate, NULL, &tablePopupUpdateQueryItem, NORM_BUTTON},
    {"<- DELETE Query", on_delete_query_activate, NULL, &tablePopupDeleteQueryItem, NORM_BUTTON},
    {"", NULL, NULL, NULL, NORM_BUTTON},
    {"Refresh", on_tableRefresh_activate, NULL, &tablePopupRefreshItem, NORM_BUTTON},
    {NULL, NULL, NULL, NULL, NORM_BUTTON}
}
Template for table popup menu.

Definition at line 47 of file tables.c.


Generated on Sun May 9 19:19:26 2004 for GtkSQL by doxygen1.2.18