本帖最后由 水木子 于 2017-7-20 22:04 编辑
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $iLineTop = 500, $iLineWidth = 700
;~ Global $aColour[3] = [0x2BD55E, 0xFBE204, 0xFF6E6E]
Global $iColour = '0x' & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2)
Global $iItemWidth = 30, $iItemHeight
Global $iSizing = 100
Global $iX = 20
Global $aItem[10] = ['50,80,140', '70,80,100', '40,120', '110,130,50,70', '100,50,100,70,80', '150', '130,80', '90,70,70', '20,80,80', '120,30,40']
Global $aItemID[0]
GUICreate('', 800, 600)
$Graphic1 = GUICtrlCreateGraphic(20, 20, 760, 560)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 50, 20)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 50, $iLineTop)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 50, $iLineTop)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iLineWidth, $iLineTop)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetState(-1, 128)
For $i = 0 To 4
GUICtrlCreateLabel($i * 100 & '-', 30, (510 - $i * 100), 40, 20, 0x0002 + 0x0200)
GUICtrlSetFont(-1, 12, 400)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
Next
For $i = 0 To UBound($aItem) - 1
$aValue = StringSplit($aItem[$i], ',', 2)
$iItemTop = $iLineTop + 20
For $z = 0 To UBound($aValue) - 1
ReDim $aItemID[UBound($aItemID) + 1]
$iItemHeight = $aValue[$z]
$iItemTop = $iItemTop - $iItemHeight
$aItemID[UBound($aItemID) - 1] = GUICtrlCreateLabel('', 120 + ($i * ($iItemWidth + $iX)), $iItemTop, $iItemWidth, $iItemHeight, 0x01 + 0x0200)
GUICtrlSetBkColor(-1, '0x' & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2))
;~ GUICtrlSetBkColor(-1, $aColour[Random(0, UBound($aColour) - 1, 1)])
Next
Next
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $aItemID[0] To $aItemID[UBound($aItemID) - 1]
MsgBox(0, 0, $nMsg - $aItemID[0] + 1)
EndSwitch
WEnd
|