ScriptTableViewer Class Reference

A editor for tables produced by a user defined shell script program. See ../STV/README for an explanation of how to write such scripts. More...

#include <scripttableviewer.h>

Inheritance diagram for ScriptTableViewer:
Inheritance graph
[legend]
Collaboration diagram for ScriptTableViewer:
Collaboration graph
[legend]

List of all members.

Classes

struct  SessionInfo

Public Types

enum  cmd_constant {
  activate,
  deactivate,
  resize
}
 

values that will be passed to the function call operator method.

More...
typedef CursorWindow::input_event input_event
 typename alias
typedef std::vector
< std::vector< CellInfo > > 
LayoutType
typedef std::list< std::string > paste_buffer_type
 The data type of the paste buffer.
typedef CursorWindow::row_col row_col
 typename alias
typedef CursorWindow::viewport viewport
 Returns true if there are unsaved edit changes in this viewer. the default return value is false. Override this function if your viewer has the ability to have unsaved edit changes -- most don't.

Public Member Functions

bool active () const
 Return the current "is window active" flag.
void addColumnData (std::string const &text)
void addColumnHeader (std::string const &title, size_t width, FieldAttributes const &a, bool border)
 Add a column to the column header table.
void addColumnHeader (std::string const &title, size_t width, bool border)
 Add a column to the column header table.
void addRow (std::string const &title, size_t height, bool bottomBorder, bool bold=false, bool editable=true, bool executable=true)
virtual std::string const & application_name () const
 Return the application name.
CellInfocellInfo (size_t row, size_t col)
 return a null or a modifiable pointer to the specified cell information.
CellInfo const * cellInfo (size_t row, size_t col) const
 return a null or a const pointer to the specified cell information.
void clear ()
 Discard all rows and columns.
size_t cols () const
 return count of table columns
size_t columnWidth (size_t column) const
 Consult the layout_ and the cols_ tables to determine with maximum of the column header and the widest cell in that column. Does not include gutters.
void commitPasteBuffer () const
 write the paste buffer to the os clipboard.
CursorInfo cursorInfo () const
 Return the current cursor information.
virtual std::string description () const
 Return a description of the application.
void discardSavedScreenLayout ()
 pop the screen layout stack and discard the data.
std::string const & error () const
 Returns the most recent file i/o error.
virtual bool fetchAllLines (std::list< std::string > &output)
 An optional method that fetches all the lines in this viewer object into a caller supplied list of strings.
void fetchPasteBuffer ()
 read the paste buffer from the os clipboard
bool fieldExecutable (CursorInfo const &cur) const
 Determine if the specified table cursor cell is editable or not.
bool fieldExecutable (size_t tableRow, size_t tableCol) const
 Determine if a specified row and column is and executable column.
virtual bool handle_event (CursorWindow::input_event const *e, CursorWindow::viewport *vp)
 Handle keystrokes and other events by superceding the the behavior of the TableViewer.
virtual void help ()
 Display help about this application.
void hideCursor (CursorWindow::viewport *vp)
 If cursor is visible, repaint it to remove its highlighting. Also, terminate any edit state operations (if any).
void invokeCommand (CursorWindow::viewport *vp, int cmdKey)
virtual bool is_dirty () const
 Return true if the application has modifications.
size_t longestRowTitle () const
 returns the number of chars in longest title
ViewerManagermanager ()
bool mixed_case () const
 Return the state of the mixed-case-find flag.
void moveDown (CursorWindow::viewport *vp)
 Move the cursor down one row. Normally bound to the down arrow key.
void moveLeft (CursorWindow::viewport *vp)
 Move the cursor left one column. Normally bound to the left arrow key.
void moveRight (CursorWindow::viewport *vp)
 Move the cursor right one column. Normally bound to the right arrow key.
void moveUp (CursorWindow::viewport *vp)
 Move the cursor up one row. Normally bound to the up arrow key.
bool ok () const
 Return true if no file read errors have occurred. See error() for details of any error.
virtual void operator() (CursorWindow::viewport *vp, int cmd)
 Handle screen repaint commands.
size_t originCol () const
 top left corner column
size_t originRow () const
 top left corner row
void pageBottom (CursorWindow::viewport *vp)
 Move the cursor to the last valid rows, and keep the column the same.
void pageDown (CursorWindow::viewport *vp)
 Move the cursor down one page. Keep the column the same.
void pageEnd (CursorWindow::viewport *vp)
 Move the cursor to maxrow,maxcol Keep the column the same.
void pageHome (CursorWindow::viewport *vp)
 Move the cursor to 0,0.
void pageLeft (CursorWindow::viewport *vp)
 Move the cursor left one page. Keep the column the same.
void pageRight (CursorWindow::viewport *vp)
 Move the cursor right one page. Keep the column the same.
void pageTop (CursorWindow::viewport *vp)
 Move the cursor to the first row in the table. keep the column the same.
