#include <Pt/Forms/ComboBoxStyler.h>
Binds a combo box to the current style renderer. More...
Inherits Styler.
Public Member Functions | |
| ComboBoxStyler () | |
| Constructs an unbound combo box styler. | |
| const Gfx::Brush & | background () const |
| Returns the effective text background brush. | |
| void | setBackground (const Gfx::Brush &brush) |
| Sets the widget-local text background brush to brush. | |
| const Gfx::Brush & | foreground () const |
| Returns the effective foreground brush. | |
| void | setForeground (const Gfx::Brush &brush) |
| Sets the widget-local foreground brush to brush. | |
| const Gfx::Pen & | contour () const |
| Returns the effective contour pen. | |
| void | setContour (const Gfx::Pen &pen) |
| Sets the widget-local contour pen to pen. | |
| const Gfx::Color & | textColor () const |
| Returns the effective text color. | |
| void | setTextColor (const Gfx::Color &color) |
| Sets the widget-local text color to color. | |
| Gfx::Font | font () const |
| Returns the effective font. | |
| void | setFont (const Gfx::Font &font) |
| Sets the widget-local font to font. | |
| void | setFontSize (std::size_t size) |
| Sets the widget-local font size to size. | |
| void | setFontWeight (Gfx::Font::Weight weight) |
| Sets the widget-local font weight to weight. | |
| void | setFontSlant (Gfx::Font::Slant slant) |
| Sets the widget-local font slant to slant. | |
| Gfx::SizeF | measureFrame (PaintSurface &surface, const Gfx::SizeF &contentSize) const |
| Measures the frame enclosing contentSize. | |
| void | layoutChrome (PaintSurface &surface, const Gfx::RectF &rect, Gfx::RectF &entryRect, Gfx::RectF &buttonRect, Gfx::RectF &textRect) const |
| Lays out combo box chrome within rect. | |
| const Painter * | textPainter (PaintSurface &surface) |
| Returns the painter configured for combo box text, or 0 if the styler is not bound. | |
| void | renderChrome (PaintContext &context, const Gfx::RectF &rect, const Gfx::RectF &entryRect, const Gfx::RectF &buttonRect, const ComboBoxState &state, const ComboBoxButtonState &buttonState) const |
| Renders combo box chrome for the supplied states. | |
| void | renderText (PaintContext &context, const Gfx::RectF &textRect, const String &text, const Gfx::PointF &textPos, const Gfx::RectF &cursor, const ComboBoxState &state) const |
| Renders text at textPos for state. | |
| void | setRenderer (ComboBoxRenderer *renderer=0) |
| Assigns a specific combo box renderer. | |
| StyleOptions & | options () |
| Returns the effective combo box options. | |
| const StyleOptions & | options () const |
| Returns the effective combo box options. | |
| bool | bind (const Style &style, const StyleOptions &styleOptions) |
| Binds this styler to style and styleOptions. | |
| bool | isBound () const |
| Returns true if a renderer is bound. | |
Protected Member Functions | |
| virtual StyleOptions & | onBindOptions (const StyleOptions &global) |
| Binds the overlay to global and returns it. | |
| virtual Renderer * | onStyleRenderer (const Style &style) |
| Returns the shared combo-box renderer from style, or 0. | |
| virtual Renderer * | onCreateRenderer (const Style &style) |
| Creates an independent clone of the style renderer, or 0. | |
| void | init (Renderer *renderer) |
| Replaces the bound renderer with renderer. | |
A ComboBox owns a ComboBoxStyler. Applications do not construct one. Call Styler::bind() from onInvalidate(). When the overlay has no local options, bind uses the shared renderer from the style. Local options use a private clone. setRenderer() keeps an assigned renderer until it is cleared. A null renderer falls back on the next bind.
Appearance getters return effective tokens after bind. Setters write widget-local options. Measure, layout, and paint call the typed methods on this styler, not a public renderer accessor.
| void setRenderer | ( | ComboBoxRenderer * | renderer = 0 | ) |
A null renderer falls back to the current style on the next bind.
|
inherited |
Returns true when the effective renderer or the effective options changed.
|
protectedinherited |
A non-null renderer is a custom renderer. bind() keeps it until init() is called with 0, which falls back to the current style.