How to read items??
#21
Posted 22 February 2012 - 09:16 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
#22
Posted 22 February 2012 - 09:40 PM
#23
Posted 22 February 2012 - 10:23 PM
$sPath = StringReplace(@DesktopDir, "AutoIt3.exe", "") $aFiles = _FileListToArray($sPath, "*.*", 1) For $i = 1 To $aFiles[0] GUICtrlSetData($List1, $aFiles[$i]) Next
If i change this is it possible to make it load spesific kind of files???
or whatever files img, txt etc..
Edited by ileandros, 22 February 2012 - 10:23 PM.
#24
Posted 22 February 2012 - 10:30 PM
You would need to use "*.log" as the mask and run it again for each separate extension.
But if you use my RecFileListToArray UDF you can search for several extensions in one pass, as BrewManNH suggested above:
$aArray = _RecFileListToArray($sPath, "*.exe;*.bat;*.au3", 1)
And the UDF will also search within subfolders if you wish.
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#26
Posted 22 February 2012 - 10:38 PM
Have you downloaded the UDF and put in the same folder as the script?
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#27
Posted 22 February 2012 - 10:47 PM
#28
Posted 22 February 2012 - 10:49 PM
So what exactly is the "error" you get?
M23
Edit: You need #include "RecFileListToArray.au3" - does that help?
Edited by Melba23, 22 February 2012 - 10:50 PM.
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#29
Posted 22 February 2012 - 11:04 PM
I corrected all the errors the only prob now that it doesnt load any files...
#30
Posted 22 February 2012 - 11:08 PM
I used ur method but with the code ur giving above it only read .exe why not the others since they are in the code???
#31
Posted 22 February 2012 - 11:11 PM
Why ate the 2 first there is ; and tha the last (au3) there is not???
#32
Posted 23 February 2012 - 08:45 AM
I have no idea - do you have files with all 3 extensions in the folder you are searching?
As usual in your threads I find I have to ask you to post the code you have been using - please help us to help you.
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#33
Posted 24 February 2012 - 12:54 PM
I just asked why there is this (
$aArray = _RecFileListToArray($sPath, "*.exe;*.bat;*.au3", 1)
in ur method.
Just a question for information nothing more.
Edited by ileandros, 24 February 2012 - 12:56 PM.
#34
Posted 24 February 2012 - 01:16 PM
I understand now - I added the .au3 because BrewManNH had used those 3 extensions in his post at the top of the page.
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#35
Posted 24 February 2012 - 01:55 PM
P.S. this is the control to set the state of something
What the heck is the command to undothat.
i dont mean this
I mean to remove 1 item not to clear the $test state
Edited by ileandros, 24 February 2012 - 02:03 PM.
#36
Posted 24 February 2012 - 02:11 PM
How to ask questions the smart way!
Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
#37
Posted 24 February 2012 - 02:59 PM
Obviously I did not understand - but neither did you read the function header for _RecFileListToArray where it clearly states:
$sInclude_List - Optional: filter for included results (default "*"). Multiple filters must be separated by ";"
So I reckon we are even at worst.
For your next question - what do you mean by "remove 1 item"? Do you mean delete the control entirely? If so then GUICtrlDelete is what you are looking for.
If not, then please explain in slightly less cryptic terms. I realise English is not your first language, but it woudl help us help you if you explained your problems in a bit more detail when you post. A few words and a couple of lines of code is often not enough to let us guess what you are actually looking for - as evidenced by many of the earlier posts in this thread.
M23
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#38
Posted 24 February 2012 - 05:11 PM
IF you want to handle populating controls with GuiCtrlSetData than you need to manipulate the variable "$test1" and re-populate the control "$test" at every change.
kylomas
#39
Posted 25 February 2012 - 12:00 AM
#40
Posted 25 February 2012 - 08:19 AM
Now you have explained what you want - here is how you might do it:
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> #include <GuiListBox.au3> #include <File.au3> ; Get the path of the AutoIt exe $sPath = StringReplace(@AutoItExe, "AutoIt3.exe", "") ; Read all the files on that path into an array $aFiles = _FileListToArray($sPath, "*.*", 1) ; Create a GUI $hGUI = GUICreate("Test", 500, 500) ; Create a list $cList = GUICtrlCreateList("", 10, 10, 200, 200) ; And fill it with our data For $i = 1 To $aFiles[0] GUICtrlSetData($cList, $aFiles[$i]) Next ; Create a button and label $cButton = GUICtrlCreateButton("Delete", 10, 300, 80, 30) $cLabel = GUICtrlCreateLabel("", 100, 310, 200, 20) GUISetState() ; Look for doubleclicks on the list GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton ; If there is a selection to delete If GUICtrlRead($cLabel) <> "" ; Which one is it $iIndex = _GUICtrlListBox_SelectString($cList, GUICtrlRead($cLabel)) ; Delete it _GUICtrlListBox_DeleteString($cList, $iIndex) ; Clear the label GUICtrlSetData($cLabel, "") EndIf EndSwitch WEnd Func _WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nCode = BitShift($wParam, 16) ; HiWord Local $nIDFrom = BitAND($wParam, 0xFFFF) ; LoWord Switch $nIDFrom ; If from the list Case $cList Switch $nCode ; If a double click Case $LBN_DBLCLK ; Read selected item $sListItem = GUICtrlRead($cList) ; Display selected item GUICtrlSetData($cLabel, $sListItem) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND
As I have said to you many times before - help us to help you. Take the time to explain the problem you are having, perhaps even write a small reproducer script. A couple of cryptic remarks and a few lines of code do not allow us to do much other than offer guesses or simply ask for a better explanation. Many of the posts in this thread are only there because we needed to drag more information out of you - my typing fingers and keyboard would be grateful for more explanation from you initially. OK?
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users






