32 #ifndef ITEMRENDERER_H_
33 #define ITEMRENDERER_H_
37 #include "../redrawlistener.h"
38 #include "viewvalue.h"
113 virtual unsigned int width(
unsigned int index)
const = 0;
118 virtual unsigned int height(
unsigned int index)
const = 0;
198 virtual void render(
const ItemRenderer::Info &info);
206 virtual unsigned int width(
unsigned int index)
const;
213 virtual unsigned int height(
unsigned int index)
const {
return 40;}
220 virtual Size size(
unsigned int index)
const;
246 virtual void render(
const ItemRenderer::Info &info);
251 virtual unsigned int width(
unsigned int index)
const;
256 virtual unsigned int height(
unsigned int index)
const;
261 virtual Size size(
unsigned int index)
const;
Information on what needs to be redrawn.
Definition: itemrenderer.h:64
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
virtual Size size(unsigned int index) const =0
Called to get the size of the item.
virtual void render(const ItemRenderer::Info &info)
Render text in black using current wimp font.
Definition: itemrenderer.cc:43
const tbx::RedrawEvent & redraw
Redraw event object from FixedCellView.
Definition: itemrenderer.h:68
virtual void render(const ItemRenderer::Info &info)
Render the sprite to the screen.
Definition: itemrenderer.cc:84
virtual Size size(unsigned int index) const
Called to get the size of the cell.
Definition: itemrenderer.cc:76
Info(const tbx::RedrawEvent &r)
Construct from Redraw event.
Definition: itemrenderer.h:95
unsigned int index
zero based index of item to redraw
Definition: itemrenderer.h:83
Base class to provide a value of a given type for an item view.
Definition: viewvalue.h:40
virtual unsigned int height(unsigned int index) const
Wimp font height is always 40.
Definition: itemrenderer.h:213
Common base class for the UserSprite and WimpSprite classes.
Definition: sprite.h:301
virtual unsigned int width(unsigned int index) const
Used to measure the width of a column.
Definition: itemrenderer.cc:93
TypedItemRenderer(ItemViewValue< T > *vp)
Construct the item view renderer.
Definition: itemrenderer.h:169
virtual void render(const ItemRenderer::Info &info)=0
Called to render each item that needs drawing.
ItemViewValue< T > * _value_provider
Object to retrieve the value for a rendered.
Definition: itemrenderer.h:162
virtual unsigned int height(unsigned int index) const =0
Used to measure the height of column.
Renderer base class to put text in a cell using the current wimp font.
Definition: itemrenderer.h:179
Class to represent a two dimensional bounding box.
Definition: bbox.h:38
WimpFontItemRenderer(ItemViewValue< std::string > *vv)
Construct with object to give value to render.
Definition: itemrenderer.h:186
Class to represent a two-dimensional size.
Definition: size.h:35
SpriteItemRenderer(ItemViewValue< tbx::Sprite * > *vv)
Construct with object to give value to render.
Definition: itemrenderer.h:238
virtual Size size(unsigned int index) const
Called to get the size of the cell.
Definition: itemrenderer.cc:111
Class to represent a position in two dimensional space.
Definition: point.h:37
bool selected
Is the item selected.
Definition: itemrenderer.h:88
Base class to render an indexed item.
Definition: itemrenderer.h:54
virtual bool hit_test(unsigned int index, const Size &size, const Point &pos) const
Check if the point given hits content of the cell rather then a margin or background.
Definition: itemrenderer.h:138
tbx::Point screen
Bottom left of items bounding box in screen coordinates.
Definition: itemrenderer.h:78
virtual bool intersects(unsigned int index, const Size &size, const BBox &box) const
Check if the given rectangle intersects the content of the cell rather than a margin or background.
Definition: itemrenderer.h:151
virtual unsigned int width(unsigned int index) const =0
Used to measure the width of a column.
Event passed to redraw listener to give details on the area that needs a redraw.
Definition: redrawlistener.h:44
virtual unsigned int height(unsigned int index) const
Used to measure the height.
Definition: itemrenderer.cc:102
virtual unsigned int width(unsigned int index) const
Used to measure the width of a column.
Definition: itemrenderer.cc:64
tbx::BBox bounds
Bounding box of cell to redraw in work area coordinates.
Definition: itemrenderer.h:73
Item renderer to render a sprite in a cell.
Definition: itemrenderer.h:231
Base class for item renderer that work on a specific type and use an ItemViewValue object to return t...
Definition: itemrenderer.h:160