#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Radios[54][5] = [[0, 0, '黑=0', 0x000000, 0], [0, 1, '棕=1', 0x800000, 1], [0, 2, '红=2', 0xFF0000, 2], [0, 3, '橙=3', 0xFFA500, 3], [0, 4, '黄=4', 0xFFFF00, 4], _
[0, 5, '绿=5', 0x008000, 5], [0, 6, '蓝=6', 0x0000FF, 6], [0, 7, '紫=7', 0x800080, 7], [0, 8, '灰=8', 0x808080, 8], [0, 9, '白=9', 0xFFFFFF, 9], _
[1, 0, '黑=0', 0x000000, 0], [1, 1, '棕=1', 0x800000, 1], [1, 2, '红=2', 0xFF0000, 2], [1, 3, '橙=3', 0xFFA500, 3], [1, 4, '黄=4', 0xFFFF00, 4], _
[1, 5, '绿=5', 0x008000, 5], [1, 6, '蓝=6', 0x0000FF, 6], [1, 7, '紫=7', 0x800080, 7], [1, 8, '灰=8', 0x808080, 8], [1, 9, '白=9', 0xFFFFFF, 9], _
[2, 0, '黑=0', 0x000000, 0], [2, 1, '棕=1', 0x800000, 1], [2, 2, '红=2', 0xFF0000, 2], [2, 3, '橙=3', 0xFFA500, 3], [2, 4, '黄=4', 0xFFFF00, 4], _
[2, 5, '绿=5', 0x008000, 5], [2, 6, '蓝=6', 0x0000FF, 6], [2, 7, '紫=7', 0x800080, 7], [2, 8, '灰=8', 0x808080, 8], [2, 9, '白=9', 0xFFFFFF, 9], _
[3, 0, '黑=0', 0x000000, 0], [3, 1, '棕=1', 0x800000, 1], [3, 2, '红=2', 0xFF0000, 2], [3, 3, '橙=3', 0xFFA500, 3], [3, 4, '黄=4', 0xFFFF00, 4], _
[3, 5, '绿=5', 0x008000, 5], [3, 6, '蓝=6', 0x0000FF, 6], [3, 7, '紫=7', 0x800080, 7], [3, 8, '金=-1', 0xFFD700, -1], [3, 9, '银=-2', 0xC0C0C0, -2], _
[4, 0, '棕=±1', 0x800000, '±1'], [4, 1, '红=±2', 0xFF0000, '±2'], [4, 2, '绿=±0.5', 0x008000, '±0.5'], [4, 3, '蓝=±0.25', 0x0000FF, '±0.25'], [4, 4, '紫=±0.1', 0x800080, '±0.1'], _
[4, 5, '灰=±0.05', 0x808080, '±0.05'], [4, 6, '金=±5', 0xFFD700, '±5'], [4, 7, '银=±10', 0xC0C0C0, '±10'], _
[5, 0, '棕=100ppm', 0x800000, '100ppm/℃'], [5, 1, '红=50ppm', 0xFF0000, '50ppm/℃'], [5, 2, '橙=15ppm', 0xFFA500, '15ppm/℃'], [5, 3, '黄=25ppm', 0xFFFF00, '25ppm/℃'], [5, 4, '蓝=10ppm', 0x0000FF, '10ppm/℃'], _
[5, 5, '紫=5ppm', 0x800080, '5ppm/℃']]
Dim $i, $i_from, $i_to, $Radio[54]
$Form1 = GUICreate("Form1", 623, 449)
$Label1 = GUICtrlCreateLabel("Label1", 168, 48, 55, 25, $SS_SUNKEN)
$Label2 = GUICtrlCreateLabel("Label1", 228, 48, 55, 25, $SS_SUNKEN)
$Label3 = GUICtrlCreateLabel("Label1", 287, 48, 55, 25, $SS_SUNKEN)
$Label4 = GUICtrlCreateLabel("Label1", 347, 48, 55, 25, $SS_SUNKEN)
$Label5 = GUICtrlCreateLabel("Label1", 406, 48, 55, 25, $SS_SUNKEN)
$Label6 = GUICtrlCreateLabel("Label1", 466, 48, 55, 25, $SS_SUNKEN)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Label1
_SubGUI(0, 9, $nMsg)
Case $Label2
_SubGUI(10, 19, $nMsg)
Case $Label3
_SubGUI(20, 29, $nMsg)
Case $Label4
_SubGUI(30, 39, $nMsg)
Case $Label5
_SubGUI(40, 47, $nMsg)
Case $Label6
_SubGUI(48, 53, $nMsg)
EndSwitch
WEnd
Func _SubGUI($i_from, $i_to , $iCtrlID)
$Pos = MouseGetPos()
$SubGUI = GUICreate("", 100, 270, $Pos[0], $Pos[1], $Form1)
GUISetFont(14)
For $i = $i_from To $i_to
$Radio[$i] = GUICtrlCreateRadio($Radios[$i][2], 0, 25 * ($i - $i_from), 90, 25)
GUICtrlSetBkColor(-1, $Radios[$i][3])
Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete($SubGUI)
Return
Case $Radio[$i_from] To $Radio[$i_to]
$index = $i_from + $nMsg -$Radio[$i_from]
GUICtrlsetBkColor($iCtrlID, $Radios[$index][3])
EndSwitch
If WinGetHandle('[active]') <> $SubGUI Then
GUIDelete($SubGUI)
Return
EndIf
WEnd
EndFunc ;==>_SubGUI
|