Ticket #1011: 2.au3

File 2.au3, 2.1 KB (added by Qsek, 15 years ago)

Attachment to Ticket #1011

Line 
1#Include <GuiListView.au3>
2#include <ListViewConstants.au3>
3#include <WindowsConstants.au3>
4#Include <GUIConstantsEx.au3>
5
6
7Opt("GUIOnEventMode", 1)
8
9$Gui = GUICreate("LV Test", 750, 590, 191, 113)
10
11        $Guiplist1 = GUICtrlCreateListView("Name                                                |Score|Kills", 8, 120, 121*3, 431, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS), BitOR($LVS_EX_HEADERDRAGDROP, $LVS_EX_FULLROWSELECT,$LVS_EX_GRIDLINES,$LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES))
12               
13                _GUICtrlListView_AddItem($Guiplist1, "TestItem1 with param 1",-1,1)
14                _GUICtrlListView_AddItem($Guiplist1, "TestItem2 with param 2",-1,2)
15                _GUICtrlListView_AddItem($Guiplist1, "TestItem3 with param 3",-1,3)
16                _GUICtrlListView_AddItem($Guiplist1, "TestItem4 with param 4",-1,4)
17                _GUICtrlListView_AddItem($Guiplist1, "TestItem5 with param 5",-1,5)
18                _GUICtrlListView_AddItem($Guiplist1, "TestItem6 with param 0",-1,0)
19                _GUICtrlListView_AddItem($Guiplist1, "TestItem7 with param 10",-1,10)
20               
21                $Butt1 = GUICtrlCreateButton("Test Button 1",8,90,120,20)
22                GUICtrlSetOnEvent(-1,"TestB1")
23                $Butt2 = GUICtrlCreateButton("Test Button 2",8+130,90,120,20)
24                GUICtrlSetOnEvent(-1,"TestB2")
25                $Butt3 = GUICtrlCreateButton("Test Button 3",8+130*2,90,120,20)
26                GUICtrlSetOnEvent(-1,"TestB3")
27                $Butt4 = GUICtrlCreateButton("Test Button 4",8+130*3,90,120,20)
28                GUICtrlSetOnEvent(-1,"TestB4")
29               
30       
31                ConsoleWrite($Butt1&","&$Butt2&","&$Butt3&","&$Butt4& @CRLF)
32               
33GUISetOnEvent($Gui_EVENT_CLOSE, "Close", $Gui)
34
35GUISetState()
36
37ConsoleWrite("SetText: "& ControlSetText ( $gui, "", 10 ,"test") & @CRLF)
38
39
40Func Close()
41        Exit
42EndFunc   ;==>Close
43
44
45While 1
46        Sleep(10)
47WEnd
48; ################# ######### #################
49
50
51
52Func TestB1()
53        ConsoleWrite("Button1 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
54EndFunc
55
56Func TestB2()
57        ConsoleWrite("Button2 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
58EndFunc
59
60Func TestB3()
61        ConsoleWrite("Button3 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
62EndFunc
63
64Func TestB4()
65        ConsoleWrite("Button4 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
66EndFunc
67