void pageUp (CursorWindow::viewport *vp)
 Move the cursor up one page. Keep the column the same.
void paintCell (CursorWindow::viewport *vp, size_t vpRow, size_t vpCol, size_t tbRow, size_t tbCol, bool highlight=false, bool editCursor=true)
 Paint the specified cell at the specified viewport location. No validity checking is done. The most recently painted viewport is used.
virtual void paintCursor (CursorWindow::viewport *)
 If the cursor is marked for display, draw it on the screen.
paste_buffer_typepaste_buffer ()
 Get a pointer to the viewer manager's paste buffer.
void populateTable (std::string const &scriptParms, CursorWindow::viewport *vp=0)
 PopulateTable is invoked at various times to re-invoke the script associated with the ScriptTableViewer. The goal is to have the script produce the table.
virtual void repaintTitle (CursorWindow::viewport *vp)
 Repaint the title (presumably after it has changed).
void restartSession (CursorWindow::viewport *vp)
void restoreSavedScreenLayout ()
 Pop the screen layout stack and make its contents active.
RowInfo const & rowInfo (size_t row) const
 get a copy of a specified row titles, etc.
size_t rows () const
 return count of table rows
void saveScreenLayout ()
 Save the screen layout in a stack.
 ScriptTableViewer (ViewerManager *vm, std::string const &scriptName, std::string directory=std::string())
 Construct a ScriptTableViewer and open its file and read it into memory. The lines in the file are assumed to be delimited by the specified delimiter character. This constructor assumes that the first line of the file contains the names of the columns rather than the data for a row of text. The column headers must be delimited as well.
void set_data_dirty (bool f)
 Set the 'unsaved modifications' flag.
virtual void set_row_col_hint (size_t line, size_t column, bool repaint=false)
 The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change.
void setColInfo (size_t col, std::string const &title, size_t width, bool border, bool bold, bool edit)
 Set the column header information.
void setColInfo (size_t col, std::string const &title, size_t width, bool border)
 Set the column header information.
void setCursorInfo (CursorWindow::viewport *vp, CursorInfo const &i)
 Set the cursor information given a CursorInfo structure.
void setDir (std::string const &dir)
 Set the directory where the script should run.
void setDisplayTitles (bool flag)
 Set the flag that controls the permanancy of the displaying of the row and column titles.
void setOrigin (size_t row, size_t col)
 Set the upper left corner column in the world world of the layout_ no the screen coordinate world.
void setRowInfo (size_t row, RowInfo const &r)
 Set the titles and other row specific information givin a row.
void setRowInfo (size_t row, std::string const &title, size_t height, bool border, bool bold, bool edit)
 Set the row header information.
void setRowInfo (size_t row, std::string const &title, size_t height, bool border)
 Set the row header information.
void setRowsAndColumns (size_t rows, size_t cols)
 Set the maximum number of rows and columns in the layout. Adding or deleting as necessary to make it happen.
void showCursor (CursorWindow::viewport *vp)
 If the cursor is not already displayed, repaint it to indicate highlighting for edit.
bool showPopup (CursorWindow::viewport *vp, std::string const &definition, std::vector< std::pair< std::string, std::string > > &userInputs)
 Convert a string definition of a popup into an actual popup dialog and prompt the user with it. If the user aborts, return true, else return false;.
void triggerLayoutRecompute ()
 implement a copy constructor!
virtual ~ScriptTableViewer ()

Static Public Member Functions

static Viewerapp (ViewerManager *vm, std::string &fullname)
 Application "hook" function for the ScriptTableViewer class. Use it as a parameter to add_app, like this:

Protected Member Functions

void checkLayoutRecompute ()
void deleteRow (CursorWindow::viewport *vp)
 Erase the current row.
CellInfoeditCell ()
 Get a pointer, possibly null, to the current cell being edited.
bool fieldEditable (CursorInfo const &cur) const
 Determine if the specified table cursor cell is editable or not.
bool fieldEditable (size_t tableRow, size_t tableCol) const
 Determine if a specified row and column is and editable column.
void findFirst (CursorWindow::viewport *vp)
 Prompt the user for find string parameter and search for that string from the current edit point.
virtual bool findNext (CursorWindow::viewport *vp, bool first)
 Search for the current search_text_ from the current cell to the end of the table. Update the screen to reflect the new cursor position.
void forceRelayout ()
 mark the table layout for recomputation at some later point in time
void insertRowAbove (CursorWindow::viewport *vp, RowInfo const &info)
 Insert new row above the current row.
void insertRowBelow (CursorWindow::viewport *vp, RowInfo const &info)
 Insert new row below the current row.
virtual void paintField (CursorWindow::viewport *vp, size_t vpRow, size_t vpCol, CellInfo const *cell, size_t cellRow, size_t vpColumns, bool editCursor)
 Called by paintCursor to draw the text of the field on the screen. This function handles clipping and truncaton of text that is too long in coordination with fieldEditColumn_.
