tsc_UiCell

This class represents one cell (one column of a tsc_UiTreeItem) in a tsc_UiTree.  A tsc_UiTreeItem may contain up to 10 cells, numbered from 0-9.

For more information about the appearance of a cell in a UI Tree, see tsc_UiTree.

Public Methods

tsc_UiCell ()
Constructs an empty cell object. 

tsc_UiCell (const tsc_UiCell& from)
Copy constructor makes a reference to the same cell. 

tsc_UiCell & operator= (const tsc_UiCell& from)
Makes a reference to the 'from' cell. 

void Text (const char *text)
Sets the text to be displayed. Text that extends beyond the right edge of the cell will be clipped.

void  Text (x_Code text)
Sets the text to be displayed. The string is into translated the current language and displayed.

tsc_String Text ()
Gets the displayed text.  If the text was supplied as an X-code, the translated string is returned. 

void Color (tsc_Color color)
Sets the colour of the text, defaults to Black. 

tsc_Color Color ()
Gets the text colour.  If colour has not been specified, returns Black.

void Align ( tsc_UiColumnAlign   align)
Sets the Alignment of the text. Defaults to the alignment for the column in the control. 

tsc_UiColumnAlign  Align ()
Gets the current text Alignment. 

void Width (int width)
The Width determines the width of the cell for this row only, and is given as a percentage of the control's total width.
If the values add to more than 100%, a horizontal scroll bar will appear.
The width may also be specified as any of the values in the  tsc_UiSpecialWidths enumeration.

int Width ()
Get the Width percentage. Does not return inherited values. 

void Image ( tsc_Image  image)
Set an image to display in the cell. Text in the cell will either overlay the image or be moved to the right of the image, depending on the value set by TextFloat() . 
If many cells are to contain the same image, it is far more efficient to create or load one image and store it on (for instance) the form object, and specify the same instance for all cells in which it is used.
The top left of the image is aligned with the top left corner of the displayed cell; any part of the image that falls outside the cell is clipped. Take care with auto-sizing of cells - the image width will also be taken into account when calculating the cell's width.

tsc_Image Image ()
Get the cell's image. This is a reference to the original image; changing (ie, drawing on) that image will modify the original and also the displayed image in the control.  The control must be refreshed by setting the image again.