[решено] TreeView с чекбоксами

Ответить
Аватара пользователя
crashtuak

[решено] TreeView с чекбоксами

Сообщение crashtuak »

Вот есть код т деревом без чекбоксов:



Код:

Код: Выделить всё

#include 
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 448, 193, 125)
$TreeView1 = GUICtrlCreateTreeView(8, 8, 209, 153)
$TreeView1_0 = GUICtrlCreateTreeViewItem("qwerty", $TreeView1)
$TreeView1_1 = GUICtrlCreateTreeViewItem("qwe1", $TreeView1_0)
$TreeView1_2 = GUICtrlCreateTreeViewItem("qwe2", $TreeView1_0)
$Button1 = GUICtrlCreateButton("Button1", 224, 8, 65, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			MsgBox(0, "Test", "This box will show test text")
	EndSwitch
WEnd

Делался с помощью Koda.

В Koda делаю дерево с чекбоксами, генерирует такой код:



Код:

Код: Выделить всё

#include 
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 448, 193, 125)
$TreeView1 = GUICtrlCreateTreeView(8, 8, 209, 153, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$TVS_CHECKBOXES,$WS_GROUP,$WS_TABSTOP))
$TreeView1_0 = GUICtrlCreateTreeViewItem("qwerty", $TreeView1)
$TreeView1_1 = GUICtrlCreateTreeViewItem("qwe1", $TreeView1_0)
$TreeView1_2 = GUICtrlCreateTreeViewItem("qwe2", $TreeView1_0)
$Button1 = GUICtrlCreateButton("Button1", 224, 8, 65, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
	EndSwitch
WEnd

При попытке запустить скрипт:



Код:

Код: Выделить всё

>"F:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "F:\Documents and Settings\CrashTUA\Local Settings\Temp\test.au3"    
F:\Documents and Settings\CrashTUA\Local Settings\Temp\test.au3 (5) : ==> Variable used without being declared.:
$TreeView1 = GUICtrlCreateTreeView(8, 8, 209, 153, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$TVS_CHECKBOXES,$WS_GROUP,$WS_TABSTOP))
$TreeView1 = GUICtrlCreateTreeView(8, 8, 209, 153, BitOR(^ ERROR
>Exit code: 1    Time: 0.225

Кто поможет?
Аватара пользователя
crashtuak

Re: [решено] TreeView с чекбоксами

Сообщение crashtuak »

Ну нашел проблему, надо было дописать:



Код:

Код: Выделить всё

#include 
#include 
Ответить

Вернуться в «AutoIt»