void positionTextInputPointer (CursorWindow::viewport *vp)
virtual void setCursorInfo (CursorWindow::viewport *vp, size_t worldRow, size_t worldCol, bool displayed)
 Superseed of base class version only for the purpose of detecting field changes so that edit sessions on fields can be terminated.
void setTextInputPointer (size_t vpRow, size_t vpCol)
 Set the screen location where text cursor goes.
void snatchEdit (CursorWindow::viewport *vp, FileName const &directory)
 Given the current cursor position within the current cell, snatch a filename / line number pair out of the text and open an edit session on that file/line.
void terminateInput ()
 If the current cell has been edited, finish the editing process.

Static Protected Member Functions

static bool isTableEditKey (CursorWindow::input_event const *e)
 Returns true if the specified event is an "edit" key.

Protected Attributes

std::vector< ColumnInfocols_
std::vector< size_t > colWidths_
int delimiter_
bool is_regex_
 If true, use regular expression searches.
LayoutType layout_
ViewerManagermanager_
bool match_words_
 If true, use word searches.
bool mixed_case_
 If true, use case insensitive searches.
size_t pageHeight_
size_t pageWidth_
std::vector< RowInforows_
std::string search_text_
 Text to search for ////////////////////////////////////////////////////////////////////////////////////.

Private Member Functions

void handleReturnedCells ()
 Handle passing cells back from a popup style page to its caller.

Private Attributes

std::string directory_
std::string fileError_
std::vector< int > invocationKeys_
bool keyKludge_
std::vector< std::pair
< TableViewer, std::string > > 
prevScreenLayouts_
std::string scriptname_
std::vector< SessionInfosessions_
std::string title_

Detailed Description

A editor for tables produced by a user defined shell script program. See ../STV/README for an explanation of how to write such scripts.

The script that generates the tables must maintain a set of state variables which are sent to the ScriptTableViewer object along with the table contents when the user executes commands. The script is responsible for executing whatever operating system shell commands are necessary to populate tables shown to the user and to save any needed data to files.

The script table viewers are not designed for session or connection based applications. Transaction based applications are about all that it can do (and then only with hard work -- or by following a well defined implementation pattern).

At startup, the script is invoked with no command line parameters to indicate that this is the first time through. The script must generate an initial table and initial state variable values. The user is then presented with that table which he can view, dismiss, enter cell data, and issue commands on table cells. Commands are entered by pressing the enter key (on any cell), or by pressing other keys in cells which are not editable. That is, if a cell is not editable, key strokes are interpreted as commands.

This kind of viewer is best for relatively low performance editing because command interpretation requires a script invocation and a delete and recreate of the whole table. To speed things up a bit, popup dialogs are handled by the ScriptTableViewer object based on state variables provided by the script.

Example scripts can be found in the STV directory. See example.sh in particular because of its comments.

Definition at line 34 of file scripttableviewer.h.


Member Typedef Documentation

typename alias

Definition at line 192 of file viewer.h.

typedef std::vector< std::vector< CellInfo > > LayoutType [inherited]

Definition at line 624 of file tableviewer.h.

typedef std::list<std::string> paste_buffer_type [inherited]

The data type of the paste buffer.

Definition at line 194 of file viewer.h.

typedef CursorWindow::row_col row_col [inherited]

typename alias

Definition at line 191 of file viewer.h.

typedef CursorWindow::viewport viewport [inherited]

Returns true if there are unsaved edit changes in this viewer. the default return value is false. Override this function if your viewer has the ability to have unsaved edit changes -- most don't.

typename alias

Definition at line 190 of file viewer.h.


Member Enumeration Documentation

enum cmd_constant [inherited]

values that will be passed to the function call operator method.

Enumerator:
activate 

means you have been activated

deactivate 

some other viewport has taken focus

resize 

only the size has changed

Definition at line 793 of file cursorwindow.h.


Constructor & Destructor Documentation

ScriptTableViewer ( ViewerManager vm,
std::string const &  scriptName,
std::string  directory = std::string() 
)

Construct a ScriptTableViewer and open its file and read it into memory. The lines in the file are assumed to be delimited by the specified delimiter character. This constructor assumes that the first line of the file contains the names of the columns rather than the data for a row of text. The column headers must be delimited as well.

Parameters:
vm The viewermanager controlling this viewer.
scriptName The name of the script to invoke to populate the table
directory Where the script should run. The script must be visible from that directory!

Definition at line 69 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

~ScriptTableViewer (  )  [virtual]

Definition at line 64 of file scripttableviewer.cxx.


Member Function Documentation

bool active (  )  const [inherited]

Return the current "is window active" flag.

A given window is active if it has text focus, otherwise it is not.

