Jump to content

Solchael

Members
  • Posts

    6
  • Joined

  • Last visited

Solchael's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Just adding two line did fix this issue : _GUICtrlTreeView_BeginUpdate($idTreeView) _GUICtrlTreeView_EndUpdate($idTreeView) Regards, Solchael
  2. Well I did wrote that : #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiTreeView.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $ahItem1, $ahItem2, $ahItem3, $aidChildItem1, $aidChildItem2, $aidChildItem3, $aidChildItem4, $aidChildItem5, $aidChildItem6, $aidChildItem7, $aidChildItem8, $aidChildItem9, $idTreeView Global $bhItem1 Example() Func Example() Local $iStyle = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_CHECKBOXES)     GUICreate("TreeView Set State Image Index", 400, 300)     GUISetState(@SW_SHOW)     $idTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)         #Region $ahItem1         $ahItem1 = GUICtrlCreateTreeViewItem("Papa0", $idTreeView)         _GUICtrlTreeView_SetStateImageIndex($idTreeView, $ahItem1, 0)             $aidChildItem1 = GUICtrlCreateTreeViewItem( "Enfant01",$ahItem1 )             $aidChildItem2 = GUICtrlCreateTreeViewItem( "Enfant02",$ahItem1 )             $aidChildItem3 = GUICtrlCreateTreeViewItem( "Enfant03",$ahItem1 )         #EndRegion $ahItem1         #Region $ahItem2         $ahItem2 = GUICtrlCreateTreeViewItem("Papa1", $idTreeView)         _GUICtrlTreeView_SetStateImageIndex($idTreeView, $ahItem2, 0)             $aidChildItem4 = GUICtrlCreateTreeViewItem( "Enfant11",$ahItem2 )             $aidChildItem5 = GUICtrlCreateTreeViewItem( "Enfant12",$ahItem2 )             $aidChildItem6 = GUICtrlCreateTreeViewItem( "Enfant13",$ahItem2 )         #EndRegion $ahItem2         #Region $ahItem3         $ahItem3 = GUICtrlCreateTreeViewItem("Papa2", $idTreeView)         _GUICtrlTreeView_SetStateImageIndex($idTreeView, $ahItem3, 0)             $aidChildItem7 = GUICtrlCreateTreeViewItem( "Enfant21",$ahItem3 )             $aidChildItem8 = GUICtrlCreateTreeViewItem( "Enfant22",$ahItem3 )             $aidChildItem9 = GUICtrlCreateTreeViewItem( "Enfant23",$ahItem3 )         #EndRegion $ahItem3 If _GUICtrlTreeView_GetChecked($idTreeView, $ahItem1) Then MsgBox($MB_SYSTEMMODAL, "Information", "Checked")     Do     Until GUIGetMsg() = $GUI_EVENT_CLOSE     GUIDelete() EndFunc   ;==>Example Working quite fine (except the [+] button on the last Parents missing, but if I do hover my mousse on it, it does appear not sure what is the issue though) : Don't look at this line (it doesn't work) : If _GUICtrlTreeView_GetChecked($ahItem1, $aidChildItem1) Then MsgBox($MB_SYSTEMMODAL, "Information", "Checked") I am just trying to understand how to catch the event when someone click on this specific checkbox). Seems I can hide the parents checkbox mixing both. Regards, Solchael
  3. Hello, I am not new here, but usually using others issue / topic to solve mine ! I am trying to use some TreeView. I was wondering is it possible to mix the Native command with UDF one ? Or it's not suggested ? Regards, Solchael
  4. Thank you. I just didn't read properly the Function InputBox .... It's clearly written ... Maybe I need another pair of glasses : Return Value Success: the string that was entered. Failure: "" (empty string) and sets the @error flag to non-zero. @error: 1 = The Cancel button was pushed. 2 = The Timeout time was reached. 3 = The InputBox failed to open. This is usually caused by bad arguments. 4 = The InputBox cannot be displayed on any monitor. 5 = Invalid parameters width without height or left without top. Thank you very much for the info. Couldn't find it. Regards, Solchael
  5. EDIT : Seems I can't edit my own post. But the code is of course wrong because : "If $iTimeout <> 0" can't be a good condition, I tested with "If $iTimeout = 0"
  6. Hello everyone, how are you all ? I am new here, so I hope it's the right place to ask. If no, then apologies and if a moderator can move it to the correct section. I am completly new to coding and new to AutoIt. And I am trying to get the result of the Timeout of a MsgBox. IE : If timeout is over then desplay a message Else continue the code : $iTimeout = 10 $s_currentday = InputBox ("Tutoriel" , "Which day of the week are we??", "Enter a day" , "" , 200, 130, Default, Default, $iTimeout) If $iTimeout <> 0 then MsgBox ( 16, "Tutoriel", "Too long to answer, programe will close!!") Else Switch $s_currentday Case "Monday" MsgBox ( 0, "Tutoriel", "It's only the start of the week!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "It's the start of an awesome week!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be a better day!") EndIf Case "Tuesday" MsgBox ( 0, "Tutoriel", "Second day of the week!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "Let's make this week and amazing one!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be a better day!") EndIf Case "Wednesday" MsgBox ( 0, "Tutoriel", "Third day of the week!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox == 6 Then MsgBox ( 0, "Tutoriel", "Half of the week and yet more good stuff to come!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be a better day!") EndIf Case "Thursday" MsgBox ( 0, "Tutoriel", "Closer to the weekend!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "We are close to end the week! Keep that positive mind") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be a better day!") EndIf Case "Friday" MsgBox ( 0, "Tutoriel", "Almost weekend!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "It's the start of an awesome weekend! Think of what you are going to do!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be a better day! Maybe you can go out and have a drink with your friends?") EndIf Case "Saturday" MsgBox ( 0, "Tutoriel", "It's the start of the weekend!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "It's the start of an awesome weekend!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow is Sunday, you can rest and have a good day with your friends and/or family!") EndIf Case "Sunday" MsgBox ( 0, "Tutoriel", "We are almost at the end of the week!") $mybox = MsgBox ( 4, "Tutoriel", "Do you feel good?") If $mybox = 6 Then MsgBox ( 0, "Tutoriel", "It's the end of an awesome week! And I am sure that the next one will be even better!") ElseIf $mybox = 7 Then MsgBox ( 0, "Tutoriel", "Don't worry tomorrow will be the start of a new week! So new chance to feel better") EndIf EndSwitch EndIf Sorry for my bad english, not my main language. Thanks in advance, Solchael
×
×
  • Create New...