CheckBoxRenderer Class Referenceabstract

#include <Pt/Forms/CheckBoxStyle.h>

Renders the visual appearance of a check box widget. More...

Inherits Style::Facet.

Inherited by PlatinumCheckBoxRenderer.

Public Member Functions

CheckBoxRenderercreate () const
 Creates a new default-constructed instance that the caller owns.
 
void prepare (const StyleOptions &options, const CheckBoxStyleOptions &checkBoxOptions)
 Applies the widget-local check box style overrides to this renderer. More...
 
Gfx::SizeF measureIndicator (PaintSurface &surface)
 Returns the natural size of the check indicator on surface.
 
Gfx::SizeF measureContent (PaintSurface &surface, const Gfx::SizeF &indicatorSize, const Gfx::SizeF &textSize)
 Returns the combined content size for indicator and text.
 
Gfx::SizeF measureFrame (PaintSurface &surface, const Gfx::SizeF &contentSize)
 Returns the outer size including frame for the given content size.
 
Gfx::RectF layoutFrame (PaintSurface &surface, const Gfx::RectF &frameRect)
 Returns the content rectangle within the outer frame rect.
 
void layoutContent (PaintSurface &surface, const Gfx::RectF &contentRect, const Gfx::SizeF &indicatorSize, const Gfx::SizeF &textSize, Gfx::RectF &indicatorRect, Gfx::RectF &textRect)
 Partitions the content rect into indicator and text sub-rectangles.
 
Gfx::RectF layoutMnemonic (PaintSurface &surface, const String &text, const Gfx::PointF &textPos, const Gfx::FontMetrics &fontMetrics, String::size_type mnemonicIndex)
 Computes the underline rectangle for the mnemonic character.
 
const PaintertextPainter (PaintSurface &surface)
 Returns a painter with the current font and text color applied.
 
void renderChrome (PaintContext &context, const Gfx::RectF &rect, const Gfx::RectF &boxRect, const CheckBoxState &state)
 Draws the check indicator chrome within the widget rect.
 
void renderText (PaintContext &context, const Gfx::RectF &textRect, const String &text, const Gfx::PointF &pos, const CheckBoxState &state)
 Draws text at pos, clipped to the text rect.
 
void renderMnemonic (PaintContext &context, const Gfx::RectF &rect, const Gfx::RectF &mnemonic, const CheckBoxState &state)
 Draws the mnemonic underline within mnemonic, clipped to the widget rect.
 
void reset (const StyleOptions &options)
 Resets the facet to the given global style options.
 

Protected Member Functions

virtual void onReset (const StyleOptions &options)
 Resets the shared check box renderer to global defaults.
 

Detailed Description

Provides rendering primitives for the check indicator, label text, and mnemonic underline. Subclasses override the protected virtuals.

Member Function Documentation

◆ prepare()

void prepare ( const StyleOptions options,
const CheckBoxStyleOptions checkBoxOptions 
)

This is the explicit synchronization point for the check box slice.