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")

}

}

}

相关推荐
亿坊电商10 小时前
AI数字人开发框架如何实现多模态交互?
人工智能·交互
小雨下雨的雨11 小时前
Flutter 框架跨平台鸿蒙开发 —— Row & Column 布局之轴线控制艺术
flutter·华为·交互·harmonyos·鸿蒙系统
小雨下雨的雨12 小时前
Flutter 框架跨平台鸿蒙开发 —— Icon 控件之图标交互美学
flutter·华为·交互·harmonyos·鸿蒙系统
q_30238195562 天前
香橙派AI Pro 20T部署DeepSeek:打造本地离线语音助手,实现语音交互自由!
人工智能·交互
mingren_13142 天前
c++和qml交互
c++·qt·交互
人机与认知实验室2 天前
2026年,“交互”会出现新的定义
交互
wenzhangli72 天前
告别手撸架构图!AI+Ooder实现漂亮架构+动态交互+全栈可视化实战指南
人工智能·架构·交互
科技与数码3 天前
数字人公司世优科技以全栈技术解锁政务文旅展厅全场景智能交互
科技·交互·政务
MARS_AI_3 天前
融资加持下的云蝠智能:大模型语音Agent重构企业通信新生态
人工智能·自然语言处理·重构·交互·信息与通信·agi