TIPTOP--4GL color settings

Source: Internet
Author: User

Use the test system TIPTOP GP3.0

Color settings are divided into single color and single-head color settings:

1. Single color:
1. First define an array before the MAIN function
For example:

[Html]
DEFINE ga_color DYNAMIC ARRAY OF RECORD
C01 STRING, c02 STRING,
C03 STRING, c04 STRING,
C05 STRING, c06 STRING,
C07 STRING, c08 STRING,
C09 STRING, c10 STRING,
C11 STRING, c12 STRING
END RECORD
2. In the _ bp (p_ud) function:
# SetCellAttributes (attarr array of record)
# Defines decoration attributes for each cell. (define the attributes of each cell)
Before display # DISPLAY attributes set BEFORE
Call dialog. setCellAttributes (ga_color)
3. In the _ fill function
First CALL ga_color.clear () # Clear
Then, in FOREACH, judge and assign values (you can set multiple or one column)

[Html]
IF g_ta_gja [g_cnt]. tc_gja10> 5 AND g_ta_gja [g_cnt]. tc_gja10 <10 THEN
LET ga_color [g_cnt]. c01 = ""
LET ga_color [g_cnt]. c02 = ""
LET ga_color [g_cnt]. c03 = ""
LET ga_color [g_cnt]. c04 = ""
LET ga_color [g_cnt]. c05 = ""
LET ga_color [g_cnt]. c06 = ""
LET ga_color [g_cnt]. c07 = ""
LET ga_color [g_cnt]. c08 = ""
LET ga_color [g_cnt]. c09 = ""
LET ga_color [g_cnt]. c10 = "red"
LET ga_color [g_cnt]. c11 = ""
LET ga_color [g_cnt]. c12 = ""
Else if g_ta_gja [g_cnt]. tc_gja10> 10 THEN
LET ga_color [g_cnt]. c01 = ""
LET ga_color [g_cnt]. c02 = ""
LET ga_color [g_cnt]. c03 = ""
LET ga_color [g_cnt]. c04 = ""
LET ga_color [g_cnt]. c05 = ""
LET ga_color [g_cnt]. c06 = ""
LET ga_color [g_cnt]. c07 = ""
LET ga_color [g_cnt]. c08 = ""
LET ga_color [g_cnt]. c09 = ""
LET ga_color [g_cnt]. c10 = "blue"
LET ga_color [g_cnt]. c11 = ""
LET ga_color [g_cnt]. c12 = ""
ELSE
LET ga_color [g_cnt]. c01 = ""
LET ga_color [g_cnt]. c02 = ""
LET ga_color [g_cnt]. c03 = ""
LET ga_color [g_cnt]. c04 = ""
LET ga_color [g_cnt]. c05 = ""
LET ga_color [g_cnt]. c06 = ""
LET ga_color [g_cnt]. c07 = ""
LET ga_color [g_cnt]. c08 = ""
LET ga_color [g_cnt]. c09 = ""
LET ga_color [g_cnt]. c10 = "green blod"
LET ga_color [g_cnt]. c11 = ""
LET ga_color [g_cnt]. c12 = ""
END IF
END IF
For example:

 

 

Ii. Single Head color:
1. You can set the color in the screen file (per File) or 4gl file.
For example:
<1> set per file: gja02 = gja02, COLOR = GREEN; (color)
<2> set per file: ima26 = ima26, COLOR = red where ima26> 1000;
<3> set per file: DATEEDIT tc_gja03 = tc_gja03, COLOR = GREEN, REVERSE;
<4> [4gl File Settings] DISPLAY p_ima01 TO ima01 ATTRIBUTE (BOLD, GREEN)
<5> [4gl File Settings] display by name g_ima. * ATTRIBUTE (REVERSE, BOLD, GREEN)
<6> [4gl File Settings] CALL cl_set_comp_font_color ("ima01, ima02a", "RED ")
<7> set per file: GRID (fontpitch = FIXED)

Fontpitch: This attribute defines the font type of the character as a fixed or variable when the default font is used.
COLOR:
[PURPOSE]
The COLOR attribute defines the foreground color of the text displayed by a form element.
[Description]
1. color-name can be: BLACK, BLUE, CYAN, GREEN, MAGENTA, RED, WHITE, and YELLOW.
2. For backward compatibility, color-name can be combined with an intensity keyword: REVERSE, LEFT, BLINK, and UNDERLINE.

Color where:
[PURPOSE]
The color where attribute defines a condition to set the foreground color dynamically.
[Description]
1. color-name can be: BLACK, BLUE, CYAN, GREEN, MAGENTA, RED, WHITE, and YELLOW.
2. color-name can also be an intensity keyword: REVERSE, LEFT, BLINK, and UNDERLINE.
3. boolexpr defines a Boolean expression with a restricted syntax.
4. The Boolean expression is automatically evaluated at runtime to check when the color attribute must be set.

See the following images:

 

 

 

 

 

**************************************** **************************************** **************************************** ********************

==== Till good is better, but better best

==== "My efforts will not stop. Please wait !" My trying hard will go on! Please wait and see!

**************************************** **************************************** **************************************** ********************


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.