#include <Fireworks/TableWidget/interface/FWTableCellRendererBase.h>
Public Member Functions | |
virtual void | buttonEvent (Event_t *iClickEvent, int iRelClickX, int iRelClickY) |
virtual void | draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight)=0 |
FWTableCellRendererBase () | |
virtual UInt_t | height () const =0 |
returns the minimum height of the cell to which the renderer is representing | |
virtual UInt_t | width () const =0 |
returns the minimum width of the cell to which the renderer is representing | |
virtual | ~FWTableCellRendererBase () |
Private Member Functions | |
FWTableCellRendererBase (const FWTableCellRendererBase &) | |
const FWTableCellRendererBase & | operator= (const FWTableCellRendererBase &) |
Description: base class for classes which handle drawing and interaction with cells in the table
Usage: Renderers do the actual drawing of data into the cell (via the 'draw' method) and can allow user interaction with a cell (via the 'buttonEvent' method). When drawing a cell in the table, FWTableWidget ask its held FWTableManagerBase for a FWTableCellRendererBase for that particular cell and then calls the 'draw' method. Similarly, when a mouse button is pressed while the cursor is in a particular cell, the FWTableWidget asks its held FWTableManagerBase for a FWTableCellRendererBase for that particular cell and then calls the 'buttonEvent' method. For efficiency reasons, we encourage the reuse of the same FWTableCellRendererBase instance for multiple cells. The FWTableWidget is written so that it always requests a renderer from the FWTableManagerBase thereby allowing this reuse to work even when the renderer holds state information particular for only one cell (e.g. color).
Classes which inherit from FWTableManagerBase are responsible for creating the appropriate FWTableCellRendererBase for the data held in the table's cells. When the FWTableWidget asks the FWTableManagerBase for a renderer for a particular cell, it is the FWTableManagerBase's job to reset the renderer so that it can properly draw and/or interact with that cell. To allow reuse of the same object, classes which inherit from FWTableCellRendererBase normally have 'setter' methods which are used to set the renderer so it can represent a particular cell.
One inherits from FWTableCellRendererBase in order to provide custom ways to view data in the cell or to customize how users interact with the cell. Inheritance can also be used to allow a renderer to work directly with data held by a FWTableManagerBase.
Definition at line 45 of file FWTableCellRendererBase.h.
FWTableCellRendererBase::FWTableCellRendererBase | ( | ) |
Definition at line 31 of file FWTableCellRendererBase.cc.
{ }
FWTableCellRendererBase::~FWTableCellRendererBase | ( | ) | [virtual] |
Definition at line 40 of file FWTableCellRendererBase.cc.
{ }
FWTableCellRendererBase::FWTableCellRendererBase | ( | const FWTableCellRendererBase & | ) | [private] |
void FWTableCellRendererBase::buttonEvent | ( | Event_t * | iClickEvent, |
int | iRelClickX, | ||
int | iRelClickY | ||
) | [virtual] |
Called when a mouse button event occurs when the cursor is over a particular cell: arguments iClickEvent: the ROOT GUI event caused by the mouse button iRelClickX: the x position of the cursor click relative to the start of the cell drawing area iRelClickY: the y position of the cursor click relative to the start of the cell drawing area
Reimplemented in FWCheckedTextTableCellRenderer.
Definition at line 60 of file FWTableCellRendererBase.cc.
Referenced by FWTabularWidget::HandleButton().
{}
virtual void FWTableCellRendererBase::draw | ( | Drawable_t | iID, |
int | iX, | ||
int | iY, | ||
unsigned int | iWidth, | ||
unsigned int | iHeight | ||
) | [pure virtual] |
Called to draw a particular cell: arguments iID: the id for the drawable in the window. Needed in order to do calls to gVirtualX or to TGFont iX: screen x position that the cell drawing area starts iY: screen y position that the cell drawing area starts iWidth: width (x dimension) of cell drawing area. May be larger than value returned from width() iHeight: height (x dimension) of cell drawing area. May be larger than value returned from height()
Implemented in FWGeometryTableManager::ColorBoxRenderer, FWCollectionSummaryModelCellRenderer, FWCheckedTextTableCellRenderer, FWColumnLabelCellRenderer, FWFramedTextTableCellRenderer, FWTextTableCellRenderer, and FWTextTreeCellRenderer.
Referenced by FWTabularWidget::DoRedraw().
virtual UInt_t FWTableCellRendererBase::height | ( | ) | const [pure virtual] |
returns the minimum height of the cell to which the renderer is representing
Implemented in FWGeometryTableManager::ColorBoxRenderer, FWFramedTextTableCellRenderer, and FWTextTableCellRenderer.
Referenced by FWTableManagerBase::cellHeight().
const FWTableCellRendererBase& FWTableCellRendererBase::operator= | ( | const FWTableCellRendererBase & | ) | [private] |
virtual UInt_t FWTableCellRendererBase::width | ( | ) | const [pure virtual] |
returns the minimum width of the cell to which the renderer is representing
Implemented in FWGeometryTableManager::ColorBoxRenderer, FWCollectionSummaryModelCellRenderer, FWCheckedTextTableCellRenderer, FWColumnLabelCellRenderer, FWFramedTextTableCellRenderer, FWTextTableCellRenderer, and FWTextTreeCellRenderer.
Referenced by FWTableManagerBase::maxWidthForColumns().