UNIVERS
15.3
UNIVERS base processing software API
|
#include <ZmTableTool.H>
Public Types | |
enum | ValueDiagnose { vdOK, vdBadNumber, vdBadDomain, vdBadRange, vdBadDbName, vdTooLong, vdTooShort, vdSkip, vdEmpty } |
Public Member Functions | |
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 void | write_cell (int iRow, int iColumn, const char *s) |
virtual void | delete_rows (int iRow, int nRows) |
virtual void | insert_rows (int iRow, int nRows) |
virtual void | add_row () |
virtual int | get_rows_count () |
virtual char * | draw_cell (int iRow, int iColumn) |
virtual char * | get_column_label (int iColumn) |
virtual char * | get_row_label (int iRow) |
virtual int | get_column_width (int iColumn) |
virtual int | get_column_length (int iColumn) |
virtual int | get_row_labels_width () |
virtual Logic | start_modifying_cell (int iRow, int iColumn, const char *szText) |
virtual Logic | verify_cell (int iRow, int iColumn, const char *szText) |
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 Types | |
enum | DataDirection { Cell, Rows, Columns } |
Protected Member Functions | |
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 | |
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) |
Protected Attributes | |
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 |
Base class for building arbitrary table editors with fixed number of columns. ATTENSION! Row and column indeces are counted from 0!
|
protected |
Selected and published data direction.
Kind of
ZmTableTool::ZmTableTool | ( | Widget | wParent, |
int | nColumns, | ||
const char * | szResName = ZmTT_DEFAULT_RES_NAME |
||
) |
Common constructor
|
virtual |
Destructor
|
virtual |
Callback to add one row at the end of table.
Reimplemented in ZmDbTableTool.
|
staticprotected |
Copy selected rows/columns into the clipboard buffer.
|
staticprotected |
Cut selected rows/columns into the clipboard buffer. In case of fixed number of rows performs 'Copy' into clipboard.
|
staticprotected |
Paste rows/columns into the table. Columns replace contents at the current cursor. Rows are inserted at the current cursor position in case of editable table and replace contents at the current cursor position in case of fixed number of rows.
|
virtual |
Called to synchronize with other objects which share the same internal data representation. At this moment internal data already has been changed.
void ZmTableTool::copy_to_clipboard | ( | Time | timestamp | ) |
Publish current selection to clipboard.
|
virtual |
Callback to delete rows iRow..iRow+nRows-1.
Reimplemented in ZmDbTableTool.
|
staticprotected |
Callback to delete current row/selected rows.
|
protected |
Enter number of rows. TRUE - OK; FALSE - Cancel.
|
virtual |
Draw data from internal data structures to screen
Reimplemented in ZmDbTableTool.
|
staticprotected |
Support draw/write cell data events.
|
staticprotected |
Callback to duplicate rows.
|
staticprotected |
Callback to enter into the cell.
|
protected |
Address cell by XEvent
void ZmTableTool::fix_left_column | ( | Logic | flag | ) |
Fix left column.
void ZmTableTool::fix_rows_number | ( | Logic | flag | ) |
Fix number of rows.
|
virtual |
Draw column title from data structures to screen. Default method: draw index of column + 1
Reimplemented in ZmDbTableTool.
|
virtual |
Get column length (characters to enter).
Reimplemented in ZmDbTableTool.
|
virtual |
Get column width (visible column).
Reimplemented in ZmDbTableTool.
|
virtual |
Callback to draw row title from data structures to screen. Default method: draw index of row + 1
|
virtual |
Get row labels width.
|
virtual |
Get count of rows in internal data table.
Reimplemented in ZmDbTableTool.
void ZmTableTool::get_selected_columns | ( | IntAr & | sCols | ) | const |
Obtain list of selected columns or 0 items in case of no rows were selected or columns are selected now.
void ZmTableTool::get_selected_rows | ( | IntAr & | sRows | ) | const |
Obtain list of selected rows or 0 items in case of no rows were selected or columns are selected now.
|
virtual |
Method for visual highlighting of selected data. True means an request to highlight, false means to reset highlighting. An application may ignore this order.
Reimplemented from ZmSelection.
|
virtual |
Callback to insert nRows on iRow position.
Reimplemented in ZmDbTableTool.
|
staticprotected |
Callback to insert row(s).
|
staticprotected |
Called when label is pressed.
|
virtual |
Limit size of widget to be less than Screen
|
staticprotected |
Callback to start modify the cell.
|
protected |
Normalize position.
ZmTableTool::operator Widget | ( | ) | const |
Return widget of this object.
void ZmTableTool::paste_from_clipboard | ( | Time | timestamp | ) |
Extract data from clipboard.
|
virtual |
Call this code before manage popup menu.
|
staticprotected |
Callback to process Popup event.
|
virtual |
Refresh changes that took place. Involves titles and labels, widths, count of rows, values, fixed columns. At the end of refresh new geometry request is performed.
void ZmTableTool::scan_string | ( | AtomType | atype, |
const char * | s, | ||
void * | v | ||
) |
Universal scalar data type scanner. Does not check validity. s -> (convert) -> v
void ZmTableTool::scan_string | ( | AtomType | atype, |
int | dim, | ||
const char * | s, | ||
void * | v | ||
) |
Universal data type scanner. Does not check validity. s -> (convert) -> v
void ZmTableTool::select_all_columns | ( | ) |
Select all columns (unselect rows if any).
void ZmTableTool::select_all_rows | ( | ) |
Select all rows (unselect columns if any).
void ZmTableTool::select_column | ( | int | iColumn, |
bool | bForce = false |
||
) |
Select/unselect given column (unselect rows if any). If someone wants to force selection to mark the column after rows inserting he should bForce=true.
void ZmTableTool::select_row | ( | int | iRow | ) |
Select/unselect given row (unselect columns if any).
void ZmTableTool::select_till_row | ( | int | iRow | ) |
Select several rows from the last selected (if defined) until pointed.
|
staticprotected |
Callback to select all rows.
|
staticprotected |
Callback to select/unselect row; mark start of selection.
|
staticprotected |
Callback to select all rows from last SelectRowCB till here.
|
protected |
Set column labels.
|
protected |
Set column lengths.
|
protected |
Set column widths.
void ZmTableTool::set_current_pos | ( | int | iRow, |
int | iColumn | ||
) |
Current edited cell.
|
protected |
Set per row labels and their width.
|
virtual |
Set number of visible rows and adjust widget size accordingly.
|
virtual |
Start to modify cell value. Return TRUE to allow and FALSE to reject changes.
Reimplemented in ZmDbTableTool.
|
staticprotected |
Callback responsible for visibility of the current cell.
void ZmTableTool::unselect_columns | ( | ) |
Unselect all columns (if any).
void ZmTableTool::unselect_rows | ( | ) |
Unselect all rows (if any).
|
staticprotected |
Callback to unselect all rows.
|
virtual |
Verify string before pass it in write_cell() callback. Return TRUE to allow write_cell() and FALSE to reject changes.
Reimplemented in ZmDbTableTool.
ValueDiagnose ZmTableTool::verify_int | ( | AtomType | atype, |
const char * | s | ||
) |
Check scalar integer number.
ValueDiagnose ZmTableTool::verify_real | ( | AtomType | atype, |
const char * | s | ||
) |
Check scalar floating point number.
ValueDiagnose ZmTableTool::verify_string | ( | AtomType | atype, |
int | dim, | ||
const char * | s | ||
) |
Universal data type verifier.
|
staticprotected |
Callback to check validity before write_cell().
|
virtual |
Write data from screen to internal data structures. Do not check validity of entered data. At least, this callback should not diagnose errors because of it is used in DuplicateRowsCB.
Reimplemented in ZmDbTableTool.
|
protected |
Fixed number of rows
|
protected |
Structure to allocate memory for temporal string drawing
|
protected |
Structure to allocate memory temporally for clipboard operations
|
protected |
Pointed by popup cell
|
protected |
List of published (copied to clipboard) columns.
|
protected |
List of published (copied to clipboard) rows.
|
protected |
Current count of columns and rows - only data one!!! It does not include top title row nor leftmost index column
|
protected |
List of selected columns.
|
protected |
List of selected rows.
|
protected |
Widget of table
|
protected |
Widget of popup menu
|
protected |
Item widgets of popup menu.