Definition at line 615 of file tableviewer.h.

Here is the caller graph for this function:

void addColumnData ( std::string const &  text  )  [inherited]

Definition at line 387 of file tableviewer.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void addColumnHeader ( std::string const &  title,
size_t  width,
FieldAttributes const &  a,
bool  border 
) [inherited]

Add a column to the column header table.

Parameters:
title defines the title for the row
width defines the number of screen columns to for this world column
a defines the field attributes
border defines the left border drawing option

Definition at line 371 of file tableviewer.h.

void addColumnHeader ( std::string const &  title,
size_t  width,
bool  border 
) [inherited]

Add a column to the column header table.

Parameters:
title defines the title for the row
width defines the number of screen columns to for this world column
border defines the left border drawing option

Definition at line 360 of file tableviewer.h.

Here is the caller graph for this function:

void addRow ( std::string const &  title,
size_t  height,
bool  bottomBorder,
bool  bold = false,
bool  editable = true,
bool  executable = true 
) [inherited]

Definition at line 407 of file tableviewer.h.

Here is the caller graph for this function:

Viewer * app ( ViewerManager vm,
std::string &  fullname 
) [static]

Application "hook" function for the ScriptTableViewer class. Use it as a parameter to add_app, like this:

           vm.add_app(ScriptTableViewer::app, "ScriptTableViewer");

Definition at line 359 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string const & application_name (  )  const [virtual]

Return the application name.

Reimplemented from TableViewer.

Definition at line 344 of file scripttableviewer.cxx.

Here is the caller graph for this function:

TableViewer::CellInfo * cellInfo ( size_t  row,
size_t  col 
) [inherited]

return a null or a modifiable pointer to the specified cell information.

Parameters:
row defines the zero based row number of interest
col defines the zero based column number of interest
Returns:
a modifiable pointer to the desired cell or null if the cell does not exist.

Definition at line 551 of file tableviewer.cxx.

Here is the call graph for this function:

TableViewer::CellInfo const * cellInfo ( size_t  row,
size_t  col 
) const [inherited]

return a null or a const pointer to the specified cell information.

Parameters:
row defines the zero based row number of interest
col defines the zero based column number of interest
Returns:
a const pointer to the desired cell or null if the cell does not exist.

Definition at line 543 of file tableviewer.cxx.

Here is the caller graph for this function:

void checkLayoutRecompute (  )  [protected, inherited]

Definition at line 741 of file tableviewer.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void clear (  )  [inherited]

Discard all rows and columns.

Definition at line 1151 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

size_t cols (  )  const [inherited]

return count of table columns

Definition at line 254 of file tableviewer.h.

Here is the caller graph for this function:

size_t columnWidth ( size_t  column  )  const [inherited]

Consult the layout_ and the cols_ tables to determine with maximum of the column header and the widest cell in that column. Does not include gutters.

Definition at line 510 of file tableviewer.cxx.

Here is the caller graph for this function:

void commitPasteBuffer (  )  const [inherited]

write the paste buffer to the os clipboard.

Definition at line 625 of file viewer.cxx.

Here is the caller graph for this function:

CursorInfo cursorInfo (  )  const [inherited]

Return the current cursor information.

Definition at line 491 of file tableviewer.h.

Here is the caller graph for this function:

void deleteRow ( CursorWindow::viewport vp  )  [protected, inherited]

Erase the current row.

Parameters:
vp the viewport to draw in -- though none is none

Definition at line 1242 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string description (  )  const [virtual]

Return a description of the application.

Reimplemented from TableViewer.

Definition at line 352 of file scripttableviewer.cxx.

void discardSavedScreenLayout (  ) 

pop the screen layout stack and discard the data.

Definition at line 310 of file scripttableviewer.h.

TableViewer::CellInfo * editCell (  )  [protected, inherited]

Get a pointer, possibly null, to the current cell being edited.

Returns:
a pointer cell information for the current cursor position.

If the return value is null, then table is empty.

Definition at line 59 of file tableeditor.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string const& error (  )  const

Returns the most recent file i/o error.

Definition at line 182 of file scripttableviewer.h.

bool fetchAllLines ( std::list< std::string > &  output  )  [virtual, inherited]

An optional method that fetches all the lines in this viewer object into a caller supplied list of strings.

Warning:
This is an optional feature, many viewers do not support it.
Parameters:
[out] output The location to store all the lines from this viewer.
Returns:
true to indicate that the data was extracted and false to indicate that this viewer does not support this feature.

Reimplemented in ListViewer.

Definition at line 705 of file viewer.cxx.

Here is the caller graph for this function:

void fetchPasteBuffer (  )  [inherited]

read the paste buffer from the os clipboard

Definition at line 661 of file viewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

bool fieldEditable ( CursorInfo const &  cur  )  const [protected, inherited]

Determine if the specified table cursor cell is editable or not.

