TableViewer

## class TableViewer : public Viewer

> table viewer class.

## Inheritance:

### Public Methods

  | TableViewer (Config *c, TableWindow *t) creation
  virtual | ~TableViewer () deletion
  void | SetTable (Table *t)
  virtual void | Initialize () create table of (defaultNumberOf)Rows x (defaultNumberOf)Columns.
  void | InitTable (unsigned rows, unsigned columns)
  void | SetVisible (bool b) Make all cells and lines (in)visible
  void | Draw () draw all cells and labels
  void | Undraw () erase all cells and labels
  bool | TextMode (CellText *c) start edit object initialized with c
  void | TextModeOff () stop edit object and update cell-text.
  void | KeyTyped (int x, int y, int key) key is pressed at (x,y)
  void | Select (int x, int y) button1 is pressed at (x,y)
  void | Adjust (int x, int y) button2 is pressed at (x,y)
  void | MovingPointer (int x, int y) mouse pointer moved to (x,y)
  Command* | Drag (int x, int y) button1 is dragged to (x,y)
  Command* | Connect (int x, int y) button2 is dragged to (x,y)
  Cell* | HitCell (int x, int y) return cell iff (x,y) is in cell,
  CellText* | HitCellText (int x, int y) return cell-text iff (x,y) is in text,
  LinePiece* | HitVLinePiece (int x, int y) return line iff (x,y) is on vertical line,
  LinePiece* | HitHLinePiece (int x, int y) return line iff (x,y) is on horizontal line,
  RowColumnLabel* | HitRowLabel (int x, int y) return row label iff (x,y) is in row-label,
  RowColumnLabel* | HitColumnLabel (int x, int y) return column label iff (x,y) is in column-label,
  int | HitRow (int x, int y) return rownr if (x,y) is in row,
  int | HitColumn (int x, int y) return colnr if (x,y) is in column,
  void | ShowRowColumnLabels (bool b)
  void | PrintRowColumnLabels (bool b)
  bool | IsShowRowColumnLabels () const
  bool | IsPrintRowColumnLabels () const
  void | RecomputeSizeCell (Cell *c) adapt cell size (row + column) to fit its cell text.
  void | UpdateText (Cell *c, const string *newtext) update the text in cell c.
  virtual void | MoveRow (CellRow *r, unsigned newpos) move row from oldpos to newpos.
  virtual void | MoveColumn (CellColumn *c, unsigned newpos) move column from oldpos to newpos.
  virtual void | AddRow (CellRow *c) add row to end of table.
  virtual void | AddColumn (CellColumn *c) add column to right of table.
  virtual void | InsertRow (CellRow *c) insert row into table (automatically shifting).
  virtual void | InsertColumn (CellColumn *c) insert column into table (automatically shifting)
  virtual void | DeleteRow (CellRow *c) delete row from table.
  virtual void | DeleteColumn (CellColumn *c) delete column from table.
  void | ResizeRow (CellRow *r, int newSize)
  void | ResizeColumn (CellColumn *c, int newSize)
  void | Move (const Point *delta) move entire table.
  CellRow* | GiveRow (unsigned r) return r-th row.
  CellColumn* | GiveColumn (unsigned c) return c-th column.
  void | GetSelectedRows (List<CellRow *> *r)
  void | GetSelectedColumns (List<CellColumn *> *c)
  void | GetEmptyRows (List<CellRow *> *r)
  void | GetEmptyColumns (List<CellColumn *> *c)
  void | DeselectAll ()
  void | SelectAll ()
  void | SelectCell (Cell *c)
  void | DeselectCell (Cell *c)
  void | SelectVector (CellVector *v)
  void | DeselectVector (CellVector *v)
  bool | IsAllSelected (CellVector *v)
  void | MoveSelection (int key)
  void | CalcSizeElements (Point &topLeft, Point &bottomRight)
  void | CalcSizeSelection (Point &topLeft, Point &bottomRight)
  void | UpdateMarginWidth (int newWidth)
  void | UpdateMarginHeight (int newHeight)
  void | UpdateDefaultRowHeight (int n)
  void | UpdateDefaultColumnWidth (int n)
  int | GetDefaultRowHeight () const
  int | GetDefaultColumnWidth () const
  unsigned | GetNumberOfColumns () const
  unsigned | GetNumberOfRows () const
  unsigned | GetDefaultNumberOfColumns () const
  unsigned | GetDefaultNumberOfRows () const
  TextAlign::Type | GetDefaultRowAlignment () const
  TextAlign::Type | GetDefaultColumnAlignment () const
  int | GetRowHeight (unsigned row)
  int | GetColumnWidth (unsigned column)
  const Point* | GetTopLeft () const
  int | GetWidth () const
  int | GetHeight () const
  int | GetMarginWidth () const
  int | GetMarginHeight () const
  Point | GetRowTopLeft (unsigned row)
  Point | GetColumnTopLeft (unsigned column)
  void | SetGrafport (Grafport *g)
  CellTextBuffer* | GetBuffer () const
  int | GetTopSelectionRow () return index of topmost selected row, or -1 if selection is empty.
  int | GetLeftSelectionColumn () return index of leftmost selected column, -1 if selection is empty.
  List <Cell *> * | GetSelection () const
  unsigned | NrSelected () const
  unsigned | GetCurrentRow () const
  unsigned | GetCurrentColumn () const
  void | SetCurrentRow (unsigned n)
  void | SetCurrentColumn (unsigned n)
  void | GetCells (List<Cell *> *cell, const string *s, bool sens, bool substring) get cell containing s as text (case sensitive, substring).
  Cell* | GetNextCell (const string *s, bool sens, bool substring) return the next cell containing s as text.
  void | SetDefaultColumnAlignment (TextAlign::Type a)
  void | SetDefaultRowAlignment (TextAlign::Type a)
  void | SetLineStyle (Side::Type side, LineStyle::Type style)
  void | SetDefaultNumberOfRows (unsigned)
  void | SetDefaultNumberOfColumns (unsigned)
  void | UpdateLineWidthSelection (unsigned wd)
  void | UpdateLineStyleSelection (LineStyle::Type l)
  void | UpdateTextAlignmentSelection (TextAlign::Type a)
  void | UpdateLineColorSelection (const string *color)
  void | UpdateTextColorSelection (const string *color)
  void | UpdateFillColorSelection (const string *color, FillStyle::Type f)
  void | SetDefaultFont (XFont *ft)
  void | UpdateFontSelection (int f, int s, int p) set font family, style, size (no update when value < 0).
  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 | WriteAttributes (OutputFile *f)
  void | WriteColumns (OutputFile *f)
  void | WriteRows (OutputFile *f)
  void | WriteSelection (OutputFile *f)

