ListBoxRenderer Class Referenceabstract

#include <Pt/Forms/ListBoxStyler.h>

Renders the look of a list box. More...

Inherits Renderer.

Public Member Functions

 ListBoxRenderer (std::size_t refs=0)
 Constructs a renderer with reference count refs.
virtual ~ListBoxRenderer ()
 Destroys the renderer.
ListBoxRenderercreate () const
 Creates a new default-constructed instance that the caller owns.
Gfx::SizeF measureFrame (PaintSurface &surface, const Gfx::SizeF &contentSize)
 Returns the outer size including the frame for contentSize.
Gfx::RectF layoutFrame (PaintSurface &surface, const Gfx::RectF &rect)
 Returns the content rectangle within rect.
void renderBackground (PaintContext &context, const Gfx::RectF &rect, const ListBoxState &state)
 Paints the background for state.
void renderChrome (PaintContext &context, const Gfx::RectF &rect, const ListBoxState &state)
 Paints the frame for state.
const std::type_info & typeId () const
 Returns the dynamic type used as the registry key.
void ref ()
 Adds one reference.
std::size_t unref ()
 Removes one reference and returns the remaining count.
void reset (const StyleOptions &options)
 Resets this facet with options.

Protected Member Functions

virtual ListBoxRendereronCreate () const =0
 Creates a new instance of the same concrete type.
virtual void onReset (const StyleOptions &options)=0
 Resets this facet with options.
virtual Gfx::SizeF onMeasureFrame (PaintSurface &surface, const Gfx::SizeF &contentSize)=0
 Measures the frame enclosing contentSize.
virtual Gfx::RectF onLayoutFrame (PaintSurface &surface, const Gfx::RectF &rect)=0
 Returns the content rectangle within rect.
virtual void onRenderBackground (PaintContext &context, const Gfx::RectF &rect, const ListBoxState &state)=0
 Paints the background for state.
virtual void onRenderChrome (PaintContext &context, const Gfx::RectF &rect, const ListBoxState &state)=0
 Paints the frame for state.

Detailed Description

A ListBoxRenderer is a Style::Facet for the list-box family. Named measure methods run inside-out. Named layout methods run outside-in. Named render methods paint prepared rectangles. The widget owns geometry and orchestrates those passes. The renderer does not mutate widget geometry.

This renderer paints the list chrome. ListItemRenderer paints each item.

Derive a renderer to change the look of list boxes. Register it on a Style, or assign it to a widget with ListBox::setRenderer().

Member Function Documentation

◆ onReset()

virtual void onReset ( const StyleOptions & options)
protectedpure virtual

Resolves tokens from options and stores the painter and metric state used later by measure, layout, and render. Shared facets are reset when the application applies global options.

Reimplemented from Style::Facet.