Returns:
true if the table row and column, specified in cur refers to an editable location.
Parameters:
cur The table cursor position (not screen, table)

Definition at line 164 of file tableeditor.h.

Here is the call graph for this function:

bool fieldEditable ( size_t  tableRow,
size_t  tableCol 
) const [protected, inherited]

Determine if a specified row and column is and editable column.

Returns:
true if the specified row and column is editable.
Parameters:
tableRow -- the row within the table, has nothing to do with screen coordinates.
tableCol -- the column within the table, has nothing to do with screen coordinates.

Definition at line 143 of file tableeditor.h.

Here is the caller graph for this function:

bool fieldExecutable ( CursorInfo const &  cur  )  const

Determine if the specified table cursor cell is editable or not.

Returns:
true if the table row and column, specified in cur refers to an editable location.
Parameters:
cur The table cursor position (not screen, table)

Definition at line 250 of file scripttableviewer.h.

Here is the call graph for this function:

bool fieldExecutable ( size_t  tableRow,
size_t  tableCol 
) const

Determine if a specified row and column is and executable column.

Returns:
true if the specified row and column is executable.
Parameters:
tableRow -- the row within the table, has nothing to do with screen coordinates.
tableCol -- the column within the table, has nothing to do with screen coordinates.

Definition at line 229 of file scripttableviewer.h.

Here is the caller graph for this function:

void findFirst ( CursorWindow::viewport vp  )  [protected, inherited]

Prompt the user for find string parameter and search for that string from the current edit point.

Definition at line 1257 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

bool findNext ( CursorWindow::viewport vp,
bool  first 
) [protected, virtual, inherited]

Search for the current search_text_ from the current cell to the end of the table. Update the screen to reflect the new cursor position.

Parameters:
vp The viewport in which to draw
first True if the is first time this string has been used for the search (and thus the current cell should be searched).
Returns:
true to indicate that the search text was found and that the the screen has been updated.

Definition at line 1373 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void forceRelayout (  )  [protected, inherited]

mark the table layout for recomputation at some later point in time

Definition at line 718 of file tableviewer.h.

Here is the caller graph for this function:

bool handle_event ( CursorWindow::input_event const *  e,
CursorWindow::viewport vp 
) [virtual]

Handle keystrokes and other events by superceding the the behavior of the TableViewer.

Reimplemented from TableEditor.

Definition at line 133 of file scripttableviewer.cxx.

Here is the call graph for this function:

void handleReturnedCells (  )  [private]

Handle passing cells back from a popup style page to its caller.

Definition at line 97 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void help (  )  [virtual]

Display help about this application.

Reimplemented from TableViewer.

Definition at line 409 of file scripttableviewer.cxx.

Here is the call graph for this function:

void hideCursor ( CursorWindow::viewport vp  )  [inherited]

If cursor is visible, repaint it to remove its highlighting. Also, terminate any edit state operations (if any).

Definition at line 667 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void insertRowAbove ( CursorWindow::viewport vp,
RowInfo const &  info 
) [protected, inherited]

Insert new row above the current row.

Parameters:
vp the viewport to draw in
info the title of the current row

Definition at line 1172 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void insertRowBelow ( CursorWindow::viewport vp,
RowInfo const &  info 
) [protected, inherited]

Insert new row below the current row.

Parameters:
vp the viewport to draw in
info the title of the current row

Definition at line 1194 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void invokeCommand ( CursorWindow::viewport vp,
int  cmdKey 
)

Definition at line 1007 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_dirty (  )  const [virtual, inherited]

Return true if the application has modifications.

Reimplemented from Viewer.

Definition at line 441 of file tableviewer.cxx.

Here is the caller graph for this function:

bool isTableEditKey ( CursorWindow::input_event const *  e  )  [static, protected, inherited]

Returns true if the specified event is an "edit" key.

Parameters:
e a pointer to an input event that should treated as if it were printable character or delete character, that sort of thing.

Definition at line 704 of file tableeditor.cxx.

Here is the caller graph for this function:

size_t longestRowTitle (  )  const [inherited]

returns the number of chars in longest title

Definition at line 449 of file tableviewer.cxx.

Here is the caller graph for this function:

ViewerManager* manager (  )  [inherited]

Definition at line 126 of file viewer.h.

Here is the caller graph for this function:

bool mixed_case (  )  const [inherited]

Return the state of the mixed-case-find flag.

Definition at line 621 of file tableviewer.h.

Here is the caller graph for this function:

void moveDown ( CursorWindow::viewport vp  )  [inherited]

Move the cursor down one row. Normally bound to the down arrow key.

Definition at line 896 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void moveLeft ( CursorWindow::viewport vp  )  [inherited]

Move the cursor left one column. Normally bound to the left arrow key.

Definition at line 930 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void moveRight ( CursorWindow::viewport vp  )  [inherited]

