记EjunGrid表格控件在aardio中调用记录

By admin at 2020-08-16 • 0人收藏 • 1827人看过

前面讲过FlexCell表格控件的使用, 还封装了用户库.

这个和flexCell类似, 不过它的树形表格用起来比较方便, 目前还用不到, 特别记录一下

这个控件支持下拉,按钮,日期,spin数字输入,单选,复选,财务格式

包含了三种模式, 普通表格/树形表格/工作薄模式.

image.png

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=550;bottom=300)
winform.add()
/*}}*/

import console
console.open()
//EjunGridCtrls.EjunTreeGrid
//EjunGridCtrls.EjunWorkbook

var ejun = winform.createEmbed("EjunGridCtrls.EjunDataGrid");
var EjunGrid = ejun._object;
EjunGrid.Register("your name","your codeID","your key");
//水平方向全尺寸
EjunGrid.SetOptionByName("HorzFullSize", true);
//行选模式
EjunGrid.SetOptionByName("RowSelect", true);
//总是显示按钮
EjunGrid.SetOptionByName("AlwaysShowButton", true);
//隐藏水平滚动条
//EjunGrid.SetOptionByName("HideHorzScrollBar", true); 
//隐藏垂直滚动条
//EjunGrid.SetOptionByName("HideVertScrollBar", true);
//经典风格
EjunGrid.VisualStyle = 2;
//行数
EjunGrid.AutoColWidth=true
EjunGrid.AutoRowHeight=true
EjunGrid.RowCount=20


//隐藏对应行
//EjunGrid.Rows(0).Visible = false 
//隐藏对应列
//EjunGrid.Columns(0).Visible = false
//设置固定行为2行
//EjunGrid.FixedRowCount = 2;
//EjunGrid.FixedColCount = 2; 
//设置一列都是复选框
//EjunGrid.Columns(1).CellType=2
//设置单个单元格为复选框
EjunGrid.setCellTypes(2,3,2);
//设置复选框文字
EjunGrid.Cells(2, 3).AddItem("Aardio编程")
//设置选中
EjunGrid.Cells(2, 3).AsBoolean = true;      

EjunGrid.setCellTypes(4,3,3);
//设置复选框文字
EjunGrid.Cells(4, 3).AddItem("Aardio")
EjunGrid.Cells(4, 3).AddItem("C#")
EjunGrid.Cells(4, 3).AddItem("Python")
//设置选中
EjunGrid.Cells(4, 3).AsInteger = 2;//从0开始 

//自动换行
//EjunGrid.Cells(1, 1).Style.WrapText = true

EjunGrid.Cells(2, 5).bgColor=138;
EjunGrid.Cells(1, 5).FontColor = 138;
EjunGrid.Cells(1, 5).Font.setsize(30);
EjunGrid.Cells(1, 5).Font.setbold(true);
EjunGrid.Cells(1, 5).Font.setitalic(true);
EjunGrid.Cells(1, 5).Text = "hello !";

EjunGrid.setCellTypes(2,6,4);
//设置复选框文字
EjunGrid.Cells(2, 6).AddItem("Aardio")
EjunGrid.Cells(2, 6).AddItem("C#")
EjunGrid.Cells(2, 6).AddItem("Python")

//Spin模式
EjunGrid.setCellTypes(2,7,5);
//图表模式
EjunGrid.setCellTypes(2,8,6);
//按钮模式
EjunGrid.setCellTypes(2,9,7);
//日期模式
EjunGrid.setCellTypes(2,10,9);
//财务模式
EjunGrid.setCellTypes(2,11,10);

winform.show();
win.loopMessage();


树形表格:

image.png

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add()
/*}}*/

import console
console.open()

var ejun = winform.createEmbed("EjunGridCtrls.EjunTreeGrid");
var ejunObj = ejun._object;
ejunObj.Register("your name","your codeID","your key");
ejunObj.RowCount=10
ejunObj.TreeRow = 3;
ejunObj.setCellString(1,3,"电饭锅种类")
ejunObj.AddChildNode(3,-1)
ejunObj.setCellString(1,4,"美的")
ejunObj.AddSiblingNode(4,false)
ejunObj.setCellString(1,5,"澳柯玛")
ejunObj.AddSiblingNode(4,false)
ejunObj.setCellString(1,6,"新飞")

ejunObj.AddChildNode(-1,-1)
ejunObj.setCellString(1,7,"大米的种类")
ejunObj.AddChildNode(7,-1)
ejunObj.setCellString(1,8,"南方的")
ejunObj.AddSiblingNode(8,false)
ejunObj.setCellString(1,9,"北方的")

winform.show();
win.loopMessage();


Excel工作簿模式:

image.png

var ejun = winform.createEmbed("EjunGridCtrls.EjunWorkbook");
var ejunObj = ejun._object;
ejunObj.Register("your name","your codeID","your key");


说明下:

我在aardio中调用的时候, 有些属性是怎么改调用形式都不能成功调用的, 应该还有些属性也会遇到同样的问题, 但是总体不影响使用.


EjunGrid表格控件.zip


2 个回复 | 最后更新于 2020-08-24
2020-08-22   #1

老师,能否发一下源文件!

2020-08-24   #2

回复#1 @lcj21 :

网上搜下, 我也是在网上找的.

登录后方可回帖

登 录
信息栏
 私人小站

本站域名

ChengXu.XYZ

投诉联系:  popdes@126.com



快速上位机开发学习,本站主要记录了学习过程中遇到的问题和解决办法及上位机代码分享

这里主要专注于学习交流和经验分享.
纯私人站,当笔记本用的,学到哪写到哪.
如果侵权,联系 Popdes@126.com

友情链接
Aardio官方
Aardio资源网


才仁机械


网站地图SiteMap

Loading...