WlbAI的交互编程语言Wlblang界面编程演示程序源码

window1:Window{

Title{"Wlblang UI Demo"}

tabs1:Tabs{

tab1:Tab{

Title{"Buttons"}

Button1:Button{

Text{"Hello Button"}

func OnClick() {

pr("Hello world")

}

}

Button2:Button{

Text{"Menu Button"}

Menu{

MenuItem{

Text{"Menuitem 1"}

func OnClick() {

pr("Menuitem 1 clicked")

}

}

MenuItem{

Text{"Menuitem 2"}

func OnClick() {

pr("Menuitem 2 clicked")

}

}

}

}

row1:Row{

textfield1:Textfield{

Text{"text 1"}

}

Button2:Button{

Text{"Text with button"}

func OnClick() {

pr(textfield1.GetText())

}

}

}

Button3:Button{

Text{"Icon Button"}

Icon{"Open"}

func OnClick() {

pr("Icon button with open icon")

}

}

button4:ColorButton{

Text{"ColorButton"}

}

button5:ColorMapButton{

Text{"ColorMapButton"}

}

button6:FileButton{

Text{"FileButton"}

}

button7:FontButton{

Text{"FontButton"}

}

button8:FormButton{

Text{"FormButton"}

}

}

tab2:Tab{

Title{"Pictures"}

text1:Text{

"Icon 1"

}

icon1:Icon{

"Save"

}

text2:Text{

"Image 1"

}

image1:Image{

"icon.png"

}

text2:Text{

"Svg 1"

}

svg1:Svg{

Svg{"Article"}

}

text3:Text{"Canvas 1"}

canvas1:Canvas{

func OnDraw(painter) {

painter.StrokeColor(0,0,255)

painter.MoveTo(0.15, 0.3)

painter.LineTo(0.3, 0.15)

painter.StrokeColor(0,255,0)

painter.FillBox(0.7, 0.3,0.2, 0.5)

painter.FillColor(255,255,0)

painter.Circle(0.4, 0.5, 0.15)

painter.Draw()

}

}

}

tab3:Tab{

Title{"Inputs"}

textfield1text:Text{

"textfield 1"

}

textfield1:Textfield{

Text{"Textfield text"}

PlaceHolder{"Textfield placeholder"}

}

passswordtextfield1text:Text{

"passswordtextfield 1"

}

passswordtextfield1:Textfield{

Text{"Password Textfield text"}

TypePassword{true}

PlaceHolder{"Textfield placeholder"}

}

spiner1text:Text{

"spiner 1"

}

spiner1:Spinner{

Min{0}

Max{100}

Step{2}

Value{50}

}

chooser1text:Text{

"chooser 1"

}

chooser1:Chooser{

Items{

"item 1:item 1 tooltip"

"item 2:item 2 tooltip"

"item 3:item 3 tooltip"

}

PlaceHolder{"Chooser Place Holder"}

}

switch1text:Text{

Text{"switch 1"}

}

switch1:Switch{

Text{"Switch text"}

Type{SwitchSwitch}

Value{true}

}

switches1text:Text{

"switches 1"

}

switches1:Switches{

Type{

"SwitchSwitch"

}

Items{

"switch 1"

"switch 2"

}

}

slider1text:Text{

"slider row"

}

slider1:Slider{

Min{0}

Max{100}

Value{25}

Step{1}

}

slider2text:Text{

"slider column"

}

slider2:Slider{

Min{0}

Max{100}

Value{25}

Step{1}

Direction{"Column"}

}

meter1text:Text{

"meter 1 circle"

}

meter1:Meter{

Type{"MeterCircle"}

Value{0}

Min{0}

Max{100}

Text{"Meter text"}

}

meter2text:Text{

"meter 2 circle"

}

meter2:Meter{

Type{"MeterSemicircle"}

Value{0}

Min{0}

Max{100}

Text{"Meter text"}

}

editor11text:Text{

"editor 1"

}

editor1:Editor{

Text{"editor 1 text"}

}

durationinput1text:Text{

"durationinput 1"

}

durationinput1:DurationInput{

Duration{T210342}

}

timepicker1:Text{

"timepicker 1"

}

timepicker1:TimePicker{

Time{D20251229T171304}

}

datepicker1:Text{

"datepicker 1"

}

datepicker1:DatePicker{

Date{D20251229T171304}

}

}

tab4:Tab{

Title{"Container"}

splits1:Splits{

editor1:Editor{

Text{"edit1"}

}

editor2:Editor{

Text{"edit2"}

}

}

row2:Row{

text1:Text{

"Row 1"

}

button1:Button{

Text{"Button1"}

}

button2:Button{

Text{"Button2"}

}

}

}

tab5:Tab{

Title{"Collections"}

list1:List{

Rows{

"list item 1"

"list item 2"

"list item 3"

}

}

list2:List{

Rows{

{"fname1", "fname1val"}

{"fname2", "fname2val"}

{"fname3", "fname3val"}

}

}

keyedlist:KeyedList{

Rows{

{"name", "name1"}

{"length", 100}

{"height", 200}

}

}

keyedlist:KeyedListButton{

Rows{

{"name", "name1"}

{"length", 100}

{"height", 200}

}

}

tree1:Tree{

Node1{

Node1_1{

Node1_1_1{

}

}

Node1_2{

}

}

Node2{

Node2_1{

}

Node2_2{

}

}

}

}

tab6:Tab{

Title{"Dialogs"}

button1:Button{

Text{"Message dialog"}

func OnClick() {

MessageDialog("message","title")

}

}

button2:Button{

Text{"Error dialog"}

func OnClick() {

ErrorDialog("error","title")

}

}

button3:Button{

Text{"Message snackbar"}

func OnClick() {

MessageSnackbar("message")

}

}

button4:Button{

Text{"Error snackbar"}

func OnClick() {

ErrorSnackbar("error")

}

}

button5:Button{

Text{"Input dialog"}

func OnClick() {

dialog1:Dialog{

Title{"Input dialog"}

textfield1:Textfield{}

BottomBar{

func OnCancel() {

pr("dialog cancle")

}

func OnOK() {

pr("dialog ok1")

}

}

}

dialog1.RunDialog()

}

}

button6:Button{

Text{"Full dialog"}

func OnClick() {

dialog1:Dialog{

Title{"Full dialog"}

textfield1:Textfield{}

BottomBar{

func OnCancel() {

pr("dialog cancle")

}

func OnOK() {

pr("dialog ok1")

}

}

}

dialog1.RunFullDialog()

}

}

}

}

BottomBar{

func OnCancel() {

pr("demo canceled")

}

func OnOK() {

pr("demo OK")

}

}

}

