QGrid
![]() |
![]() ![]() |
QG_SetCaptionStyle(areaRef; fontName; fontSize; textFace; textJust; foreColor; backColor):errorCode | |||
![]() |
areaRef | Longint | QGrid area reference |
![]() |
fontName | String255 | Font name |
![]() |
fontSize | Longint | Font size |
![]() |
textFace | Longint | Text style |
![]() |
textJust | Longint | Text justification |
![]() |
foreColor | Longint | Text foregroung color |
![]() |
backColor | Longint | Text backgroung color |
![]() |
error | Longint | Error result |
Sets the caption text appearance.
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
The rest of the parameters are used to set the caption text appearance. If no caption object is defined for the plug-in area, qg_NoCaptionErr error is returned.
Parameters fontName and fontSize specify the name and the size in points of the font.
Parameter textFace is the text style and it can be specified by combining (with addition or bitwise "or") the following 4D constants:
Constant | Value |
Plain | 0 |
Bold | 1 |
Italic | 2 |
Underline | 4 |
Outline | 8 |
Shadow | 16 |
Condensed | 32 |
Extended | 64 |
Parameter textJust specifies the text justification. QGrid defines the following constants:
qg_JustLeft | 1 | Left justified |
qg_JustCenter | 0 | Centered |
qg_JustRight | 2 | Right justified |
Parameters foreColor and backColor specify the foreground and background caption text color respectively. They must be expressed in 4D's RGB color notation (0x00RRGGBB - see SET RGB COLORS in 4D's documentation). Parameter backColor can also take the reserved value qg_NoFillColor, resulting to text drawing on a transparent background.
When command QG_SetCaptionStyle is not called for a caption object, QGrid uses the following default text style options:
MacOS | Windows | |
Font name: | Geneva MS | Sans Serif |
Size: | 9 | 12 |
Style: | Plain | Plain |
Justification: | Left | Left |
Foreground color: | Black | Black |
Background color: | White | White |
Example
C_LONGINT($err) C_TEXT($font) C_LONGINT($size;$face;$fJust;$fForeClr;$fBackClr) $font:="Times New Roman" $size:=10 $face:=Plain $fJust:=qg_JustLeft $fForeClr:=0x002266DD $fBackClr:=qg_NoFillColor $err:=QG_SetCaptionStyle (xGrid;$font;$size;$face;$fJust;$fForeClr;$fBackClr) If ($err # qg_noErr) ` Handle the error End if |
Related commands
QG_SetCellCaption | Setup a caption object for the area cells |
QG_GetCaptionStyle | Returns the current caption text appearance settings |