ioctl Posted July 13, 2005 Share Posted July 13, 2005 I have a GUI with a disabled Tree. I also have two button "check all" and "clear all".Why these buttons working if the tree is disabled??Any ideas to solve this problem? Thanks.Here is the code:; Script Start -->#include <GuiConstants.au3>; GUIGUICreate("test - ATK",530,400,-1,-1,BitOr($WS_MINIMIZEBOX,$WS_GROUP,$WS_CAPTION,$WS_POPUP,$WS_SYSMENU))GuiSetIcon(@SystemDir & "\mobsync.exe", 0);Buttons$Test = GuiCtrlCreateButton("Install Selected", 380, 230, 100, 20)$Settings = GUICtrlCreateButton ("Settings", 380, 255, 100, 20)$Button_Checkall = GuiCtrlCreateButton("Check All", 380, 280, 100, 20)$Button_Clearall = GuiCtrlCreateButton("Clear All", 380, 305, 100, 20)$Readmebutton = GUICtrlCreateButton ("Readme", 380 ,330, 100, 20)$Exit = GUICtrlCreateButton ("Exit", 380, 355, 100, 20)Dim $Icon[9],$Checkbox[9],$Label[9],$Installs[9]$Checkbox[0] = 8$Installs[0] = 8;INSTALLS$Installs[1] = "cmd.exe"$Installs[2] = "mspaint.exe"$Installs[3] = "notepad.exe"$Installs[4] = "cmd.exe"$Installs[5] = "calc.exe"$Installs[6] = "wordpad.exe"$Installs[7] = "mspaint.exe"$Installs[8] = "notepad.exe";TREE$maingroup = GUICtrlCreateGroup ("Select your mode",5,10,180,195)$maintree = GUICtrlCreateTreeView (15,30,160,165,BitOr($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)$treeItem1 = GuiCtrlCreateTreeViewItem("OPEN", $maintree)$OPEN_NO_ENCRYPTION = GuiCtrlCreateTreeViewItem("NO ENCRYPTION", $treeItem1);EMPTY BOX$EMPTY_GROUP = GUICtrlCreateGroup ("",185,10,342,195)$EMPTY_TREE = GUICtrlCreateTreeView (192,30,328,165,BitOr($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_CHECKBOXES,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)$OPTIONS = GUICtrlCreateGroup ("Options",360,210,140,172)$DESC = GUICtrlCreateGroup ("Description",5,210,342,172);Start - Finish Messages$Checkbox[1] = GuiCtrlCreateCheckbox("INSTALL 1", 1, 1, 1, 1)GUICtrlSetState(-1, $GUI_CHECKED + $GUI_HIDE + $GUI_DISABLE)$Checkbox[8] = GuiCtrlCreateCheckbox("INSTALL 8", 1, 1, 1, 1)GUICtrlSetState(-1, $GUI_CHECKED + $GUI_HIDE + $GUI_DISABLE);OPEN NO ENCRYPTION$NO_ENCRYPTION_GROUP = GUICtrlCreateGroup ("PROGRAMS",185,10,342,195)GUICtrlSetState (-1,$GUI_HIDE)$NO_ENCRYPTION_TREE = GUICtrlCreateTreeView (192,30,328,165,BitOr($TVS_HASBUTTONS,$TVS_CHECKBOXES,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)GUICtrlSetState (-1,$GUI_HIDE)$Checkbox[2] = GUICtrlCreateTreeViewItem ("INSTALL 2",$NO_ENCRYPTION_TREE)$Checkbox[3] = GUICtrlCreateTreeViewItem ("INSTALL 3",$NO_ENCRYPTION_TREE)$Checkbox[4] = GUICtrlCreateTreeViewItem ("INSTALL 4",$NO_ENCRYPTION_TREE)$Checkbox[5] = GUICtrlCreateTreeViewItem ("INSTALL 5",$NO_ENCRYPTION_TREE)$Checkbox[6] = GUICtrlCreateTreeViewItem ("INSTALL 6",$NO_ENCRYPTION_TREE)$Checkbox[7] = GUICtrlCreateTreeViewItem ("INSTALL 7",$NO_ENCRYPTION_TREE);DISABLE TREEGUICtrlSetState($NO_ENCRYPTION_TREE, $GUI_DISABLE); GUI MESSAGE LOOPGuiSetState()While 1$msg = GUIGetMsg()Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $ExitExitLoop Case $msg = $treeItem1GUIctrlSetState ($NO_ENCRYPTION_GROUP,$GUI_HIDE)GUIctrlSetState ($NO_ENCRYPTION_TREE,$GUI_HIDE)GUIctrlSetState ($EMPTY_GROUP,$GUI_SHOW)GUIctrlSetState ($EMPTY_TREE,$GUI_SHOW)Case $msg = $OPEN_NO_ENCRYPTIONGUIctrlSetState ($EMPTY_GROUP,$GUI_HIDE)GUIctrlSetState ($EMPTY_TREE,$GUI_HIDE)GUIctrlSetState ($NO_ENCRYPTION_GROUP,$GUI_SHOW)GUIctrlSetState ($NO_ENCRYPTION_TREE,$GUI_SHOW) ; CHECK ALL BOXES Case $msg = $Button_Checkall for $i = 1 to $CheckBox[0]GUICtrlSetState($Checkbox[$i], $GUI_CHECKED)Next; CLEAR ALL BOXESCase $msg = $Button_Clearall for $i = 1 to $CheckBox[0]GUICtrlSetState($Checkbox[$i], $GUI_UNCHECKED)GUICtrlSetState($Checkbox[1], $GUI_CHECKED)GUICtrlSetState($Checkbox[8], $GUI_CHECKED)Next;SettingsCase $msg = $Settings GUISetState ( @SW_HIDE ) RunWait ("Settings\settings.exe") GUISetState ( @SW_SHOW );INSTALL SELECTEDCase $msg = $Test$Temp = 0For $i = 2 To 7 If (BitAnd(GUICtrlRead($CheckBox[$i]),$GUI_UNCHECKED)) Then $Temp = $Temp + 1 EndIfNextIf $Temp = 6 Then MsgBox(0, "test", "No Installs selected!")For $i = 1 To 8 If (BitAnd(GUICtrlRead($CheckBox[$i]),$GUI_CHECKED)) Then RunWait($Installs[$i]) EndIfNext Case Else EndSelectWEndExit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now