Logo Search packages:      
Sourcecode: tcm version File versions  Download package

TableViewer Class Reference

#include <tableviewer.h>

Inheritance diagram for TableViewer:

Viewer MatrixViewer FEViewer TDViewer TUViewer

List of all members.

Detailed Description

table viewer class.

Definition at line 56 of file tableviewer.h.

Public Member Functions

void AbortCommand ()
 abort execution of last command.
virtual void Activate ()
 show that viewer is active.
virtual void AddColumn (CellColumn *c)
 add column to right of table.
virtual void AddRow (CellRow *c)
 add row to end of table.
void Adjust (int x, int y)
 button2 is pressed at (x,y)
void CalcSizeElements (Point &topLeft, Point &bottomRight)
 calculate covered area of elements in grafport.
void CalcSizeSelection (Point &topLeft, Point &bottomRight)
 calculate covered area of selected elements in grafport.
bool Check (InputFile *f, double format)
 Check but not load view attributes from file.
CommandConnect (int x, int y)
 button2 is dragged to (x,y)
virtual void Deactivate ()
 show that viewer is not active.
void DefaultFillColor ()
void DefaultFont ()
void DefaultLineColor ()
void DefaultLineStyle ()
void DefaultLineWidth ()
void DefaultTextAlignment ()
void DefaultTextColor ()
virtual void DeleteColumn (CellColumn *c)
 delete column from table.
void DeleteCommands ()
 delete command history, make undo impossible.
virtual void DeleteRow (CellRow *c)
 delete row from table.
void DeselectAll ()
 deselect all elements in viewer;
void DeselectCell (Cell *c)
void DeselectVector (CellVector *v)
void DoFunctionKey (int)
 not yet implemented (function keys).
void DoubleClick ()
 not yet implemented (double clicked button).
CommandDrag (int x, int y)
 button1 is dragged to (x,y)
void Draw ()
 draw all cells and labels
void EditText (int key)
void ExecuteCommand ()
 execute last command.
CellTextBufferGetBuffer () const
void GetCells (List< Cell * > *cell, const string *s, bool sens, bool substring)
 get cell containing s as text (case sensitive, substring).
ColorChooserDialogGetColorChooserDialog ()
Point GetColumnTopLeft (unsigned column)
int GetColumnWidth (unsigned column)
unsigned GetCurrentColumn () const
unsigned GetCurrentRow () const
TextAlign::Type GetDefaultColumnAlignment () const
int GetDefaultColumnWidth () const
const stringGetDefaultFillColor ()
FillStyle::Type GetDefaultFillStyle () const
XFontGetDefaultFont () const
const stringGetDefaultLineColor ()
LineStyle::Type GetDefaultLineStyle ()
int GetDefaultLineWidth ()
unsigned GetDefaultNumberOfColumns () const
unsigned GetDefaultNumberOfRows () const
TextAlign::Type GetDefaultRowAlignment () const
int GetDefaultRowHeight () const
TextAlign::Type GetDefaultTextAlignment () const
const stringGetDefaultTextColor ()
void GetEmptyColumns (List< CellColumn * > *c)
void GetEmptyRows (List< CellRow * > *r)
XFontGetFont (const char *description)
XFontGetFont (int family, int style, int size)
FontChooserDialogGetFontChooserDialog ()
GrafportGetGrafport () const
int GetHeight () const
CommandGetLastCmd ()
int GetLeftSelectionColumn ()
 return index of leftmost selected column, -1 if selection is empty.
NToggleListDialogGetLineStyleDialog ()
NToggleListDialogGetLineWidthDialog ()
DrawWindowGetMainWindow () const
int GetMarginHeight () const
int GetMarginWidth () const
CellGetNextCell (const string *s, bool sens, bool substring)
 return the next cell containing s as text.
unsigned GetNumberOfColumns () const
unsigned GetNumberOfRows () const
void GetPageSize (double &width, double &height)
 return page size (pixels).
PrinterGetPrinter () const
FileSelectionDialogGetPrintFileSelectionDialog ()
int GetRowHeight (unsigned row)
Point GetRowTopLeft (unsigned row)
ScalerGetScaler () const
void GetSelectedColumns (List< CellColumn * > *c)
void GetSelectedRows (List< CellRow * > *r)
List< Cell * > * GetSelection () const
NToggleListDialogGetTextAlignmentDialog ()
const PointGetTopLeft () const
int GetTopSelectionRow ()
 return index of topmost selected row, or -1 if selection is empty.