Move the cursor right one column. Normally bound to the right arrow key.

Definition at line 954 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void moveUp ( CursorWindow::viewport vp  )  [inherited]

Move the cursor up one row. Normally bound to the up arrow key.

Definition at line 869 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ok (  )  const

Return true if no file read errors have occurred. See error() for details of any error.

Definition at line 178 of file scripttableviewer.h.

void operator() ( CursorWindow::viewport vp,
int  cmd 
) [virtual, inherited]

Handle screen repaint commands.

Implements Viewer.

Definition at line 63 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

size_t originCol (  )  const [inherited]

top left corner column

Definition at line 257 of file tableviewer.h.

Here is the caller graph for this function:

size_t originRow (  )  const [inherited]

top left corner row

Definition at line 256 of file tableviewer.h.

Here is the caller graph for this function:

void pageBottom ( CursorWindow::viewport vp  )  [inherited]

Move the cursor to the last valid rows, and keep the column the same.

Normally bound to the control B key.

Definition at line 1121 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageDown ( CursorWindow::viewport vp  )  [inherited]

Move the cursor down one page. Keep the column the same.

Normally bound to the PageDown or Next key.

Definition at line 1001 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageEnd ( CursorWindow::viewport vp  )  [inherited]

Move the cursor to maxrow,maxcol Keep the column the same.

Normally bound to the end key

Definition at line 1110 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageHome ( CursorWindow::viewport vp  )  [inherited]

Move the cursor to 0,0.

Normally bound to the Home key

Definition at line 1101 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageLeft ( CursorWindow::viewport vp  )  [inherited]

Move the cursor left one page. Keep the column the same.

Normally bound to the shift-Tab key.

Definition at line 1069 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageRight ( CursorWindow::viewport vp  )  [inherited]

Move the cursor right one page. Keep the column the same.

Normally bound to the tab key.

Definition at line 1034 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageTop ( CursorWindow::viewport vp  )  [inherited]

Move the cursor to the first row in the table. keep the column the same.

Normally bound to the control B key.

Definition at line 1138 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void pageUp ( CursorWindow::viewport vp  )  [inherited]

Move the cursor up one page. Keep the column the same.

Normally bound to the PageUp or Prior key.

Definition at line 980 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void paintCell ( CursorWindow::viewport vp,
size_t  vpRow,
size_t  vpCol,
size_t  tbRow,
size_t  tbCol,
bool  highlight = false,
bool  editCursor = true 
) [inherited]

Paint the specified cell at the specified viewport location. No validity checking is done. The most recently painted viewport is used.

Parameters:
vp the viewport to draw in
vpRow the viewport row
vpCol the column
tbRow table row
tbCol the table column
highlight flag indicating highlighted display
editCursor flag indicating the cursor should be left in edit poisiton

Definition at line 785 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void paintCursor ( CursorWindow::viewport vp  )  [virtual, inherited]

If the cursor is marked for display, draw it on the screen.

The function is virtual so that derived classes can hook into the repaint functionality so they can position the edit cursor.

Parameters:
vp is the viewport to positiont he cursor into

Definition at line 684 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void paintField ( CursorWindow::viewport vp,
size_t  vpRow,
size_t  vpCol,
TableViewer::CellInfo const *  cell,
size_t  cellRow,
size_t  vpColumns,
bool  editCursor 
) [protected, virtual, inherited]

Called by paintCursor to draw the text of the field on the screen. This function handles clipping and truncaton of text that is too long in coordination with fieldEditColumn_.

Parameters:
vp the viewport into which to draw the field
vpRow the row within the viewport to paint the field
vpCol the column within the viewport to start the painting
cell the table cell to paint
vpColumns the number columns the field should take up
editCursor indicates that the cursor should be left in the field edit position (or not).

If editCursor is false, the cursor will be left at the end of the the field.

See also:
TableViewer::paintField for an explanation of the parameters and the environment under which this function is called.
Note:
This function leaves the cursor in first column of the the field, not at the end! PaintCell calls this function and this fact needs to be understood when writing paint handlers.

Reimplemented from TableViewer.

Definition at line 589 of file tableeditor.cxx.

Here is the call graph for this function:

Viewer::paste_buffer_type * paste_buffer (  )  [inherited]

Get a pointer to the viewer manager's paste buffer.

Definition at line 601 of file viewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void populateTable ( std::string const &  scriptParms,
CursorWindow::viewport vp = 0 
)

PopulateTable is invoked at various times to re-invoke the script associated with the ScriptTableViewer. The goal is to have the script produce the table.

Parameters:
[in] scriptParms The command line arguments to the script
[in,out] vp Optional view port for painting popups

If the viewport pointer is null, popup processing will not work correctly.

Definition at line 588 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void positionTextInputPointer ( CursorWindow::viewport vp  )  [protected, inherited]

