TIPTOP——4GL颜色相关设置
使用测试tiptop gp3.0
颜色的设置分为单身颜色和单头颜色的设置:
一、单身颜色:
1.首先main函数之前定义一个数组
例如:
[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._bp(p_ud) 函数里面:
##setcellattributes( attarr array of record )
##defines decoration attributes for each cell. (定义每个单元格的属性)
before display ##显示之前设置属性
call dialog.setcellattributes(ga_color)
3._fill函数里面
首先 call ga_color.clear() #清空
然后 foreach 里面 判断并赋值(可以对多个栏位,也可以是某一个栏位)
[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
效果图如下图片:
二、单头颜色:
1.可以直接在画面档(per档)或者4gl档里面设置颜色
例如:
<1>【per档设置】gja02 = gja02,color=green;(color)
<2>【per档设置】ima26 = ima26,color = red where ima26>1000;
<3>【per档设置】dateedit tc_gja03 = tc_gja03,color=green,reverse;
<4>【4gl档设置】display p_ima01 to ima01 attribute(bold,green)
<5>【4gl档设置】display by name g_ima.* attribute(reverse,bold,green)
<6>【4gl档设置】call cl_set_comp_font_color("ima01,ima02a","red")
<7>【per档设置】grid (fontpitch=fixed)
fontpitch:这个属性定义字符的字体类型作为固定或变量在使用默认字体。
color:
【用途】
the color attribute defines the foreground color of the text displayed by a form element.
【说明】
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 :
【用途】
the color where attribute defines a condition to set the foreground color dynamically.
【说明】
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.
效果图如下几张图片:
********************************************************************************************************************************************
==== till good is better, but better best
====“我的努力不会停止,敬请期待吧!”my trying hard will go on!please wait and see!
********************************************************************************************************************************************
上一篇: Wix判断操作系统
下一篇: 关于GC(下):CMS和G1GC的比较