#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.18.0 Author: Kanashius Script Function: Example Script for the TreeListExplorer UDF showcasing a simple Example for an Input, TreeView and ListView. #ce ---------------------------------------------------------------------------- #include "TreeListExplorer.au3" ; StartUp of the TreeListExplorer UDF (required) __TreeListExplorer_StartUp() If @error Then ConsoleWrite("__TreeListExplorer_StartUp failed: "&@error&":"&@extended&@crlf) Global $iWidth = 800, $iHeight = 800, $iSpace = 5, $iCtrlHeight = 25, $iTop = $iSpace, $iCtrlWidth = $iWidth-2*$iSpace Global $iLargeCtrlHeight = ($iWidth-$iSpace*6-$iCtrlHeight*4) ; create gui Local $hGui = GUICreate("TreeListExplorer Example", $iWidth, $iHeight) Local $idInput = GUICtrlCreateInput("", $iSpace, $iTop, $iCtrlWidth, $iCtrlHeight) $iTop += $iCtrlHeight+$iSpace Local $idCombo = GUICtrlCreateCombo("", $iSpace, $iTop, $iCtrlWidth, $iCtrlHeight, BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL)) ; BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL) $iTop += $iCtrlHeight+$iSpace Local $hComboEx = _GUICtrlComboBoxEx_Create($hGui, "", $iSpace, $iTop, $iCtrlWidth, $iCtrlHeight) ; BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL) $iTop += $iCtrlHeight+$iSpace Local $idListView = GUICtrlCreateListView("", $iSpace, $iTop+110, $iCtrlWidth, $iLargeCtrlHeight-110) $iTop += $iLargeCtrlHeight+$iSpace Local $idSlider = GUICtrlCreateSlider($iSpace, $iTop, $iCtrlWidth, $iCtrlHeight) GUICtrlSetLimit($idSlider, 128, 10) GUICtrlSetData($idSlider, 16) ; Create a TreeListExplorer (TLE) system, where multiple controls are connected to Local $hTLE = __TreeListExplorer_CreateSystem($hGui, Default, "_folderOpened", "_selectionChanged") ; Add the Input control to the TLE system __TreeListExplorer_AddView($hTLE, $idInput) If @error Then ConsoleWrite("__TreeListExplorer_AddView $idInput failed: "&@error&":"&@extended&@crlf) ; Add the TreeView control to the TLE system __TreeListExplorer_AddView($hTLE, $idListView) If @error Then ConsoleWrite("__TreeListExplorer_AddView $idListView failed: "&@error&":"&@extended&@crlf) ; Add the ListView control to the TLE system __TreeListExplorer_AddView($hTLE, $hComboEx) If @error Then ConsoleWrite("__TreeListExplorer_AddView $hComboEx failed: "&@error&":"&@extended&@crlf) __TreeListExplorer_ComboSetDropDownHeight($hComboEx, 300) __TreeListExplorer_AddView($hTLE, $idCombo) If @error Then ConsoleWrite("__TreeListExplorer_AddView $idCombo failed: "&@error&":"&@extended&@crlf) GUISetState(@SW_SHOW) while True Switch GUIGetMsg() Case -3 ; Shutdown of the TreeListExplorer UDF __TreeListExplorer_Shutdown() Exit Case $idSlider ConsoleWrite("IconSize: "&GUICtrlRead($idSlider)&@crlf) __TreeListExplorer_SetViewIconSize($idListView, GUICtrlRead($idSlider)) __TreeListExplorer_SetViewIconSize($hComboEx, GUICtrlRead($idSlider)) ; Careful: This also changes the control height EndSwitch WEnd Func _selectionChanged($hSystem, $sRoot, $sFolder, $sSelected) ConsoleWrite("Selected: "&$hSystem&"> "&$sRoot&$sFolder&"["&$sSelected&"]"&@crlf) EndFunc Func _folderOpened($hSystem, $sRoot, $sFolder, $sSelected) ConsoleWrite("Opened: "&$hSystem&"> "&$sRoot&$sFolder&"["&$sSelected&"]"&@crlf) EndFunc