相关推荐
言乐614 小时前
HTML实现Word、Excel、PPT三种可切换背景,可键盘打字、和像素小人交互
html·word·powerpoint·excel·交互
会议咨询2 天前
2026年交互设计、计算机视觉与数字化技术国际会议(ICDT 2026)
人工智能·计算机视觉·交互
工业HMI实战笔记2 天前
优化工业HMI报警提示只需4步
性能优化·交互·设计语言
元岳数字人小元2 天前
数字人私有化部署:企业级AI数字场景长效落地优选方案
运维·人工智能·开源·人机交互·交互
黑妹天下第一乖3 天前
小智改造实战解读-用kokoro-onnx替换云端 TTS 的完整记录
大数据·开发语言·人工智能·python·交互
小宋10213 天前
A2UI从零实战:Agent安全生成交互界面与事件回传
javascript·人工智能·安全·交互
JQLvopkk4 天前
HslCommunication,一个工具测遍所有 PLC
开发语言·人工智能·c#·交互
jason.zeng@15022074 天前
(九)多轮对话式新增维修记录实现方案
python·prompt·交互·llama
jason.zeng@15022075 天前
(五)多轮对话上下文,实现交互。
python·交互·llama
jason.zeng@15022075 天前
(十)分层架构的多文件工程
python·架构·prompt·交互·ai编程·llama