int GetWidth () const
CellColumnGiveColumn (unsigned c)
 return c-th column.
CellRowGiveRow (unsigned r)
 return r-th row.
CellHitCell (int x, int y)
 return cell iff (x,y) is in cell,
CellTextHitCellText (int x, int y)
 return cell-text iff (x,y) is in text,
int HitColumn (int x, int y)
 return colnr if (x,y) is in column,
RowColumnLabelHitColumnLabel (int x, int y)
 return column label iff (x,y) is in column-label,
LinePieceHitHLinePiece (int x, int y)
 return line iff (x,y) is on horizontal line,
int HitRow (int x, int y)
 return rownr if (x,y) is in row,
RowColumnLabelHitRowLabel (int x, int y)
 return row label iff (x,y) is in row-label,
LinePieceHitVLinePiece (int x, int y)
 return line iff (x,y) is on vertical line,
virtual void Initialize ()
 create table of (defaultNumberOf)Rows x (defaultNumberOf)Columns.
void InitTable (unsigned rows, unsigned columns)
virtual void InsertColumn (CellColumn *c)
 insert column into table (automatically shifting)
virtual void InsertRow (CellRow *c)
 insert row into table (automatically shifting).
bool IsAllSelected (CellVector *v)
bool IsAutoResize () const
bool IsEditing () const
bool IsInlineEdit () const
bool IsPasting () const
bool IsPrintRowColumnLabels () const
bool IsShowRowColumnLabels () const
bool IsZigZag () const
void KeyTyped (int x, int y, int key)
 key is pressed at (x,y)
bool Load (InputFile *f, double format)
 Load view attributes from file.
void Move (const Point *delta)
 move entire table.
virtual void MoveColumn (CellColumn *c, unsigned newpos)
 move column from oldpos to newpos.
virtual void MoveRow (CellRow *r, unsigned newpos)
 move row from oldpos to newpos.
void MoveSelection (int key)
void MovingPointer (int x, int y)
 mouse pointer moved to (x,y)
void NewCommand (Command *newCmd)
 enable execution of last command as newCmd.
unsigned NrSelected () const
void PrintRowColumnLabels (bool b)
bool ReadAttributes (InputFile *f, bool appending, unsigned &rowsToAdd, unsigned &columnsToAdd, double format)
bool ReadColumns (InputFile *f, unsigned nr, unsigned fromRow, unsigned fromColumn, double format)
bool ReadRows (InputFile *f, unsigned nr, unsigned fromRow, unsigned fromColumn, double format)
void RecomputeSizeCell (Cell *c)
 adapt cell size (row + column) to fit its cell text.
void Redo ()
 Redo last command.
void RedoCommand ()
 redo execution of last command.
virtual void Redraw ()
 redraw contents of grafport.
void Refresh ()
 Clear grafport contents, and redraw all viewer elements.
void ResizeColumn (CellColumn *c, int newSize)
void ResizeRow (CellRow *r, int newSize)
void Save (OutputFile *f)
 Save view attributes to file.
Point Scale (const Point *p) const
double Scale (double x) const
 forwarding to scaler object.
Point ScaleCorrect (const Point *p) const
double ScaleCorrect (double x) const
void Select (int x, int y)
 button1 is pressed at (x,y)
void SelectAll ()
void SelectCell (Cell *c)
void SelectVector (CellVector *v)
void SetAutoResize (bool s)
void SetCurrentColumn (unsigned n)
void SetCurrentRow (unsigned n)
void SetDefaultColumnAlignment (TextAlign::Type a)
void SetDefaultFillColor (const string *s)
void SetDefaultFillStyle (FillStyle::Type l)
void SetDefaultFont (XFont *ft)
void SetDefaultFontAttributes (int f, int s, int p)
void SetDefaultLineColor (const string *s)
void SetDefaultLineStyle (LineStyle::Type l)
void SetDefaultLineWidth (unsigned d)
void SetDefaultNumberOfColumns (unsigned)
void SetDefaultNumberOfRows (unsigned)
void SetDefaultRowAlignment (TextAlign::Type a)
void SetDefaultTextAlignment (TextAlign::Type a)
void SetDefaultTextColor (const string *s)
void SetGrafport (Grafport *g)
void SetInlineEdit (bool s)
void SetLineStyle (Side::Type side, LineStyle::Type style)
void SetPasting (bool b)
void SetPrinter (Printer *p)
void SetTable (Table *t)
void SetVisible (bool b)
 Make all cells and lines (in)visible.