### Protected Methods

  List <CellRow *> * | GetRows () const
  List <CellColumn *> * | GetColumns () const
  void | SetDefaultColumnWidth (int w)
  void | SetDefaultRowHeight (int h)
  void | SetMarginWidth (int w)
  void | SetMarginHeight (int h)

### Inherited from Viewer:

### Public Fields

static const int MIN_LINE_WIDTH
static const int MAX_LINE_WIDTH

### Public Methods

Scaler* GetScaler() const
Command* GetLastCmd()
DrawWindow* GetMainWindow() const
Grafport* GetGrafport() const
Printer* GetPrinter() const
void SetPrinter(Printer *p)
NToggleListDialog* GetLineWidthDialog()
NToggleListDialog* GetLineStyleDialog()
NToggleListDialog* GetTextAlignmentDialog()
FontChooserDialog* GetFontChooserDialog()
FileSelectionDialog* GetPrintFileSelectionDialog()
ColorChooserDialog* GetColorChooserDialog()
int Scale(int x) const
Point Scale(const Point *p) const
int ScaleCorrect(int x) const
Point ScaleCorrect(const Point *p) const
void Undo()
void Redo()
void Refresh()
virtual void Redraw()
virtual void Activate()
virtual void Deactivate()
void SetDefaultLineWidth(unsigned d)
int GetDefaultLineWidth()
void UpdateLineWidth()
void DefaultLineWidth()
void ShowDefaultLineWidth()
void ShowConfigLineWidth()
void SetDefaultLineStyle(LineStyle::Type l)
LineStyle::Type GetDefaultLineStyle()
void UpdateLineStyle()
void DefaultLineStyle()
void ShowDefaultLineStyle()
void ShowConfigLineStyle()
void SetDefaultLineColor(const string *s)
const string* GetDefaultLineColor()
void SetDefaultTextColor(const string *s)
const string* GetDefaultTextColor()
void SetDefaultFillColor(const string *s)
const string* GetDefaultFillColor()
FillStyle::Type GetDefaultFillStyle() const
void SetDefaultFillStyle(FillStyle::Type l)
void UpdateLineColor()
void DefaultLineColor()
void ShowDefaultLineColor()
void ShowConfigLineColor()
void UpdateTextColor()
void DefaultTextColor()
void ShowDefaultTextColor()
void ShowConfigTextColor()
void UpdateFillColor()
void DefaultFillColor()
void ShowDefaultFillColor()
void ShowConfigFillColor()
XFont* GetDefaultFont() const
void SetDefaultFontAttributes(int f, int s, int p)
void UpdateFont()
void DefaultFont()
void ShowDefaultFont()
void ShowConfigFont()
XFont* GetFont(int family, int style, int size)
XFont* GetFont(const char *description)
void UpdateTextAlignment()
void DefaultTextAlignment()
void ShowDefaultTextAlignment()
void ShowConfigTextAlignment()
TextAlign::Type GetDefaultTextAlignment() const
void SetDefaultTextAlignment(TextAlign::Type a)
void EditText(int key)
bool IsAutoResize() const
void SetAutoResize(bool s)
bool IsInlineEdit() const
void SetInlineEdit(bool s)
bool IsPasting() const
void SetPasting(bool b)
bool IsZigZag() const
void SetZigZag(bool b)
bool IsEditing() const
void DoubleClick()
void DoFunctionKey(int)
void NewCommand(Command *newCmd)
void AbortCommand()
void ExecuteCommand()
void UndoCommand()
void RedoCommand()
void DeleteCommands()
void GetPageSize(double &width, double &height)
void Save(OutputFile *f)
bool Load(InputFile *f, double format)
bool Check(InputFile *f, double format)

