Navigation: Language Reference > 9 - Window and Report Attributes > Window and Report Attributes >====== COLOR (set color) ====== | |
COLOR( color [, selected fore ] [, selected back ] )
COLOR | Specifies display or print color. |
color | Specifies the background color (PROP:Background or PROP:FillColor, equivalent to {PROP:Color,1}). Foreground color is specified in the FONT attribute. See also PROP:FILL |
selected fore | Specifies the default foreground color for the selected text on a control that can receive focus (PROP:SelectedColor, equivalent to {PROP:Color,2}). Not valid in a REPORT. |
selected back | Specifies the default background color for the selected text on a control that can receive focus (PROP:SelectedFillColor, equivalent to {PROP:Color,3}). Not valid in a REPORT. |
The COLOR attribute (PROP:COLOR) specifies the default background and selected foreground and background colors. This attribute is valid in Clarion Win32 Windows, and also for REPORT structures in both Clarion Win32 and Clarion#.
The color values in each of the three parameters are constants which contain the red, green, and blue components to create the color in the three low-order bytes of a LONG value (bytes 0, 1, and 2: Red = 000000FFh, Green = 0000FF00h, and Blue = 00FF0000h), or EQUATEs for a standard Windows color value (which are all negative values). EQUATEs for Windows' standard colors are contained in the EQUATES.CLW file. Each of the runtime properties returns COLOR:None if the associated parameter is absent. When COLOR:None is set, the runtime library uses the brush color in use by the parent container.
Windows automatically finds the closest match to the specified color value for the hardware on which the program is run. Windows standard colors may be reconfigured by the user in the Windows Control Panel. Any control using a Windows standard color is automatically repainted with the new color when this occurs.
WINDOW and TOOLBAR Usage
On a WINDOW or TOOLBAR, the COLOR attribute specifies the background display color of the WINDOW or TOOLBAR and the default background and selected foreground and background colors for all controls in the WINDOW or TOOLBAR without their own COLOR attribute.
A Sheet/Tab is a fully manifested control, so its color comes from the users OS settings. The COLOR attribute (or use of PROP:Color) is ignored in this case. If you want a colored tab with a manifest active, place a Box control on it and set the color, or simply use an Image control.
Window Control Usage
The COLOR attribute specifies the display color of a LINE control. On a BOX, ELLIPSE, or REGION control, the color parameter specifies the color used for the control's border. On all other controls, the color parameter specifies the background control color, overriding the user's standard Windows color scheme for that control type.
For most of those controls that can receive focus, the selected fore and selected back parameters specify the foreground and background colors of the selected text or item.
Report Usage
On a REPORT statement, the COLOR attribute specifies the background print color of the REPORT and the default background color for all DETAIL, HEADER, FOOTER, or FORM in the REPORT without a COLOR attribute.
The COLOR attribute specifies the background print color of the DETAIL, HEADER, FOOTER, or FORM on which it is placed, and the default background color for all controls in the DETAIL, HEADER, FOOTER, or FORM without a COLOR attribute.
The COLOR attribute specifies the print color of a LINE control, specifies the border color of a BOX or ELLIPSE control, or the background color of any other control.
Example:
WinOne WINDOW,AT(0,0,160,400),COLOR(00FF0000h,0000FF00h,000000FFh)
!Blue background, Green selected foreground, Red selected background
TOOLBAR,COLOR(00FF0000h,0000FF00h,000000FFh)
!Blue background, Green selected foreground, Red selected background
BOX,AT(20,20,20,20),COLOR(COLOR:ACTIVEBORDER) !Windows' active border color
END
BOX,AT(100,100,20,20),COLOR(00FF0000h) !Blue
BOX,AT(140,140,20,20),COLOR(0000FF00h) !Green
BOX,AT(180,180,20,20),COLOR(000000FFh) !Red
END
CustRpt REPORT,AT(1000,1000,6500,9000),THOUS,COLOR(00FF0000h) !Blue background
CustDetail DETAIL,AT(0,0,6500,1000)
ELLIPSE,AT(60,60,200,200),COLOR(COLOR:ACTIVEBORDER) !Color EQUATE
BOX,AT(360,60,200,200),COLOR(00FF0000h) !Pure Red
END
END
RptOne REPORT,AT(0,0,160,400),COLOR(00FF0000h) !Blue default background
HEADER,COLOR(0000FF00h) !Green page header background
!structure elements
END
CustD1 DETAIL !uses the default background color
!structure elements
END
FOOTER,COLOR(000000FFh) !Red page footer background
!structure elements
END
END
See Also: