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

}

}

}

相关推荐
晚霞的不甘3 小时前
Flutter for OpenHarmony从零到一:构建《冰火人》双人合作闯关游戏
android·flutter·游戏·前端框架·全文检索·交互
子春一4 小时前
Flutter for OpenHarmony:构建一个 Flutter 习惯打卡应用,深入解析周视图交互、连续打卡逻辑与状态驱动 UI
flutter·ui·交互
雨季6667 小时前
Flutter 三端应用实战:OpenHarmony “极简文本行数统计器”
开发语言·前端·flutter·ui·交互
雨季6667 小时前
Flutter 三端应用实战:OpenHarmony 简易“动态字体大小调节器”交互模式深度解析
开发语言·flutter·ui·交互·dart
晚霞的不甘8 小时前
Flutter for OpenHarmony全面升级「今日运势」 应用的视觉与交互革新
前端·学习·flutter·前端框架·交互
摘星编程8 小时前
React Native鸿蒙版:KeyboardInteractive交互监听
react native·交互·harmonyos
qq_177767379 小时前
React Native鸿蒙跨平台实现移动端图书展示与交互系统,涵盖图书列表渲染、多分类筛选、收藏与购物车管理、图书详情展示等核心业务场景
javascript·react native·react.js·ecmascript·交互·harmonyos
雨季6669 小时前
Flutter 三端应用实战:OpenHarmony “安全文本溢出处理调节器”
开发语言·前端·安全·flutter·交互
雨季66610 小时前
Flutter 三端应用实战:OpenHarmony “极简安全文本对齐调节器”
开发语言·前端·javascript·安全·flutter·交互
方见华Richard1 天前
世毫九《认知几何学修订版:从离散概念网络到认知拓扑动力学》
人工智能·经验分享·交互·原型模式·空间计算