Jump to content

Search the Community

Showing results for tags 'dynamically'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi people, I'm trying to dynamically populate a TreeView based on a script from Water that I modified for my needs. but I can't figured it out how to make it work. Here what I have in case anyone can help me, thanks in advance: #include <array.au3> #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> Local $aTV1[14][3] = [ _ ['1', 'Text 1', -1], _ ;-1 idicates it's an index item ['2', 'Text 2',-1], _ ['3', 'Text 3',-1], _ ['1-1', 'Text 1-1',0], _ ['1-2', 'Text 1-2',0], _ ['2-1', 'Text 2-1',0], _ ['2-2', 'Text 2-2',0], _ ['2-1-1', 'Text 2-1-1',0], _ ['2-1-2', 'Text 2-1-2',0], _ ['2-1-2-1', 'Text 2-1-2-1',0], _ ['2-1-2-1-1', 'Text 2-1-2-1-1',0], _ ['3-1', 'Text 3-1',0], _ ['3-1-1', 'Text 3-1-1',0], _ ['3-1-1-1', 'Text 3-1-1-1',0]] ;_ArrayDisplay($aTV1) Local $Gui = GUICreate('TreeView Example', 500, 600) Local $tv = GUICtrlCreateTreeView(10, 30, 450, 550) GUISetState() _pop_treeview($tv, $aTV1) While 1 Switch GUIGetMsg() Case $gui_event_close Exit EndSwitch WEnd Func _pop_treeview($hTV, $array) Local $TimeInitial = TimerInit(), $Hours, $Mins, $Secs, $item _ArraySort($array, 0, 0, 0, 0) ;------------------------- sort Ascending on column 0 ;_ArrayDisplay($array) $idxroot = _GUICtrlTreeView_Add($hTV, 0, "index") For $i = 0 To UBound($array) - 1 ConsoleWrite("$array[" & $i & "][" & 0 & "] = " & $array[$i][0] & @CRLF) If $array[$i][0] = '' Then ExitLoop ;--------------- Exit at first empty element $item = '' If $array[$i][2] = -1 Then ;------------------------ Add root element _GUICtrlTreeView_AddChild($hTV, $idxroot, $array[$i][1]) Else $item = StringLeft($array[$i][0], StringInStr($array[$i][0], "-", 1, -1) - 1) ConsoleWrite("$item = " & $item & @CRLF) $Found = _ArrayBinarySearch($array, $item, 0, 0, 0) ;search on column 0 Switch $Found Case 0 ;----------------------------------- Value wasn't found in array ConsoleWrite("Item NOT found @error= " & @error & @CRLF) Case Else ConsoleWrite("Item found " & @CRLF) _GUICtrlTreeView_AddChild($hTV, $Found, $array[$i][1]) EndSwitch EndIf Next _GUICtrlTreeView_Expand($hTV) EndFunc ;==>_pop_treeview
×
×
  • Create New...