当前位置:网站首页>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();边栏推荐
- (18) LCD1602 experiment
- HDR image reconstruction from a single exposure using deep CNN reading notes
- TypeScript获取函数参数类型
- poj 1094 Sorting It All Out (拓扑排序)
- Mise en place d'un environnement de développement OP - tee basé sur qemuv8
- MySQL----初识MySQL
- Puppeteer连接已有Chrome浏览器
- Aardio - 封装库时批量处理属性与回调函数的方法
- Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
- China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
猜你喜欢
![[线性代数] 1.3 n阶行列式](/img/6e/54f3a994fc4c2c10c1036bee6715e8.gif)
[线性代数] 1.3 n阶行列式

将MySQL的表数据纯净方式导出

Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"

Crawler obtains real estate data

Clip +json parsing converts the sound in the video into text

labelimg的安装与使用

Attack and defense world ditf Misc

Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode

Pit encountered by handwritten ABA

Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
随机推荐
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
Inno Setup 打包及签名指南
基于 QEMUv8 搭建 OP-TEE 开发环境
pytorch_YOLOX剪枝【附代码】
空结构体多大?
CocosCreator+TypeScripts自己写一个对象池
Jafka来源分析——Processor
Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing
Installation and use of labelimg
2014阿里巴巴web前实习生项目分析(1)
Data processing skills (7): MATLAB reads the data in the text file TXT with mixed digital strings
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
2022-07-05 use TPCC to conduct sub query test on stonedb
Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
Spatial domain and frequency domain image compression of images
[IELTS speaking] Anna's oral learning record part1
做接口测试都测什么?有哪些通用测试点?
MySQL教程的天花板,收藏好,慢慢看
2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行