An editor for table files whose fields are separated by some user defined character. More...
#include <tableeditor.h>
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. | |
CellInfo * | cellInfo (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. | |
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 | |
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). | |
virtual bool | is_dirty () const |
Return true if the application has modifications. | |
size_t | longestRowTitle () const |
returns the number of chars in longest title | |
ViewerManager * | manager () |
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. | |
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_type * | paste_buffer () |
Get a pointer to the viewer manager's paste buffer. | |
virtual void | repaintTitle (CursorWindow::viewport *vp) |
Repaint the title (presumably after it has changed). | |
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 | 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 | 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. | |
TableEditor (ViewerManager *vm, int delimChar=',') | |
Construct a TableEditor 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 | triggerLayoutRecompute () |
implement a copy constructor! | |
virtual | ~TableEditor () |
Protected Member Functions | |
void | checkLayoutRecompute () |
void | deleteRow (CursorWindow::viewport *vp) |
Erase the current row. | |
CellInfo * | editCell () |
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 | |
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. | |
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< ColumnInfo > | cols_ |
std::vector< size_t > | colWidths_ |
int | delimiter_ |
bool | is_regex_ |
If true, use regular expression searches. | |
bool | keyKludge_ |
LayoutType | layout_ |
ViewerManager * | manager_ |
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< RowInfo > | rows_ |
std::string | search_text_ |
Text to search for ////////////////////////////////////////////////////////////////////////////////////. | |
Private Attributes | |
size_t | fieldEditColumn_ |
An editor for table files whose fields are separated by some user defined character.
The user is allowed to change the contents of the file and save those changes or write them to a different file.
See CsvViewer for a derived class that does useful work.
Definition at line 34 of file tableeditor.h.
typedef CursorWindow::input_event input_event [inherited] |
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] |
typedef CursorWindow::row_col row_col [inherited] |
typedef CursorWindow::viewport viewport [inherited] |
enum cmd_constant [inherited] |
values that will be passed to the function call operator method.
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.
TableEditor | ( | ViewerManager * | vm, | |
int | delimChar = ',' | |||
) |
Construct a TableEditor 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.
vm | The viewermanager controlling this viewer. | |
delimChar | defines the character that delimits the values -- the default is of course comma but other characters can be used -- tab, "|" or others as needed. |
Definition at line 49 of file tableeditor.cxx.
~TableEditor | ( | ) | [virtual] |
Definition at line 44 of file tableeditor.cxx.
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.
void addColumnData | ( | std::string const & | text | ) | [inherited] |
Definition at line 387 of file tableviewer.h.
void addColumnHeader | ( | std::string const & | title, | |
size_t | width, | |||
FieldAttributes const & | a, | |||
bool | border | |||
) | [inherited] |
Add a column to the column header table.
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.
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.
void addRow | ( | std::string const & | title, | |
size_t | height, | |||
bool | bottomBorder, | |||
bool | bold = false , |
|||
bool | editable = true , |
|||
bool | executable = true | |||
) | [inherited] |
string const & application_name | ( | ) | const [virtual, inherited] |
Return the application name.
Implements Viewer.
Reimplemented in CsvViewer, and ScriptTableViewer.
Definition at line 416 of file tableviewer.cxx.
TableViewer::CellInfo * cellInfo | ( | size_t | row, | |
size_t | col | |||
) | [inherited] |
return a null or a modifiable pointer to the specified cell information.
row | defines the zero based row number of interest | |
col | defines the zero based column number of interest |
Definition at line 551 of file tableviewer.cxx.
TableViewer::CellInfo const * cellInfo | ( | size_t | row, | |
size_t | col | |||
) | const [inherited] |
return a null or a const pointer to the specified cell information.
row | defines the zero based row number of interest | |
col | defines the zero based column number of interest |
Definition at line 543 of file tableviewer.cxx.
void checkLayoutRecompute | ( | ) | [protected, inherited] |
Definition at line 741 of file tableviewer.h.
void clear | ( | ) | [inherited] |
Discard all rows and columns.
Definition at line 1151 of file tableviewer.cxx.
size_t cols | ( | ) | const [inherited] |
return count of table columns
Definition at line 254 of file tableviewer.h.
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.
void commitPasteBuffer | ( | ) | const [inherited] |
write the paste buffer to the os clipboard.
Definition at line 625 of file viewer.cxx.
CursorInfo cursorInfo | ( | ) | const [inherited] |
Return the current cursor information.
Definition at line 491 of file tableviewer.h.
void deleteRow | ( | CursorWindow::viewport * | vp | ) | [protected, inherited] |
Erase the current row.
vp | the viewport to draw in -- though none is none |
Definition at line 1242 of file tableviewer.cxx.
string description | ( | ) | const [virtual, inherited] |
Return a description of the application.
Implements Viewer.
Reimplemented in CsvViewer, and ScriptTableViewer.
Definition at line 425 of file tableviewer.cxx.
TableViewer::CellInfo * editCell | ( | ) | [protected] |
Get a pointer, possibly null, to the current cell being edited.
If the return value is null, then table is empty.
Definition at line 59 of file tableeditor.cxx.
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.
[out] | output | The location to store all the lines from this viewer. |
Reimplemented in ListViewer.
Definition at line 705 of file viewer.cxx.
void fetchPasteBuffer | ( | ) | [inherited] |
read the paste buffer from the os clipboard
Definition at line 661 of file viewer.cxx.
bool fieldEditable | ( | CursorInfo const & | cur | ) | const [protected] |
Determine if the specified table cursor cell is editable or not.
cur | The table cursor position (not screen, table) |
Definition at line 164 of file tableeditor.h.
bool fieldEditable | ( | size_t | tableRow, | |
size_t | tableCol | |||
) | const [protected] |
Determine if a specified row and column is and editable column.
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.
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.
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.
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). |
Definition at line 1373 of file tableviewer.cxx.
void forceRelayout | ( | ) | [protected, inherited] |
mark the table layout for recomputation at some later point in time
Definition at line 718 of file tableviewer.h.
bool handle_event | ( | CursorWindow::input_event const * | e, | |
CursorWindow::viewport * | vp | |||
) | [protected, virtual] |
Handle keystrokes and other events by superceding the the behavior of the TableViewer.
Reimplemented from TableViewer.
Reimplemented in CsvViewer, and ScriptTableViewer.
Definition at line 75 of file tableeditor.cxx.
void help | ( | ) | [virtual, inherited] |
Display help about this application.
Reimplemented from Viewer.
Reimplemented in CsvViewer, and ScriptTableViewer.
Definition at line 433 of file tableviewer.cxx.
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.
void insertRowAbove | ( | CursorWindow::viewport * | vp, | |
RowInfo const & | info | |||
) | [protected, inherited] |
Insert new row above the current row.
vp | the viewport to draw in | |
info | the title of the current row |
Definition at line 1172 of file tableviewer.cxx.
void insertRowBelow | ( | CursorWindow::viewport * | vp, | |
RowInfo const & | info | |||
) | [protected, inherited] |
Insert new row below the current row.
vp | the viewport to draw in | |
info | the title of the current row |
Definition at line 1194 of file tableviewer.cxx.
bool is_dirty | ( | ) | const [virtual, inherited] |
Return true if the application has modifications.
Reimplemented from Viewer.
Definition at line 441 of file tableviewer.cxx.
bool isTableEditKey | ( | CursorWindow::input_event const * | e | ) | [static, protected] |
Returns true if the specified event is an "edit" key.
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.
size_t longestRowTitle | ( | ) | const [inherited] |
returns the number of chars in longest title
Definition at line 449 of file tableviewer.cxx.
ViewerManager* manager | ( | ) | [inherited] |
bool mixed_case | ( | ) | const [inherited] |
Return the state of the mixed-case-find flag.
Definition at line 621 of file tableviewer.h.
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.
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.
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.
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.
void operator() | ( | CursorWindow::viewport * | vp, | |
int | cmd | |||
) | [virtual, inherited] |
Handle screen repaint commands.
Implements Viewer.
Definition at line 63 of file tableviewer.cxx.
size_t originCol | ( | ) | const [inherited] |
top left corner column
Definition at line 257 of file tableviewer.h.
size_t originRow | ( | ) | const [inherited] |
top left corner row
Definition at line 256 of file tableviewer.h.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
vp | is the viewport to positiont he cursor into |
Definition at line 684 of file tableviewer.cxx.
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] |
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_.
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.
Reimplemented from TableViewer.
Definition at line 589 of file tableeditor.cxx.
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.
void positionTextInputPointer | ( | CursorWindow::viewport * | vp | ) | [protected, inherited] |
Definition at line 1164 of file tableviewer.cxx.
void repaintTitle | ( | CursorWindow::viewport * | vp | ) | [virtual, inherited] |
Repaint the title (presumably after it has changed).
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 in ScriptTableViewer.
Definition at line 48 of file tableviewer.cxx.
RowInfo const& rowInfo | ( | size_t | row | ) | const [inherited] |
get a copy of a specified row titles, etc.
row | The row to modify |
Definition at line 414 of file tableviewer.h.
size_t rows | ( | ) | const [inherited] |
return count of table rows
Definition at line 253 of file tableviewer.h.
void set_data_dirty | ( | bool | f | ) | [inherited] |
Set the 'unsaved modifications' flag.
f | defines the status of the dirty flag. |
See the function is_dirty().
Definition at line 608 of file tableviewer.h.
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.
void setColInfo | ( | size_t | col, | |
std::string const & | title, | |||
size_t | width, | |||
bool | border, | |||
bool | bold, | |||
bool | edit | |||
) | [inherited] |
Set the column header information.
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.
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.
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.
void setCursorInfo | ( | CursorWindow::viewport * | vp, | |
size_t | worldRow, | |||
size_t | worldCol, | |||
bool | displayed | |||
) | [protected, virtual] |
Superseed of base class version only for the purpose of detecting field changes so that edit sessions on fields can be terminated.
Reimplemented from TableViewer.
Reimplemented in CsvViewer.
Definition at line 569 of file tableeditor.cxx.
void setDisplayTitles | ( | bool | flag | ) | [inherited] |
Set the flag that controls the permanancy of the displaying of the row and column titles.
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.
row | is the row in the virtual world | |
col | is the column in hte virtual world |
Definition at line 443 of file tableviewer.h.
void setRowInfo | ( | size_t | row, | |
RowInfo const & | r | |||
) | [inherited] |
Set the titles and other row specific information givin a row.
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.
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.
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.
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.
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.
void setTextInputPointer | ( | size_t | vpRow, | |
size_t | vpCol | |||
) | [protected, inherited] |
Set the screen location where text cursor goes.
vpRow | is the viewport relative row | |
vpCol | is the viewport relative column |
Definition at line 707 of file tableviewer.h.
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.
void snatchEdit | ( | CursorWindow::viewport * | vp, | |
FileName const & | directory | |||
) | [protected] |
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.
[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.
void terminateInput | ( | ) | [protected] |
If the current cell has been edited, finish the editing process.
Definition at line 582 of file tableeditor.cxx.
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.
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] |
Definition at line 76 of file tableeditor.h.
size_t fieldEditColumn_ [private] |
Definition at line 47 of file tableeditor.h.
bool is_regex_ [protected, inherited] |
If true, use regular expression searches.
Definition at line 672 of file tableviewer.h.
bool keyKludge_ [protected] |
Reimplemented in ScriptTableViewer.
Definition at line 77 of file tableeditor.h.
LayoutType layout_ [protected, inherited] |
Definition at line 663 of file tableviewer.h.
ViewerManager* manager_ [protected, inherited] |
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.
Definition at line 665 of file tableviewer.h.
std::string search_text_ [protected, inherited] |
Text to search for ////////////////////////////////////////////////////////////////////////////////////.
Definition at line 674 of file tableviewer.h.