Overview
TRender is the base class for all custom rendering shapes in TeeGrid. It provides the foundation for painting cells, headers, and other grid elements with custom visual representations.
The rendering system in TeeGrid includes specialized renderers like TFormatRender, TTextRender, TBooleanRender, TExpanderRender, and TProgressRender.
Unit: Tee.Renders.pas
Class Hierarchy
TRender Base Class
Methods
Paint
AData: Rendering data containing bounds, painter, data value, and row index
Hit
R: Rectangle boundsX,Y: Point coordinates
True if the point hits the render area
TRenderData Record
TheTRenderData record contains all information needed for rendering:
Methods
AsBoolean: Converts data to boolean valueClearData: Clears the data stringIsEmpty: Checks if data is empty
TFormatRender
Rectangle shape renderer with borders and format support.Properties
Borders
Format
Methods
HasFormat
True if format properties are assigned.
StrokeHeight
TTextRender
Rectangle renderer with text, margins, and alignment support.Properties
Margins
TextAlign
Trimming
Methods
CalcHeight
APainter: Painter instance for text measurementAText: Text to measure (optional)
TBooleanRender
Checkbox-style renderer for boolean values.Properties
Style
TBooleanRenderStyle.Check: Checkbox with checkmarkTBooleanRenderStyle.Text: Text representation (“True”/“False”)
CheckFormat
TExpanderRender
Expander renderer with plus/minus, triangle, or arrow styles.Properties
Style
TExpanderStyle.PlusMinus: Plus/minus symbolsTExpanderStyle.Triangle: Triangle shapesTExpanderStyle.Arrow: Arrow symbols
AlwaysExpand
ExpandFormat
ExpandLine
Events
OnCanExpand
OnExpand
OnGetExpanded
Methods
Expand
PaintLines
TProgressRender
Progress bar renderer showing percentage completion.Properties
Minimum
Maximum
Orientation
TOrientation.Horizontal: Left to right fillTOrientation.Vertical: Bottom to top fill
TPasswordRender
Text renderer that masks password characters. Example:TShapePainter Helper
Utility class for painting common shapes.Methods
Check
PlusMinus
Arrow.Down / Arrow.Right
Triangle.LeftRight / Triangle.TopBottom
Creating Custom Renderers
To create a custom renderer, inherit fromTRender or one of its descendants:
See Also
- TPainter - Abstract painter class for rendering
- TFormat - Formatting classes for styles and colors
- Custom Renderers Guide - How to create custom renderers