### Protected Methods

void ClearGrafport()
InlineEditor* GetInlineEditor() const
void SetInlineEditor(InlineEditor *i)
void SetEditing(bool b)

## Documentation

> table viewer class.

`TableViewer(Config *c, TableWindow *t)`
  creation

`virtual ~TableViewer()`
  deletion

`void SetTable(Table *t)`

`virtual void Initialize()`
  create table of (defaultNumberOf)Rows x (defaultNumberOf)Columns.

`void InitTable(unsigned rows, unsigned columns)`

`void SetVisible(bool b)`
  Make all cells and lines (in)visible

`void Draw()`
  draw all cells and labels

`void Undraw()`
  erase all cells and labels

`bool TextMode(CellText *c)`
  start edit object initialized with c

`void TextModeOff()`
  stop edit object and update cell-text.

`void KeyTyped(int x, int y, int key)`
  key is pressed at (x,y)

`void Select(int x, int y)`
  button1 is pressed at (x,y)

`void Adjust(int x, int y)`
  button2 is pressed at (x,y)

`void MovingPointer(int x, int y)`
  mouse pointer moved to (x,y)

`Command* Drag(int x, int y)`
  button1 is dragged to (x,y)

`Command* Connect(int x, int y)`
  button2 is dragged to (x,y)

`Cell* HitCell(int x, int y)`
  return cell iff (x,y) is in cell,

`CellText* HitCellText(int x, int y)`
  return cell-text iff (x,y) is in text,

`LinePiece* HitVLinePiece(int x, int y)`
  return line iff (x,y) is on vertical line,

`LinePiece* HitHLinePiece(int x, int y)`
  return line iff (x,y) is on horizontal line,

`RowColumnLabel* HitRowLabel(int x, int y)`
  return row label iff (x,y) is in row-label,

`RowColumnLabel* HitColumnLabel(int x, int y)`
  return column label iff (x,y) is in column-label,

`int HitRow(int x, int y)`
  return rownr if (x,y) is in row,

`int HitColumn(int x, int y)`
  return colnr if (x,y) is in column,

`void ShowRowColumnLabels(bool b)`

`void PrintRowColumnLabels(bool b)`

`bool IsShowRowColumnLabels() const`

`bool IsPrintRowColumnLabels() const`

`void RecomputeSizeCell(Cell *c)`
  adapt cell size (row + column) to fit its cell text.

`void UpdateText(Cell *c, const string *newtext)`
  update the text in cell c.

`virtual void MoveRow(CellRow *r, unsigned newpos)`
  move row from oldpos to newpos.

`virtual void MoveColumn(CellColumn *c, unsigned newpos)`
  move column from oldpos to newpos.

`virtual void AddRow(CellRow *c)`
  add row to end of table.

`virtual void AddColumn(CellColumn *c)`
  add column to right of table.

`virtual void InsertRow(CellRow *c)`
  insert row into table (automatically shifting).

