UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
ZmDbTableTool Class Reference

#include <ZmDbTableTool.H>

Inheritance diagram for ZmDbTableTool:
ZmTableTool ZmSelection

Public Member Functions

 ZmDbTableTool (Widget wParent, dbHandle dbh)
 
virtual ~ZmDbTableTool ()
 
virtual void write_cell (int iRow, int iColumn, const char *s)
 
virtual int get_rows_count ()
 
virtual char * draw_cell (int iRow, int iColumn)
 
virtual void delete_rows (int iRow, int nRows)
 
virtual void insert_rows (int iRow, int nRows)
 
virtual void add_row ()
 
virtual char * get_column_label (int iColumn)
 
virtual int get_column_width (int iColumn)
 
virtual int get_column_length (int iColumn)
 
virtual Logic start_modifying_cell (int iRow, int iColumn, const char *szText)
 
virtual Logic verify_cell (int iRow, int iColumn, const char *szText)
 
- Public Member Functions inherited from ZmTableTool
 ZmTableTool (Widget wParent, int nColumns, const char *szResName=ZmTT_DEFAULT_RES_NAME)
 
virtual ~ZmTableTool ()
 
 operator Widget () const
 
virtual void set_visible_rows_number (int nVisRows)
 
virtual void limit_size ()
 
virtual void refresh ()
 
virtual void commit_changes ()
 
void fix_left_column (Logic flag)
 
Logic is_left_column_fixed () const
 
void fix_rows_number (Logic flag)
 
Logic is_rows_number_fixed () const
 
void set_current_pos (int iRow, int iColumn)
 
void get_current_pos (int &iRow, int &iColumn) const
 
ValueDiagnose verify_string (AtomType atype, int dim, const char *s)
 
ValueDiagnose verify_int (AtomType atype, const char *s)
 
ValueDiagnose verify_real (AtomType atype, const char *s)
 
void scan_string (AtomType atype, const char *s, void *v)
 
void scan_string (AtomType atype, int dim, const char *s, void *v)
 
virtual char * get_row_label (int iRow)
 
virtual int get_row_labels_width ()
 
virtual void popup_menu (int iRow, int iColumn)
 
void select_all_rows ()
 
void unselect_rows ()
 
void select_row (int iRow)
 
void select_till_row (int iRow)
 
void get_selected_rows (IntAr &sRows) const
 
void select_all_columns ()
 
void unselect_columns ()
 
void select_column (int iColumn, bool bForce=false)
 
void get_selected_columns (IntAr &sCols) const
 
virtual void highlight_data (bool flag)
 
void copy_to_clipboard (Time timestamp)
 
void paste_from_clipboard (Time timestamp)
 
- Public Member Functions inherited from ZmSelection
 ZmSelection (Widget w, Atom name=XA_PRIMARY)
 
virtual ~ZmSelection ()
 
virtual bool publish_data (const char *text, Time timestamp)
 
virtual void unpublish_data (Time timestamp)
 
virtual bool request_data (char *&text, Time timestamp)
 

Protected Attributes

dbHandle dbhWork
 
GrowingBuffer gb
 
- Protected Attributes inherited from ZmTableTool
Widget wMatrix
 
Widget wPopup
 
Widget wPopupItem [16]
 
int rows_cnt
 
int columns_cnt
 
int popup_row
 
int popup_column
 
Logic bFixedRowsNumber
 
GrowingBuffer gb
 
GrowingBuffer gbClipboard
 
int last_sel_row
 
IntAr selRows
 
IntAr selCols
 
IntAr pubRows
 
IntAr pubCols
 
- Protected Attributes inherited from ZmSelection
struct {
   Atom   type
 
   XtPointer   data
 
   unsigned long   size
 
   int   format
 
im_buf
 
struct {
   Atom   type
 
   XtPointer   data
 
   unsigned long   size
 
