Code AardioLine:112 复制
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. import
win
.ui;import
godking.vlistExvar
winform = win
.form(text="aardio form"
;right=375
;bottom=199
)winform.add( plus={cls="plus"
;left=8
;top=8
;right=336
;bottom=176
;notify=1
;z=1
}; vlistEx={cls="vlistEx"
;text="自定义控件"
;left=16
;top=8
;right=40
;bottom=32
;hide=1
;z=2
} ) import
godking.customPlusimport
fonts.fontAwesomevar
itemModel = { { type
="rect"
, rectf={x=10
;y=10
;width=14
;height=14
}, name="checktext"
, check = true
, width=1
, color=0xFF0000FF, checkedfillcolor = 0xFF0000FF, }, { type
="text"
, rectf={x=10
;y=10
;width=14
;height=14
}, name="checktext"
, click=true
, check=true
, align=1
, valign=1
, smooth=true
, cur=32649
, text=""
, checkedtext="√"
, font={name="Tahoma"
,point=11
,color=0xFFFFFFFF}, } { type
="paint"
, rectf={x=30
;y=10
;width=14
;height=14
}, proc=function
(paint,itemIndex,elemIndex,rectF,disabled,checked,hovered,itemSelected,itemHovered){ paint = toPaint(paint); if
checked { paint.fillRectF(rectF,0xFF0000FF) paint.drawTextF(rectF,"√"
,::LOGFONT(name="Tahoma"
;point=11
,color=0xFFFFFFFF;brush=null
),0
,1
,1
) } else
{ paint.drawRectF(rectF,0xFF0000FF,,) } }; name="ownerdraw"
, click=true
, check=true
, cur=32649
, } { type
="text"
, rectf={x=50
;y=10
;width=18
;height=18
}, name="checktextFontAwesome"
, click=true
, check=true
, align=1
, valign=1
, smooth=0
, cur=32649
, text='\uF096'
, checkedtext='\uF14A'
, font={name="FontAwesome"
,h=18
,color=0xFFFF0000}, } { type
="img"
, rectf={x=70
;y=10
;width=14
;height=14
}, name="checkimg"
, click=true
, check=true
, cur=32649
, img = winform.vlistEx.checkBox.getDefaultUncheckedImg(), checkedimg = winform.vlistEx.checkBox.getDefaultCheckedImg(), } } var
c = godking.customPlus(winform.plus,itemModel,{{}},{ itemWidth=100
, itemHeight=100
, autoSizeWidth=false
, autoSizeHeight=false
, rownum=1
, colnum=1
, padLeft=0
, padTop=0
, padRight=0
, padBottom=0
, autoFit=false
, vertical=false
, bkcolor=0xFFFFFFFF, bkimg=null
, singleCheck=0
, }) winform.show(); win
.loopMessage();