当前位置:网站首页>Aardio - construct a multi button component with customplus library +plus
Aardio - construct a multi button component with customplus library +plus
2022-07-06 22:31:00 【Lu Guangqing】
utilize customPlus library +plus Components , Easily construct a multi button component , Achieve mouse over effect , Realize the response click function .
Effect 1 :
Code 1 :
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add(
plus={cls="plus";left=0;top=0;right=600;bottom=500;bgcolor=16777215;notify=1;z=1}
)
/*}}*/
winform.show();
// Define project templates
var itemModel = {
{
type="rect",
rectf={x=3;y=3;width=-3;height=-3},
name=" Project background color ",
click=true;
width=1,
round=25,
color=0xFF009955,
fillcolor=0x22009955,
itemhoverfillcolor=0xAA009955,
},
{
type="text",
rectf={x=3;y=3;width=-3;height=-3},
name=" Title Text ",
align=1;
valign=1;
smooth=true;
text="",
font={name="Tahoma",h=-13,color=0xFFFF0000,weight=700},
itemhoverfont={name="Tahoma",h=-16,color=0xFFFFFFFF,weight=700},
}
}
// Generate project list
var itemList = {}
for(i=1;28;1){
..table.push(itemList,{ Title Text ="ITEM"++i})
}
// Construction components
import godking.customPlus
var c = godking.customPlus(winform.plus,{
itemWidth=80, /* Project width */
itemHeight=40, /* Project height */
autoSizeRow=true, /* Automatically according to the number of project lines and plus Height adjustment item height */
autoSizeCol=true, /* Automatically according to the number of project columns and plus Width adjust item width */
colnum=0, /* Number of project Columns , by 0 According to the project width and plus Automatic width calculation */
rownum=0, /* Number of project lines , by 0 According to the project height and plus Automatic height calculation */
padLeft=5, /*plus Left margin */
padTop=5, /*plus Top margin distance */
padRight=5, /*plus Right margin distance */
padBottom=5 /*plus Bottom margin distance */
},itemModel,itemList);
c.onClick = function(itemIndex){
..win.msgbox(" You clicked :"++itemIndex)
}
win.loopMessage();
Effect two :
Code 2 :
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=669;bottom=399)
winform.add(
button={cls="button";text=" add to ";left=530;top=330;right=660;bottom=390;color=14120960;flat=1;font=LOGFONT(h=-14);note=" Add an item ";z=2};
plus={cls="plus";left=0;top=0;right=670;bottom=320;clipBk=false;notify=1;z=1}
)
/*}}*/
winform.show();
import inet.http
winform.plus.background = "https://img1.baidu.com/it/u=3977836567,3094831983&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500"
// Define project templates
var itemModel = {
{
type="rect",
rectf={x=3;y=3;width=-3;height=-3},
name=" Project background color ",
click=true;
width=2,
round=4,
color=0xFF009955,
fillcolor=0x55009955,
hoverfillcolor=0xBB009955,
},
{
type="text",
rectf={x=3;y=3;width=-3;height=-3},
name=" Title Text ",
align=1;
valign=1;
smooth=true;
text="",
font={name="Tahoma",h=-13,color=0xFFFFFFFF,weight=700},
hoverfont={name="Tahoma",h=-16,color=0xFFFFFF00,weight=700},
}
}
// Generate project list
var itemList = {}
for(i=1;28;1){
..table.push(itemList,{ Title Text ="ITEM"++i})
}
// Construction components
import godking.customPlus
var c = godking.customPlus(winform.plus,{
itemWidth=80, /* Project width */
itemHeight=40, /* Project height */
autoSizeRow=true, /* Automatically according to the number of project lines and plus Height adjustment item height */
autoSizeCol=true, /* Automatically according to the number of project columns and plus Width adjust item width */
colnum=0, /* Number of project Columns , by 0 According to the project width and plus Automatic width calculation */
rownum=0, /* Number of project lines , by 0 According to the project height and plus Automatic height calculation */
padLeft=20, /*plus Left margin */
padTop=20, /*plus Top margin distance */
padRight=20, /*plus Right margin distance */
padBottom=20 /*plus Bottom margin distance */
},itemModel,itemList);
c.onClick = function(itemIndex){
..win.msgbox(" You clicked :"++itemIndex)
}
winform.button.oncommand = function(id,event){
..table.push(itemList,{ Title Text ="ITEM"++(#itemList+1)})
c.update()
}
win.loopMessage();
Effect three :
Code three :
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=669;bottom=399)
winform.add(
button={cls="button";text=" add to ";left=530;top=330;right=660;bottom=390;color=14120960;db=1;dr=1;flat=1;font=LOGFONT(h=-14);note=" Add an item ";z=2};
plus={cls="plus";left=0;top=0;right=670;bottom=320;clipBk=false;db=1;dl=1;dr=1;dt=1;notify=1;z=1}
)
/*}}*/
winform.show();
import inet.http
// Define project templates
var itemModel = {
{
type="rect",
rectf={x=23;y=3;width=-3;height=-3},
name=" Project background color ",
click=true;
width=0,
round=50,
color=0xFF009955,
fillcolor=0x55009955,
hoverfillcolor=0xBB009955,
},
{
type="text",
rectf={x=30;y=3;width=-3;height=-3},
name=" Title Text ",
align=1;
valign=1;
smooth=true;
text="",
font={name="Tahoma",h=-13,color=0xFFFFFFFF,weight=700},
hoverfont={name="Tahoma",h=-16,color=0xFFFFFF00,weight=700},
}
{
type="img",
rectf={x=0;y=0;width=50;height=50},
scale = true;
name="cio",
img = "//img.inotgo.com/imagesLocal/202207/06/202207061439346027_0.png"
}
}
// Generate project list
var itemList = {}
for(i=1;580;1){
..table.push(itemList,{ Title Text ="ITEM"++i})
}
// Construction components
import godking.customPlus
var c = godking.customPlus(winform.plus,{
itemWidth=150, /* Project width */
itemHeight=50, /* Project height */
autoSizeRow=true, /* Automatically according to the number of project lines and plus Height adjustment item height */
autoSizeCol=true, /* Automatically according to the number of project columns and plus Width adjust item width */
colnum=0, /* Number of project Columns , by 0 According to the project width and plus Automatic width calculation */
rownum=0, /* Number of project lines , by 0 According to the project height and plus Automatic height calculation */
padLeft=20, /*plus Left margin */
padTop=20, /*plus Top margin distance */
padRight=20, /*plus Right margin distance */
padBottom=20 /*plus Bottom margin distance */
},itemModel,itemList,0xFF000000,);
c.onClick = function(itemIndex){
..win.msgbox(" You clicked :"++itemIndex)
}
winform.button.oncommand = function(id,event){
..table.push(itemList,{ Title Text ="ITEM"++(#itemList+1)})
c.update()
}
winform.adjust = function( cx,cy,wParam ) {
c.init()
};
c.toNextPage()
win.loopMessage();
Effect four :
Code four :
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=669;bottom=399)
winform.add(
button={cls="button";text=" add to ";left=530;top=330;right=660;bottom=390;color=14120960;db=1;dr=1;flat=1;font=LOGFONT(h=-14);note=" Add an item ";z=2};
plus={cls="plus";left=0;top=0;right=670;bottom=320;clipBk=false;db=1;dl=1;dr=1;dt=1;notify=1;z=1}
)
/*}}*/
winform.show();
import inet.http
// Define project templates
var itemModel = {
{
type="rect",
rectf={x=3;y=3;width=-3;height=-3},
name=" Project background color ",
click=true;
width=2,
round=4,
color=0xFF009955,
fillcolor=0x55009955,
hoverfillcolor=0xBB009955,
},
{
type="text",
rectf={x=20;y=3;width=-3;height=-3},
name=" Title Text ",
align=1;
valign=1;
smooth=true;
text="",
font={name="Tahoma",h=-13,color=0xFFFFFFFF,weight=700},
hoverfont={name="Tahoma",h=-16,color=0xFFFFFF00,weight=700},
}
{
type="img",
rectf={x=10;y=10;width=30;height=30},
scale = true;
name="cio",
img = "//img.inotgo.com/imagesLocal/202207/06/202207061439346027_0.png"
}
}
// Generate project list
var itemList = {}
for(i=1;580;1){
..table.push(itemList,{ Title Text ="ITEM"++i})
}
// Construction components
import godking.customPlus
var c = godking.customPlus(winform.plus,{
itemWidth=150, /* Project width */
itemHeight=50, /* Project height */
autoSizeRow=true, /* Automatically according to the number of project lines and plus Height adjustment item height */
autoSizeCol=true, /* Automatically according to the number of project columns and plus Width adjust item width */
colnum=0, /* Number of project Columns , by 0 According to the project width and plus Automatic width calculation */
rownum=0, /* Number of project lines , by 0 According to the project height and plus Automatic height calculation */
padLeft=20, /*plus Left margin */
padTop=20, /*plus Top margin distance */
padRight=20, /*plus Right margin distance */
padBottom=20 /*plus Bottom margin distance */
},itemModel,itemList,0xFF000000,);
c.onClick = function(itemIndex){
..win.msgbox(" You clicked :"++itemIndex)
}
winform.button.oncommand = function(id,event){
..table.push(itemList,{ Title Text ="ITEM"++(#itemList+1)})
c.update()
}
winform.adjust = function( cx,cy,wParam ) {
c.init()
};
c.toNextPage()
win.loopMessage();
Images used :
Effect five :
Code five :
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=639;bottom=399)
winform.add(
button={cls="button";text=" add to ";left=500;top=330;right=630;bottom=390;color=14120960;db=1;dr=1;flat=1;font=LOGFONT(h=-14);note=" Add an item ";z=2};
plus={cls="plus";left=0;top=0;right=650;bottom=320;clipBk=false;db=1;dl=1;dr=1;dt=1;notify=1;z=1}
)
/*}}*/
winform.show();
// Define project templates
var itemModel = {
{
type="rect",
rectf={x=0;y=0;width=151;height=51},
name=" Project background color ",
click=true;
width=0,
round=0, // or 1
color=0xBB009955;
fillcolor=0x55009955,
hoverfillcolor=0xBB009955,
},
{
type="text",
rectf={x=20;y=3;width=-3;height=-3},
name=" Title Text ",
align=1;
valign=1;
smooth=true;
text="",
font={name="Tahoma",h=-13,color=0xFFFFFFFF,weight=700},
hoverfont={name="Tahoma",h=-16,color=0xFFFFFF00,weight=700},
}
{
type="img",
name = "pic",
rectf={x=10;y=10;width=30;height=30},
scale = true;
}
}
// Generate project list
var itemList = {}
for(i=1;580;1){
..table.push(itemList,{ Title Text ="ITEM"++i;pic="E:\ Picture material \png\png128_1000\"++i++".png"})
}
// Construction components
import godking.customPlus
var c = godking.customPlus(winform.plus,{
itemWidth=150, /* Project width */
itemHeight=50, /* Project height */
autoSizeRow=0, /* Automatically according to the number of project lines and plus Height adjustment item height */
autoSizeCol=0, /* Automatically according to the number of project columns and plus Width adjust item width */
colnum=0, /* Number of project Columns , by 0 According to the project width and plus Automatic width calculation */
rownum=0, /* Number of project lines , by 0 According to the project height and plus Automatic height calculation */
padLeft=20, /*plus Left margin */
padTop=20, /*plus Top margin distance */
padRight=20, /*plus Right margin distance */
padBottom=20 /*plus Bottom margin distance */
},itemModel,itemList,0xFF000000,);
c.onClick = function(itemIndex/* Project index */,elemIndex/* Element index */,elemID/* Elements id*/,elemName/* Elements name*/,pageIndex/* Current page item index */){
..win.msgbox(" You clicked :"++c.itemList[itemIndex]. Title Text )
}
winform.button.oncommand = function(id,event){
..table.push(itemList,{ Title Text ="ITEM"++(#itemList+1)})
c.update()
}
winform.adjust = function( cx,cy,wParam ) {
c.init()
};
c.toNextPage()
win.loopMessage();
边栏推荐
- config:invalid signature 解决办法和问题排查详解
- pytorch_YOLOX剪枝【附代码】
- 手写ABA遇到的坑
- 数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
- Mise en place d'un environnement de développement OP - tee basé sur qemuv8
- Void keyword
- Mysql database basic operations DML
- Memorabilia of domestic database in June 2022 - ink Sky Wheel
- Sword finger offer question brushing record 1
- 硬件開發筆記(十): 硬件開發基本流程,制作一個USB轉RS232的模塊(九):創建CH340G/MAX232封裝庫sop-16並關聯原理圖元器件
猜你喜欢
Aardio - 通过变量名将变量值整合到一串文本中
Web APIs DOM 时间对象
剑指offer刷题记录1
CCNA Cisco network EIGRP protocol
[linear algebra] determinant of order 1.3 n
That's why you can't understand recursion
2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
[leetcode daily clock in] 1020 Number of enclaves
剪映+json解析将视频中的声音转换成文本
新手程序员该不该背代码?
随机推荐
如何用程序确认当前系统的存储模式?
在IPv6中 链路本地地址的优势
2014阿里巴巴web前实习生项目分析(1)
What are the interface tests? What are the general test points?
Sword finger offer question brushing record 1
Learn the principle of database kernel from Oracle log parsing
void关键字
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Windows Auzre 微软的云计算产品的后台操作界面
第4章:再谈类的加载器
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
rust知识思维导图xmind
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa
基於 QEMUv8 搭建 OP-TEE 開發環境
Plafond du tutoriel MySQL, bien collecté, regardez lentement
基于 QEMUv8 搭建 OP-TEE 开发环境
NetXpert XG2帮您解决“布线安装与维护”难题
return 关键字
柔性数组到底如何使用呢?
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"