void SetZigZag (bool b)
void ShowConfigFillColor ()
void ShowConfigFont ()
void ShowConfigLineColor ()
void ShowConfigLineStyle ()
void ShowConfigLineWidth ()
void ShowConfigTextAlignment ()
void ShowConfigTextColor ()
void ShowDefaultFillColor ()
void ShowDefaultFont ()
void ShowDefaultLineColor ()
void ShowDefaultLineStyle ()
void ShowDefaultLineWidth ()
void ShowDefaultTextAlignment ()
void ShowDefaultTextColor ()
void ShowRowColumnLabels (bool b)
 TableViewer (Config *c, TableWindow *t)
bool TextMode (CellText *c)
 start edit object initialized with c
void TextModeOff ()
 stop edit object and update cell-text.
void Undo ()
 Undo last command.
void UndoCommand ()
 undo execution of last command.
void Undraw ()
 erase all cells and labels
void UpdateDefaultColumnWidth (int n)
void UpdateDefaultRowHeight (int n)
void UpdateFillColor ()
void UpdateFillColorSelection (const string *color, FillStyle::Type f)
void UpdateFont ()
void UpdateFontSelection (int f, int s, int p)
 set font family, style, size (no update when value < 0).
void UpdateLineColor ()
void UpdateLineColorSelection (const string *color)
void UpdateLineStyle ()
void UpdateLineStyleSelection (LineStyle::Type l)
void UpdateLineWidth ()
void UpdateLineWidthSelection (unsigned wd)
void UpdateMarginHeight (int newHeight)
void UpdateMarginWidth (int newWidth)
void UpdateText (Cell *c, const string *newtext)
 update the text in cell c.
void UpdateTextAlignment ()
void UpdateTextAlignmentSelection (TextAlign::Type a)
void UpdateTextColor ()
void UpdateTextColorSelection (const string *color)
void WriteAttributes (OutputFile *f)
void WriteColumns (OutputFile *f)
void WriteRows (OutputFile *f)
void WriteSelection (OutputFile *f)
virtual ~TableViewer ()

Static Public Attributes

static const int MAX_LINE_WIDTH = 10
static const int MIN_LINE_WIDTH = 1

Protected Member Functions

void ClearGrafport ()
 Clear contents of grafport.
List< CellColumn * > * GetColumns () const
InlineEditorGetInlineEditor () const
List< CellRow * > * GetRows () const
void SetDefaultColumnWidth (int w)
void SetDefaultRowHeight (int h)
void SetEditing (bool b)
void SetInlineEditor (InlineEditor *i)
void SetMarginHeight (int h)
void SetMarginWidth (int w)

Private Member Functions

void DeleteCells ()
bool GoIntoTextMode (Cell *cell)

Private Attributes

 a cut buffer for storing cell texts;
List< CellColumn * > * columns
 a list of columns
unsigned currentColumn
unsigned currentRow
TextAlign::Type defaultColumnAlignment
 each newly created clm is aligned like this
int defaultColumnWidth
 each newly created column has this width.
unsigned defaultNumberOfColumns
 each newly created row/column get this number of cells.
unsigned defaultNumberOfRows
 when there are no other rows/columns yet.
TextAlign::Type defaultRowAlignment
 each newly created row is aligned like this.
int defaultRowHeight
 each newly created row has this height.
Point defaultTopLeft
int height
 the height of all cells + row or column labels.
int marginHeight
 minimal distance between text and row boundaries.
int marginWidth
 minimal distance between text and column boundaries.
bool printRowColumnLabels
List< CellRow * > * rows
 a list of rows (List is user-defined ADT).
 the current selection.
bool showRowColumnLabels
Point topLeft
 the topleft position of the table.
int width
 the width of all cells + row or column labels.

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

Generated by  Doxygen 1.6.0   Back to index