当前位置:网站首页>Latest news of awtk: new usage of grid control
Latest news of awtk: new usage of grid control
2022-06-24 07:56:00 【jim. li】
Grid Control usage
For a long time ,grid All of them just play a semantic role , In function and view No difference . Recently, we changed it to , It can improve development efficiency in many places .
- You can specify the width of different columns . This is not possible in the default child control layout .
- You can draw gridlines . Do it the traditional way , Although it's not impossible , It's also very troublesome .
- Odd and even lines can specify different background colors . Do it the traditional way , It's also very troublesome .
With these features , We can easily achieve the table effect .

because grid It has no scrolling effect , Not suitable for displaying large amounts of data .
1. usage
1.1 Specify the number of lines
Passing attribute rows Specify the number of lines .
1.2 Specify parameters for each column
Passing attribute columns_definition Specify parameters for each column
/** * @property {char*} columns_definition * @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"] * Parameters of each column . * The parameters of each column are separated by semicolons in English (;) Separate , The format of each column parameter is : * * col(w=?,left_margin=?,right_margin=?,top_maorgin=?,bottom_margin=?) * * * w Is the width of the column ( There must be ). The value is (0-1] In the interval , As grid Proportion of control width , Otherwise, the pixel width . * * left_margin( Optional , It can be abbreviated as l) The left margin of the column . * * right_margin( Optional , It can be abbreviated as r) The right margin of the column . * * top_margin( Optional , It can be abbreviated as t) The margin at the top of the column . * * bottom_margin( Optional , It can be abbreviated as b) The margin at the bottom of the column . * * margin( Optional , It can be abbreviated as m) Also specify the above 4 Margins . * */
char* columns_definition;
1.3 Show grid
- attribute show_grid Set to true.
- stay style It is specified in grid_color The color of the
- stay style It is specified in border_color The color of the
1.4 Odd and even lines have different background colors
- stay style Pass through even_bg_color Specifies the background color for even rows
- stay style Pass through odd_bg_color Specify the background color of odd rows
1.5 Complete example
<window>
<grid x="10" y="10" w="-20" h="30" columns_definition="col(w=0.4,m=5);col(w=0.3,m=5);col(w=0.3,m=5);" rows="1" style.normal.grid_color="gray" style.normal.border_color="black" show_grid="true" style.normal.bg_color="#a0a0a0">
<label text=" full name " />
<label text=" Chinese language and literature " />
<label text=" mathematics " />
</grid>
<grid x="10" y="40" w="-20" h="180" columns_definition="col(w=0.4,m=5);col(w=0.3,m=5);col(w=0.3,m=5);" rows="5" style.normal.grid_color="gray" style.normal.border_color="black" style.normal.odd_bg_color="#f5f5f5" style.normal.even_bg_color="#eeeeee" show_grid="true">
<label text=" Zhang San " />
<label text="98" />
<label text="97" />
<label text=" Li Si " />
<label text="98" />
<label text="97" />
<label text=" Wang Wu " />
<label text="98" />
<label text="97" />
<label text=" Sun Liu " />
<label text="98" />
<label text="97" />
<label text=" Zhao Qi " />
<label text="98" />
<label text="97" />
</grid>
</window>
边栏推荐
- 第 2 篇:繪制一個窗口
- 鸿蒙os开发三
- Take my brother to make a real-time Leaderboard
- On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar
- Echart 心得 (一): 有关Y轴yAxis属性
- 线程的支持
- 单片机STM32F103RB,BLDC直流电机控制器设计,原理图、源码和电路方案
- Chapitre 2: dessiner une fenêtre
- Open cooperation and win-win future | Fuxin Kunpeng joins Jinlan organization
- Specify IP when calling feign interface
猜你喜欢

闲谈:3AC到底发生了什么?

AWTK 最新动态:Grid 控件新用法

Moonwell Artemis is now online moonbeam network

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

【NILM】非入侵式负荷分解模块nilmtk安装教程

Open cooperation and win-win future | Fuxin Kunpeng joins Jinlan organization

Configure your own free Internet domain name with ngrok

Backup and restore SQL Server Databases locally

本地备份和还原 SQL Server 数据库

用Ngrok 配置属于自己的免费外网域名
随机推荐
屏幕截图推荐—Snipaste
[测试开发]初识软件测试
没有专业背景,还有机会成为机器学习工程师吗?
Thread blocking
Pair class notes
Echart 心得 (一): 有关Y轴yAxis属性
《canvas》之第1章 canvas概述
闲谈:3AC到底发生了什么?
《canvas》之第2章 直线图形
Keep one decimal place and two decimal places
《canvas》之第3章 曲线图形
10. Tencent cloud IOT device side learning - firmware upgrade
站在风暴中心:如何给飞奔中的腾讯更换引擎
自动化测试的生命周期是什么?
LeetCode 207:课程表(拓扑排序判断是否成环)
tuple(元组)备注
Tuple remarks
OpenGauss数据库在 CentOS 上的实践,配置篇
Exness: Powell insisted on his anti inflation commitment and pointed out that recession is possible
Inline element, block element, inline block element