Definition at line 1164 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void repaintTitle ( CursorWindow::viewport vp  )  [virtual]

Repaint the title (presumably after it has changed).

Parameters:
vp The viewport where this table is drawn.

By default, this function prints the application name, but derived classes may wish to superseed this behavior.

Reimplemented from TableViewer.

Definition at line 1085 of file scripttableviewer.cxx.

Here is the call graph for this function:

void restartSession ( CursorWindow::viewport vp  ) 

Definition at line 963 of file scripttableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void restoreSavedScreenLayout (  ) 

Pop the screen layout stack and make its contents active.

Definition at line 297 of file scripttableviewer.h.

Here is the caller graph for this function:

RowInfo const& rowInfo ( size_t  row  )  const [inherited]

get a copy of a specified row titles, etc.

Parameters:
row The row to modify
Returns:
The specified row's information.

Definition at line 414 of file tableviewer.h.

Here is the caller graph for this function:

size_t rows (  )  const [inherited]

return count of table rows

Definition at line 253 of file tableviewer.h.

Here is the caller graph for this function:

void saveScreenLayout (  ) 

Save the screen layout in a stack.

Definition at line 291 of file scripttableviewer.h.

Here is the caller graph for this function:

void set_data_dirty ( bool  f  )  [inherited]

Set the 'unsaved modifications' flag.

Parameters:
f defines the status of the dirty flag.

See the function is_dirty().

Definition at line 608 of file tableviewer.h.

Here is the caller graph for this function:

virtual void set_row_col_hint ( size_t  line,
size_t  column,
bool  repaint = false 
) [virtual, inherited]

The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change.

Again, obedience to this function is entirely optional and most viewers will ignore it.

The line and column numbers are 0 base! Contrary to normal user's expectations, so account for this in any input calculations you make.

Definition at line 202 of file viewer.h.

Here is the caller graph for this function:

void setColInfo ( size_t  col,
std::string const &  title,
size_t  width,
bool  border,
bool  bold,
bool  edit 
) [inherited]

Set the column header information.

Parameters:
col defines the col number of interest (world col, not screen col)
title defines the title for the row
width defines the number of screen columns to for this world column
border defines the left border drawing option
bold defines the bold display attribute for this column
edit defines the editable flag for this colum

Definition at line 339 of file tableviewer.h.

void setColInfo ( size_t  col,
std::string const &  title,
size_t  width,
bool  border 
) [inherited]

Set the column header information.

Parameters:
col defines the col number of interest (world col, not screen col)
title defines the title for the row
width defines the number of screen columns to for this world column
border defines the left border drawing option

Definition at line 322 of file tableviewer.h.

Here is the caller graph for this function:

void setCursorInfo ( CursorWindow::viewport vp,
CursorInfo const &  i 
) [inherited]

Set the cursor information given a CursorInfo structure.

Definition at line 495 of file tableviewer.h.

Here is the call graph for this function:

void setCursorInfo ( CursorWindow::viewport vp,
size_t  worldRow,
size_t  worldCol,
bool  displayed 
) [protected, virtual, inherited]

Superseed of base class version only for the purpose of detecting field changes so that edit sessions on fields can be terminated.

See also:
TableViewer::setCursorInfo

Reimplemented from TableViewer.

Reimplemented in CsvViewer.

Definition at line 569 of file tableeditor.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void setDir ( std::string const &  dir  ) 

Set the directory where the script should run.

Parameters:
dir Directory name.

Definition at line 226 of file scripttableviewer.h.

void setDisplayTitles ( bool  flag  )  [inherited]

Set the flag that controls the permanancy of the displaying of the row and column titles.

Parameters:
flag if true, means that the titles should always be displayed.

Definition at line 259 of file tableviewer.h.

void setOrigin ( size_t  row,
size_t  col 
) [inherited]

Set the upper left corner column in the world world of the layout_ no the screen coordinate world.

Parameters:
row is the row in the virtual world
col is the column in hte virtual world

Definition at line 443 of file tableviewer.h.

Here is the caller graph for this function:

void setRowInfo ( size_t  row,
RowInfo const &  r 
) [inherited]

Set the titles and other row specific information givin a row.

Parameters:
row The row to modify
r The RowInfo to change

Definition at line 420 of file tableviewer.h.

void setRowInfo ( size_t  row,
std::string const &  title,
size_t  height,
bool  border,
bool  bold,
bool  edit 
) [inherited]

Set the row header information.

Parameters:
row defines the row number of interest (world row, not screen row)
title defines the title for the row
height defines the number of screen rows to reserve vertically for "row"
border defines the bottom border drawing option
bold defines the bold drawing flag for the row
edit defines the editable flag for this row

Definition at line 300 of file tableviewer.h.

void setRowInfo ( size_t  row,
std::string const &  title,
size_t  height,
bool  border 
) [inherited]

Set the row header information.

