4D v13.4OBJECT SET RGB COLORS |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
OBJECT SET RGB COLORS
OBJECT SET RGB COLORS
The OBJECT SET RGB COLORS command changes the foreground and background colors of the objects specified by the object parameter and the optional * parameter. When the command is applied to a List box object, an additional parameter lets you modify the alternating color of the rows. If you specify the optional * parameter, you indicate an object name (a string) in object. If you omit the optional * parameter, you indicate a field or a variable in object. In this case, you specify a field or variable reference (field or variable objects only) instead of a string. For more information about object names, see the section Object Properties. The optional altBackgrndColor parameter lets you set an alternate background color for even-numbered rows. This parameter is only used when the object specified is a List box or a column of the List box. When this parameter is used, the backgroundColor parameter is only used for odd-numbered rows. Using alternating colors makes lists easier to read. If object specifies a List box object, alternating colors are used for the entire List box. If object specifies a column of the List box, only the column will use the colors set. You indicate RGB color values in foregroundColor, backgroundColor and altBackgrndColor. An RGB value is a 4-byte Long Integer whose format (0x00RRGGBB) is described in the following table (bytes are numbered from 0 to 3, from right to left):
The following table shows some examples of RGB color values:
Alternatively, you can specify one of the “system” colors used by 4D for drawing objects whose colors are set automatically. The following predefined constants are provided by 4D:
These colors (on a standard system) are shown here: WARNING: These automatic colors are system dependent. If you change your system colors, 4D will adjust its automatic colors accordingly. Use the automatic color values for setting objects to the system colors, not for setting them to the example colors shown above. This form contains the two non-enterable variables vsColorValue and vsColor as well as the three thermometers: thRed, thGreen, and thBlue. Here are the methods for these objects: ` vsColorValue non-enterable Object Method The project method called by the three thermometers is: ` CLICK IN COLOR THERMOMETER Project Method Note the use of the Bitwise Operators for calculating the color value from the thermometer values. When executed, the form looks like this: Changing to transparent background with a light font color: OBJECT SET RGB COLORS(*;"myVar";Light shadow color;Background color none) |
PROPERTIES
Product: 4D
INDEX HISTORY
Modified: 4D 2004 SEE ALSO
Bitwise Operators |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||