23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In this dialog box (color settings for a touch button), the color variable refers to the two adjustable colors of the<br />

same group. The left−hand color defines the foreground color. The right−hand color defines the background<br />

color. This color information is read into the high byte and low byte of the color variable.<br />

The color variable must be a 16−bit UINT data type. From these 16 bits, 8 bits are used for the foreground color<br />

and 8 bits for the background color. In this way, 256 color shades are possible for both the foreground and<br />

background color.<br />

Bit<br />

No.<br />

Dec.<br />

Value<br />

Hex<br />

Value<br />

0−7 255 0x00FF Background<br />

8−15 65280 0xFF00 Foreground<br />

4.8.2.3 Application Possibilities<br />

Name Description<br />

The background color of the element is set with the lower 8 bits of the<br />

color variable. All 256 colors from the color palette of the current project<br />

can be used.<br />

Setting 255 is transparent, i.e. the corresponding area is not colored. This<br />

setting does not work with all fields and can only be used if the picture<br />

does not change after it is constructed.<br />

The foreground color of the element is set with the upper 8 bits of the<br />

color variable.<br />

It is not possible to cover all of the details of such an implementation in this section. Applications and concrete<br />

examples in C and Automation Basic can be found in the Tips and Tricks section.<br />

• 4.8.2.3.1 Using Static Texts as Status Indicators<br />

Status indicators can be easily displayed using the color variable and static texts.<br />

Introduction to <strong>Visual</strong> <strong>Components</strong> 2.3<br />

The application sets the color value for static text depending on the state of the option to be indicated. If<br />

the foreground and background are set to the same value, the surface will be displayed as one color.<br />

Otherwise, the text is displayed with the respective color.<br />

In this way, indicators such as 'Motor Off', 'Motor On', and 'Motor Error' can be implemented using<br />

simple color switching.<br />

360 4.8.2.3 Application Possibilities

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!