| Methods Index |
CSubviewSubclass: None
CTableView is a view for displaying rows and columns of cells. It uses two helper classes: CTableCoordinates (internal) for performing transformations between cell space and screen space, and CTableAttributes for storing attributes on cells, rows, columns, and the table itself. CTableView is not intended to be used by itself (it provides no mouse or keyboard interaction), but to be incorporated in a higher level class such as CTable.
CTableView(
CSubview* theEnclosure,
const CRect& theRegion,
const CFont& theTableFont = STDFont,
UNITS theDefaultRowHeight = kNoHeight,
UNITS theDefaultColumnWidth = kNoWidth,
long theChunkRows = 128,
long theChunkColumns = 32);
virtual ~CTableView();
virtual BOOLEAN ITableView(
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY,
const CFont& theFont = STDFont);
virtual void Draw(const CRect& theClip);
Draw method is called whenever the table view must be redisplayed.
virtual void Size(const CRect& theNewSize);
Size method is called to resize the table view, including when CGlue behavior is controlling the resizing.
virtual void VScroll(SCROLL_CONTROL theEventType,
UNITS thePos);
virtual void HScroll(SCROLL_CONTROL theEventType,
UNITS thePos);
virtual void MouseDouble(
CPoint theLocation,
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);
MouseDown and MouseUp typically precede a MouseDouble, and a MouseUp typically follows.
virtual void MouseDown(
CPoint theLocation,
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);
MouseUp typically follows a MouseDown, though it may not due to user movement of the mouse.
theBounds should generally be (0,0)
virtual void SetTable(
CTableAttributes& theAttributes,
BOOLEAN thePropagate= FALSE);
CTableAttributes object to the CTableView and, optionally, its nested views. Invalidate the view to force redrawing.
virtual void AssociateScrollBars(
NScrollBar* theVScrollBar,
NScrollBar* theHScrollBar);
virtual void SetCellOrigin(const CCell& theCell);
virtual CCell GetCellOrigin() const;
virtual void SetPixelOrigin(const CPoint& thePoint);
virtual CPoint GetPixelOrigin() const;
virtual void SetCellBounds(const CBounds& theBounds);
virtual CBounds GetCellBounds() const;
virtual void SetCellClipping(BOOLEAN theClip);
virtual BOOLEAN GetCellClipping();
virtual void SetRow(long theRow, UNITS theHeight);
theRow is a zero-based index.
virtual void SetRow(
long theRow,
CTableAttributes& theAttributes,
BOOLEAN thePropagate = FALSE);
virtual void InsertRows(long theRow, long theCount = 1);
theRow.
virtual void DeleteRows(long theRow, long theCount = 1);
theRow.
virtual void SetColumn(long theColumn, UNITS theWidth);
theColumn is a zero-based index.
virtual void SetColumn(
long theColumn,
CTableAttributes& theAttributes,
BOOLEAN thePropagate= FALSE);
virtual void InsertColumns(long theColumn,
long theCount = 1);
theColumn.
virtual void DeleteColumns(long theColumn,
long theCount = 1);
theColumn.
virtual void SetCell(
const CCell& theCell,
CTableAttributes& theAttributes);
virtual void SetFocus(const CCell* theCell);
FocusOut on the cell's interpreter, then InvalidateCell on the cell to allow it to redraw in an unfocused appearance. Next, CanFocus is called on the interpreter of the cell which is to gain focus. If this cell can gain focus, then FocusIn is called on its interpreter and InvalidateCell is called on the cell to allow it to redraw in a focused state.
virtual const CCell* GetFocus() const;
virtual void InvalidateRow(long theRow);
theRow.
virtual void InvalidateColumn(long theColumn);
theColumn.
virtual void InvalidateCell(const CCell& theCell);
theCell.
virtual void InvalidateBounds(const CBounds& theBounds);
theBounds.
virtual void InvalidateRegion(const CRegion& theRegion);
theBounds.
virtual void InvalidateSelection();
virtual void CellToParameters(
const CCell& theCell,
CTableInterpreterParameters* theParameters);
theParameters point to static storage and are overwritten with each call. theParameters->itsContext is not set and should be initialized before calling an interperter on this parameters object.
virtual void CellToAttributes(
const CCell& theCell,
CTableAttributes* theAttributes);
const CTableAttributeArray& GetAttributes() const; CTableAttributeArray& GetAttributes();
CTableAttributeArray for the table.
const CTableCoordinates GetCoordinates() const; CTableCoordinates& GetCoordinates();
CTableCoordinates for the table.
virtual void SetSource(CTableSource* theSource);
CTableSource for the table view. theSource will not be deleted by the table view destructor.
virtual CTableSource* GetSource(); virtual const CTableSource* GetSource() const;
virtual const CTdiValue* GetData(const CCell& theCell);
virtualBOOLEAN PutData(
const CCell& theCell,
const CTdiValue* theData);
BOOLEAN IsFlushRight() const; BOOLEAN IsFlushBottom() const;
virtual void ChangeDrawingContext(
CDrawingContext* theDrawingContext,
CTableAttributes& theAttributes);
virtual void DrawColumnBackground(
long theColumn,
long theFirstRow,
long theLastRow,
CTableAttributes* theAttributes);
theColumn and the top of theFirstRow to the right edge of theColumn and the bottom of theLastRow.
virtual void DrawRowBackground(
long theRow,
long theFirstColumn,
long theLastColumn,
CTableAttributes* theAttributes);
theRow and the left edge of theFirstColumn to the bottom of theRow and the right edge of theLastColumn.
virtual void DrawColumn(
const CRect& theClip,
long theColumn,
long theFirstRow,
long theLastRow,
CTableAttributes* theColumnAttributes,
CTableAttributes* theRowAttributes);
theFirstRow through theLastRow. If any cells in the column have individual CTableAttributes objects, the individual cell object is merged with the supplied column and row attributes objects to form a merged set of attributes before drawing the cell content.
virtual CCell OriginWithinBounds(
const CCell& aProposedOrigin,
CPoint* theOffset = NULL);
virtual void AdjustVScrollBar(); virtual void AdjustHScrollBar();
CTableView(const CTableView& theTable); CTableView& operator=(const CTableView& theTable);