Dynamic View Services > Implementing a Representation Model > Implementing a Table Representation Model > Graphic Class
 
Graphic Class
In this example, the graphic class is assumed to be a general matrix gadget that allows to add or remove columns and rows, as well as to get and set the cell value and row color, as shown in the code sample below.
Example
class MatrixGadget
{
MatrixGadget(char*label);
  void setLabel(char* label);
int addColumn(const char* header);
int addRow();
void removeColumn(int index);
void removeRow(int index);
  char* getCellString(int row,int col);
  void setCell(int row,int col,char* value);
  int getCellInt(int row,int col);
  void setCell(int row,int col,int value);
void setRowColor(int row,char* color);
};

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.