bgiSetRichTextFormat

Sets text formatting (bold, italic, color, font, size) for rich text. Takes richTextBoxID (Int), bold (Int), italic (Int), underline (Int), fontSize (Int), fontName (String), colourR (Int), colourG (Int), and colourB (Int). Returns 1 on success, 0 if rich text box not found.

BGI GUI

Parameters & Returns

Parameters

richTextBoxID Int
bold Int
italic Int
underline Int
fontSize Int
fontName String
colourR Int
colourG Int
colourB Int

Returns

Int

Quick Summary

Sets text formatting (bold, italic, color, font, size) for rich text. Takes richTextBoxID (Int), bold (Int), italic (Int), underline (Int), fontSize (Int), fontName (String), colourR (Int), colourG (Int), and colourB (Int). Returns 1 on success, 0 if rich text box not found.

Technical Exegesis...

Sets text formatting attributes for a rich text box control. Searches gizmoMap for the rich text box ID. Creates CHARFORMATW structure with CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_SIZE | CFM_FACE | CFM_COLOR mask. Sets bold/italic/underline effects based on non-zero parameters (CFE_BOLD, CFE_ITALIC, CFE_UNDERLINE). Converts fontSize to twips (1 point = 20 twips), defaults to 10pt if zero or negative. Converts fontName from UTF-8 to wide string, defaults to Arial if empty.

Example

Example.bam
; No example implemented yet