`virtual void InsertColumn(CellColumn *c)`
  insert column into table (automatically shifting)

`virtual void DeleteRow(CellRow *c)`
  delete row from table.

`virtual void DeleteColumn(CellColumn *c)`
  delete column from table.

`void ResizeRow(CellRow *r, int newSize)`

`void ResizeColumn(CellColumn *c, int newSize)`

`void Move(const Point *delta)`
  move entire table.

`CellRow* GiveRow(unsigned r)`
  return r-th row.

`CellColumn* GiveColumn(unsigned c)`
  return c-th column.

`void GetSelectedRows(List<CellRow *> *r)`

`void GetSelectedColumns(List<CellColumn *> *c)`

`void GetEmptyRows(List<CellRow *> *r)`

`void GetEmptyColumns(List<CellColumn *> *c)`

`void DeselectAll()`

`void SelectAll()`

`void SelectCell(Cell *c)`

`void DeselectCell(Cell *c)`

`void SelectVector(CellVector *v)`

`void DeselectVector(CellVector *v)`

`bool IsAllSelected(CellVector *v)`

`void MoveSelection(int key)`

`void CalcSizeElements(Point &topLeft, Point &bottomRight)`

`void CalcSizeSelection(Point &topLeft, Point &bottomRight)`

`void UpdateMarginWidth(int newWidth)`

`void UpdateMarginHeight(int newHeight)`

`void UpdateDefaultRowHeight(int n)`

`void UpdateDefaultColumnWidth(int n)`

`int GetDefaultRowHeight() const`

`int GetDefaultColumnWidth() const`

`unsigned GetNumberOfColumns() const`

`unsigned GetNumberOfRows() const`

`unsigned GetDefaultNumberOfColumns() const`

`unsigned GetDefaultNumberOfRows() const`

`TextAlign::Type GetDefaultRowAlignment() const`

`TextAlign::Type GetDefaultColumnAlignment() const`

`int GetRowHeight(unsigned row)`

`int GetColumnWidth(unsigned column)`

`const Point* GetTopLeft() const`

`int GetWidth() const`

`int GetHeight() const`

`int GetMarginWidth() const`

`int GetMarginHeight() const`

`Point GetRowTopLeft(unsigned row)`

`Point GetColumnTopLeft(unsigned column)`

`void SetGrafport(Grafport *g)`

`CellTextBuffer* GetBuffer() const`

`int GetTopSelectionRow()`
  return index of topmost selected row, or -1 if selection is empty.

`int GetLeftSelectionColumn()`
  return index of leftmost selected column, -1 if selection is empty.

`List <Cell *> * GetSelection() const`

`unsigned NrSelected() const`

`unsigned GetCurrentRow() const`

`unsigned GetCurrentColumn() const`

`void SetCurrentRow(unsigned n)`

`void SetCurrentColumn(unsigned n)`

`void GetCells(List<Cell *> *cell, const string *s, bool sens, bool substring)`
  get cell containing s as text (case sensitive, substring).

`Cell* GetNextCell(const string *s, bool sens, bool substring)`
  return the next cell containing s as text.

`void SetDefaultColumnAlignment(TextAlign::Type a)`

`void SetDefaultRowAlignment(TextAlign::Type a)`

`void SetLineStyle(Side::Type side, LineStyle::Type style)`

`void SetDefaultNumberOfRows(unsigned)`

`void SetDefaultNumberOfColumns(unsigned)`

`void UpdateLineWidthSelection(unsigned wd)`

`void UpdateLineStyleSelection(LineStyle::Type l)`

`void UpdateTextAlignmentSelection(TextAlign::Type a)`

`void UpdateLineColorSelection(const string *color)`

`void UpdateTextColorSelection(const string *color)`

`void UpdateFillColorSelection(const string *color, FillStyle::Type f)`

`void SetDefaultFont(XFont *ft)`

`void UpdateFontSelection(int f, int s, int p)`
  set font family, style, size (no update when value < 0).

`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 WriteAttributes(OutputFile *f)`

`void WriteColumns(OutputFile *f)`

`void WriteRows(OutputFile *f)`

`void WriteSelection(OutputFile *f)`

`List <CellRow *> * GetRows() const`

`List <CellColumn *> * GetColumns() const`

`void SetDefaultColumnWidth(int w)`

`void SetDefaultRowHeight(int h)`

`void SetMarginWidth(int w)`

`void SetMarginHeight(int h)`

Direct child classes:
  MatrixViewer

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de