[Classes] [Prev] [Next] [Methods]

CTablePictureInterpreter

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Methods Unique to Picture Views.
Protected Methods

CTablePictureInterpreter


Heritage

Superclass: CTableViewInterpreter (internal class)

Subclasses: None


Description

This class provides an interpreter for placing pictures (images) in table cells.


Usage

Table interpreters handle the display of data within a table cell and user interaction with the cell and its data. By default, the table installs a text interpreter. To associate a different type of display (such as a control) to a cell or set of cells, you must create the appropriate interpreter and set it as an attribute on the desired cell, row, column, or table as a whole.

The CTablePictureInterpreter uses text-based data to select an image for display within a cell. Any number of images may be registered for display with the interpreter along with the string key value. If the cell contains data equal to one of the string keys, the interpreter displays the associated images, otherwise it displays the special default image. The interpreter does not delete the images passed to it: you must delete them after they have been passed to the interpreter. The interpreter extracts a pixmap from the image and does not need any further access to the original images.

CTableAttributes anAttributesSet;
CTablePictureInterpreter* anInterpreter =
new CTablePictureInterpreter(
myTable->GetTableView() // Owner
)
anInterpreter->AddDefaultImage(CImage("knownot.gif" ));
anInterpreter->AddImage(CImage("yes.gif"), "yes");
anInterpreter->AddImage( CImage( "no.gif" ), "no" );
anAttributesSet.Interpreter( anInterpreter );
myTable->SetColumn(3, anAttributesSet);

Protected Data Members

RWHashDictionary itsImages; A list of images and their associated string keys
XVT_PIXMAP itsDefaultImage; The default image
BOOLEAN itsResizeToFit; Whether to stretch image to fit the cell.


Public Methods

CTablePictureInterpreter(CTableView* theTable);

Methods Unique to Picture Views.

void AddImage(const CImage& theImage, 
const CStringRW& theKey);
void AddDefaultImage(const CImage& theImage);
void ResizeToFitCell(BOOLEAN theResizeToFit);
BOOLEAN ResizeToFitCell() const;
virtual CCellView* CreateCellView(
CTableView* theTable,
const CTableInterpreterParameters& theParameters,
const CTdiValue* theData);

Protected Methods

virtual ~CTablePictureInterpreter();
XVT_PIXMAP FindImage(const CStringRW& theKey) const;
virtual XVT_PIXMAP GetPixmapFromImage(
const CWindow& theWindow,
const CImage &theImage);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.