Parameters:
row defines the row number of interest (world row, not screen row)
title defines the title for the row
height defines the number of screen rows to reserve vertically for "row"
border defines the bottom border drawing option

Definition at line 283 of file tableviewer.h.

Here is the caller graph for this function:

void setRowsAndColumns ( size_t  rows,
size_t  cols 
) [inherited]

Set the maximum number of rows and columns in the layout. Adding or deleting as necessary to make it happen.

Parameters:
rows is the exact number of rows to establish
cols is the exact number of cols to establish.

Definition at line 492 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void setTextInputPointer ( size_t  vpRow,
size_t  vpCol 
) [protected, inherited]

Set the screen location where text cursor goes.

Parameters:
vpRow is the viewport relative row
vpCol is the viewport relative column

Definition at line 707 of file tableviewer.h.

Here is the caller graph for this function:

void showCursor ( CursorWindow::viewport vp  )  [inherited]

If the cursor is not already displayed, repaint it to indicate highlighting for edit.

Definition at line 676 of file tableviewer.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

bool showPopup ( CursorWindow::viewport vp,
std::string const &  definition,
std::vector< std::pair< std::string, std::string > > &  userInputs 
)

Convert a string definition of a popup into an actual popup dialog and prompt the user with it. If the user aborts, return true, else return false;.

User selections are returned in the userInputs vector. Each user input field is returned as a <name,value> pair.

Parameters:
[in] vp The viewport to draw in
[in] definition The definition of the popup title and fields.
[out] userInputs The user's selections.

The definition string looks like this:

            =%==%--POPUP=title;label1;value1;type1;content1;...

Invalid formatting of the definition will be treated as a user abort.

Here is the caller graph for this function:

void snatchEdit ( CursorWindow::viewport vp,
FileName const &  directory 
) [protected, inherited]

Given the current cursor position within the current cell, snatch a filename / line number pair out of the text and open an edit session on that file/line.

Parameters:
[in] vp The viewport to draw in.
[out] directory The directory that the file name, extracted from the cell text, is meant to be found relative to. WARNING: The directory name must have a trailing separator (/ or \).

Definition at line 462 of file tableeditor.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void terminateInput (  )  [protected, inherited]

If the current cell has been edited, finish the editing process.

Definition at line 582 of file tableeditor.cxx.

Here is the caller graph for this function:

void triggerLayoutRecompute (  )  [inherited]

implement a copy constructor!

Called by field editing functions to inform the table repaint mechanism, operator()(), that the column sizes need to be recomputed.

Definition at line 63 of file tableviewer.h.

Here is the caller graph for this function:


Member Data Documentation

std::vector<ColumnInfo> cols_ [protected, inherited]

Definition at line 666 of file tableviewer.h.

std::vector<size_t> colWidths_ [protected, inherited]

Definition at line 660 of file tableviewer.h.

int delimiter_ [protected, inherited]

Definition at line 76 of file tableeditor.h.

std::string directory_ [private]

Definition at line 78 of file scripttableviewer.h.

std::string fileError_ [private]

Definition at line 72 of file scripttableviewer.h.

std::vector<int> invocationKeys_ [private]

Definition at line 76 of file scripttableviewer.h.

bool is_regex_ [protected, inherited]

If true, use regular expression searches.

Definition at line 672 of file tableviewer.h.

bool keyKludge_ [private]

Reimplemented from TableEditor.

Definition at line 73 of file scripttableviewer.h.

LayoutType layout_ [protected, inherited]

Definition at line 663 of file tableviewer.h.

ViewerManager* manager_ [protected, inherited]

Definition at line 117 of file viewer.h.

bool match_words_ [protected, inherited]

If true, use word searches.

Definition at line 673 of file tableviewer.h.

bool mixed_case_ [protected, inherited]

If true, use case insensitive searches.

Definition at line 671 of file tableviewer.h.

size_t pageHeight_ [protected, inherited]

Definition at line 658 of file tableviewer.h.

size_t pageWidth_ [protected, inherited]

Definition at line 657 of file tableviewer.h.

std::vector<std::pair<TableViewer, std::string> > prevScreenLayouts_ [private]

Definition at line 148 of file scripttableviewer.h.

std::vector<RowInfo> rows_ [protected, inherited]

Definition at line 665 of file tableviewer.h.

std::string scriptname_ [private]

Definition at line 71 of file scripttableviewer.h.

std::string search_text_ [protected, inherited]

Text to search for ////////////////////////////////////////////////////////////////////////////////////.

Definition at line 674 of file tableviewer.h.

std::vector<SessionInfo> sessions_ [private]

Definition at line 141 of file scripttableviewer.h.

std::string title_ [private]

Definition at line 74 of file scripttableviewer.h.


The documentation for this class was generated from the following files:
Generated on Wed Feb 29 22:56:30 2012 for CXXUtilities by  doxygen 1.6.3