   int   format
 
ex_buf
 
bool bPaste
 
Atom aName
 
Atom aData
 
Widget wToplevel
 

Additional Inherited Members

- Public Types inherited from ZmTableTool
enum  ValueDiagnose {
  vdOK, vdBadNumber, vdBadDomain, vdBadRange,
  vdBadDbName, vdTooLong, vdTooShort, vdSkip,
  vdEmpty
}
 
- Protected Types inherited from ZmTableTool
enum  DataDirection { Cell, Rows, Columns }
 
- Protected Member Functions inherited from ZmTableTool
Logic event_to_pos (XEvent *xev, int &iRow, int &iColumn)
 
void set_row_labels ()
 
void set_column_labels ()
 
void set_column_widths ()
 
void set_column_lengths ()
 
void normalize_pos (int &iRow, int &iColumn)
 
Logic dialog_number_of_rows (int &nRows)
 
- Static Protected Member Functions inherited from ZmTableTool
static void PostItCB (Widget w, XtPointer pUserData, XEvent *event, Boolean *rc)
 
static void DrawWriteCellCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void InsertRowCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void InsertRowsCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void DeleteRowsCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void DuplicateRowsCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void SelectRowCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void SelectRowsHereCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void SelectAllRowsCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void UnselectAllRowsCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void EnterCellCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void ModifyCellCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void VerifyCellCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void TrackVisibleCellCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void LabelCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void ClipbCutCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void ClipbCopyCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 
static void ClipbPasteCB (Widget w, XtPointer pUserData, XtPointer pCallData)
 

Detailed Description

Table tool for data base handle. It's supposed, that data base table will be changed only by user via GUI provided by this object. If data base is changed externally, special operation should be used for informing the object about changes.

Constructor & Destructor Documentation

ZmDbTableTool::ZmDbTableTool ( Widget  wParent,
dbHandle  dbh 
)

Common constructor.

virtual ZmDbTableTool::~ZmDbTableTool ( )
virtual

Destructor.

Member Function Documentation

virtual void ZmDbTableTool::add_row ( )
virtual

Callback to add one row at the end of table.

Reimplemented from ZmTableTool.

virtual void ZmDbTableTool::delete_rows ( int  iRow,
int  nRows 
)
virtual

Callback to delete rows iRow..iRow+nRows-1.

Reimplemented from ZmTableTool.

virtual char* ZmDbTableTool::draw_cell ( int  iRow,
int  iColumn 
)
virtual

Draw data from internal data structures to screen

Reimplemented from ZmTableTool.

virtual char* ZmDbTableTool::get_column_label ( int  iColumn)
virtual

Draw column title from data structures to screen. Default method: draw index of column + 1

Reimplemented from ZmTableTool.

virtual int ZmDbTableTool::get_column_length ( int  iColumn)
virtual

Get column length (characters to enter).

Reimplemented from ZmTableTool.

virtual int ZmDbTableTool::get_column_width ( int  iColumn)
virtual

Get column width (visible column).

Reimplemented from ZmTableTool.

virtual int ZmDbTableTool::get_rows_count ( )
virtual

Get count of rows in internal data table.

Reimplemented from ZmTableTool.

virtual void ZmDbTableTool::insert_rows ( int  iRow,
int  nRows 
)
virtual

Callback to insert nRows on iRow position.

Reimplemented from ZmTableTool.

virtual Logic ZmDbTableTool::start_modifying_cell ( int  iRow,
int  iColumn,
const char *  szText 
)
virtual

Start to modify cell value. Return TRUE to allow and FALSE to reject changes.

Reimplemented from ZmTableTool.

virtual Logic ZmDbTableTool::verify_cell ( int  iRow,
int  iColumn,
const char *  szText 
)
virtual

Verify string before pass it in write_cell() callback. Return TRUE to allow write_cell() and FALSE to reject changes.

Reimplemented from ZmTableTool.

virtual void ZmDbTableTool::write_cell ( int  iRow,
int  iColumn,
const char *  s 
)
virtual

Write data from screen to internal data structures. Do not check validity of entered data. Al least, this callback must not diagnose errors because of it is used in DuplicateRowsCB.

Reimplemented from ZmTableTool.

Member Data Documentation

dbHandle ZmDbTableTool::dbhWork
protected

Data base table to edit.

GrowingBuffer ZmDbTableTool::gb
protected

Growing buffer for many different cases.


The documentation for this class was generated from the following file: