PeachBrackets

PeachBrackets.Annotations.FormFieldAppearance

FormFieldAppearance.PaintText(Canvas, Size, string, bool, Nullable<int>, bool) Method

Paints a single-line text (or combo-box) appearance: the border and background, then the value in the field’s real font and color, left aligned and vertically centered in the content box. With combCells, each character is instead centered in its own evenly divided cell (ISO 32000-1 §12.7.4.3’s “comb” field), with divider lines between cells in the field’s own border color and width.

public void PaintText(PeachDrawing.Core.Canvas g, PeachDrawing.Core.Size sizePt, string text, bool autoFontSize, System.Nullable<int> combCells, bool isPlaceholder);

Parameters

g Canvas

the canvas to paint onto, laid out at PixelsPerPoint

sizePt Size

the control’s size, in points

text System.String

what to draw

autoFontSize System.Boolean

whether the font is fitted to the control’s height

combCells System.Nullable<System.Int32>

the number of comb cells, or null for none

isPlaceholder System.Boolean

whether text is the placeholder hint

Remarks

isPlaceholder says the text is a placeholder hint rather than the value, in which case font, color and opacity come from the independently cascaded ::placeholder style. The text goes between BeginVariableText() and EndVariableText(), which is what makes a drawn hint safe: a reader regenerating the field replaces the whole sequence, so the hint disappears on the first keystroke instead of sitting behind what is typed.