randallc Posted May 28, 2006 Share Posted May 28, 2006 (edited) 120 [correction] in zip includes comparing LVs to delete _108; inbuilt DeleteDuplicates 0_97 faster remove dupes, arraydeletevbs version to 0_80 now; July5th; Checkboxes and icon sort; exe incl, not image pics. [lines needing Array2D.au3 remmed out (only needed for Win9x compat, and slower anyway)] version to 0_57 now; June 15th; more complex [example working is Filebrowser below] [NOte - needs Win2K at least for the DOS and maybe vbs commands...] - Example with checkboxes on toolbar With tabs and calendar on toolbar [needs "slider.au3"] Hi, If you are frustrated by ListView; 1. Slow Sort [Can the register sort speed things up?; I cannot get it to...] 2. No Display of items over 4000 This may be for you. [10-100x times faster; the more items, the faster relatively; guaranteed <1sec unless over 4000 items ( starts to slow down) or using _GUIsetImage; still <4 secs instead of up to ?40!] USAGE [** at present, only works for simple ListView report, ? not icons etc, can't modify.. etc] A. Include"_GUICtrlListView.au3" B. Change any previous script with these 7 functions; 1. GUICtrlSetImage, [** delete these; use "FileSetIconDefault " and then icons are automatic within limits; change limits with "$i_DefaultIconNumber=300" etc] 2.._GUICtrlListViewSort, 3..GUICtrlCreateListViewItem, 4..GUICtrlCreateListView 5..__FileListToArray 6.._FileSetIconDefault -** use this to add icons; see FileBrowser examplle; sppeds icon display; sets default icon by checking max number of filetypes in the list first; or set it yourself 7..__GUICtrlListViewDeleteAllItems to add an extra underscore at the start;[ _GUICtrlSetImage],__GUICtrlListViewSort[so ends up with 2 underscores],_GUICtrlCreateListViewItem,_GUICtrlCreateListView C. Run as usual Let me know if it's useful, I'll add more functions Best, Randall EXAMPLES; cf icon sorting demo; default icon number shown 300; change by "$i_DefaultIconNumber=300" etc [New func also "_GUIListViewClose()" if you will redraw the Listview in same running script - changed ; now included in new "__GUICtrlListViewDeleteAllItems " expandcollapse popup;_GUICtrlListViewSorter.au3 0_12 #include-once #include "_GUICtrlListView.au3" ;declares following; global $ar_LISTVIEW[4001],$ar_LISTVIEWArray[4001],$s_LISTVIEWSortOrder="ASC",$i_LISTVIEWNumItemsView,$i_LISTVIEWPrevcolumn=-1 ;#opt('MustDeclareVars', 1) Dim $searchGUI,$listview, $Btn_Exit, $msg, $Status, $Btn_Insert, $ret, $Input_Index,$timerstamp $searchGUI = GUICreate("ListView Sort", 810, 623, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2,$WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) $listview = _GUICtrlCreateListView("col1|col2|col3", 10, 10, 790, 530, -1, BitOR($LVS_EX_REGIONAL, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) $timerstamp1 = TimerInit() for $i=1 to 4000; it also works quicker over 4000, but starts slowing down as "_GUICtrlListViewInsertItem" used $s_RandomListItem="line"&Random(-10000, 10000, 1)&"|"&Random(-10000, 10000, 1)&"|more_"&Chr(Random(Asc("a"), Asc("z"), 1))&Chr(Random(Asc("a"), Asc("z"), 1))&String(Random(-10000, 10000, 1)) _GUICtrlCreateListViewItem($s_RandomListItem, $listview) next ConsoleWrite("Time New :"&TimerDiff($timerstamp1) & " mseconds to search."&@lf) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) GUISetState() Dim $B_DESCENDING[_GUICtrlListViewGetSubItemsCount ($listview) ];only needed for slow sort method While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit global $ar_LISTVIEW[1],$ar_LISTVIEWArray[1]; only if want to free memory at end, and scrip still running? ExitLoop Case $msg = $listview $i_Index=GUICtrlGetState($listview) ; sort the list by the column header clicked on $timerstamp1 = TimerInit() __GUICtrlListViewSort( $listview,$B_DESCENDING,$i_Index) $i_Time1=TimerDiff($timerstamp1) ;$timerstamp1 = TimerInit() ;_GUICtrlListViewSort($listview, $B_DESCENDING, GUICtrlGetState($listview)) ;$i_Time2=TimerDiff($timerstamp1) ;ConsoleWrite("Time Trad :"&$i_Time2 & " mseconds to search."&@lf) ;__GUICtrlListViewSort( $listview,$B_DESCENDING,$i_Index) ;ConsoleWrite("Time New :"&$i_Time1 & " mseconds to search."&@lf) ;MsgBox(0,"","ratio :"&round($i_Time2/$i_Time1,2) & " ."&@lf&"TimeOld1="&round($i_Time2,2) & " ."&@lf&"TimeNEW="&round($i_Time1,2) & " ."&@lf,2) MsgBox(0,"","TimeNEW="&round($i_Time1,2) & " ."&@lf) ;ConsoleWrite("ratio :"&round($i_Time2/$i_Time1,2) & " ."&@lf) EndSelect WEnd Exit Note - you do not need "Dim $B_DESCENDING[_GUICtrlListViewGetSubItemsCount ($listview) ]", but still need to declare it "Local $B_DESCENDING", unless you are going to test against old sort. Hi, I think this is working on all international settings, with sliding toolbar, icons, and fast sort?... So I have deleted versions I wrote which were not compatible... Best, randall GUICtrlListView.au3, ListView GUI Fast Sort Edited October 16, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
arcker Posted May 28, 2006 Share Posted May 28, 2006 (edited) I've juste integrated in my "lastfilebrowser" program and...simply amazing... the list not "clink" anymore while sorting and it's fast, so fast ! i don't know how did you manage it, but i hope your functions will replace the old ones good job man c u edit : your sort function doesn't work when list view is empty...i know i have to add a work around, but it's just to inform btw : it's only possible to pass by vbs (like some functions i've created too ?) ? Edited May 29, 2006 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013Â Get it Here [/list] Link to comment Share on other sites More sharing options...
randallc Posted May 29, 2006 Author Share Posted May 29, 2006 (edited) I've juste integrated in my "lastfilebrowser" programPlease remind me the link to your program? your sort function doesn't work when list view is emptyOK, fixed in first post. it's only possible to pass by vbs (like some functions i've created too ?)I'd like to answer about the scripting control for vbs, but I am not sure of your question; you could write this file with AutoIt instead, but vbs gives the array sorting speed... ;_GUICtrlListViewSorter.au3 0_15 #include-once #include "_GUICtrlListView.au3" Dim $searchGUI,$listview, $Btn_Exit, $msg, $Status, $Btn_Insert, $ret, $Input_Index,$timerstamp $searchGUI = GUICreate("ListView Sort", 810, 623, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2,$WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) $listview = _GUICtrlCreateListView("Index |col1 |col2|col3", 10, 10, 790, 530, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_GRIDLINES, $LVS_EX_HEADERDRAGDROP, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL));Drag&Drop Columns _GUICtrlSetImage($listview, "mmcndmgr.dll", 96) ;Set Icons for records $timerstamp1 = TimerInit() for $i=1 to 4000; it also works quicker over 4000, but starts slowing down as "_GUICtrlListViewInsertItem" used $s_RandomListItem=$i&"|line"&Random(-10000, 10000, 1)&"|"&Random(-10000, 10000, 1)&"|more_"&Chr(Random(Asc("a"), Asc("z"), 1))&Chr(Random(Asc("a"), Asc("z"), 1))&String(Random(-10000, 10000, 1)) _GUICtrlCreateListViewItem($s_RandomListItem, $listview) next ConsoleWrite("Time New :"&TimerDiff($timerstamp1) & " mseconds to search."&@lf) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) GUISetState() GUISetState(@SW_MAXIMIZE) ;Local $B_DESCENDING While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $listview $i_Index=GUICtrlGetState($listview) ; sort the list by the column header clicked on $timerstamp1 = TimerInit() __GUICtrlListViewSort( $listview,$B_DESCENDING,$i_Index) ConsoleWrite("Time New :"&round(TimerDiff($timerstamp1)) & " mseconds to search."&@lf) ;MsgBox(0,"","Time New :"&round(TimerDiff($timerstamp1)) & " mseconds to search."&@lf,1) EndSelect WEnd ** I have added a 4th function, which slows down the display [if "_GUICtrlSetImage" has been called for icons] [still 5-10 x faster as uses fast vbs sort, but reverts to normal "ListViewdeleteAllItems [slow!]" and "GUICtrlCreateListViewItem"], of course, but should keep icons, etc OK/... please test and let me know; [EDIT - you will need to put your own routine for icons in the UDF, probably, depending on your program] INSTRUCTION As in first post; 4th func to change is "GUICtrlSetImage" to "_GUICtrlSetImage" by adding extra underscore at front Best, Randall Edited May 30, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
arcker Posted May 29, 2006 Share Posted May 29, 2006 ok, i didn't that vbs array sort was faster, thanx you ! i've replace the old _guictrllistview.au3, and no more error while empty my program is not yet released because i've a problem with the function _dateisvalid doesn't work (the example doesn't work too) i will post it later nice job c u -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013Â Get it Here [/list] Link to comment Share on other sites More sharing options...
randallc Posted May 30, 2006 Author Share Posted May 30, 2006 Hi, OK; new version, see running demo using icons in first post. EXAMPLES; cf icon sorting demo; default icon number shown 300; change by "$i_DefaultIconNumber=300" etc New func also "_GUIListViewClose()" if you will redraw the Listview in same running script Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted May 30, 2006 Author Share Posted May 30, 2006 Hi, version to 0_27 now; May30th; minor correction; not sorting till 2nd click See 1st post in this thread Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 4, 2006 Author Share Posted June 4, 2006 (edited) Hi, version to 0_45 now; June 5th; more complex [example working is Filebrowser in first thread] best, Randall Edited June 4, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 8, 2006 Author Share Posted June 8, 2006 Hi, Some bugs fixed, and allowance for computers without "AM/PM" in time settings version to 0_50 now; June 8th; more complex [example working is Filebrowser in first thread Best, Randall [Can I please have feedback as local regional date/time settings affect these functions] ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 11, 2006 Author Share Posted June 11, 2006 Hi, v 0_52 I think this is working on all international settindgs, with sliding toolbar, icons, and fast sort?... Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Uten Posted June 11, 2006 Share Posted June 11, 2006 Think you should add some error handling when vbs in not properly installed or wrong version?I got this error in SciTe when running Last File Browser whome uses your UDF's.Z:\Code\autoit\include\_GUICtrlListView.au3 (442) : ==> The requested action with this object has failed.: $aArray= $vbs.run("FileListToArray",$sPath) $aArray= $vbs.run("FileListToArray",$sPath)^ ERROROthervice it looks cool so keep up the good work Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2006 Author Share Posted June 12, 2006 Think you should add some error handling when vbs in not properly installed or wrong version? I got this error in SciTe when running Last File Browser whome uses your UDF's. Z:\Code\autoit\include\_GUICtrlListView.au3 (442) : ==> The requested action with this object has failed.: $aArray= $vbs.run("FileListToArray",$sPath) $aArray= $vbs.run("FileListToArray",$sPath)^ ERROR Othervice it looks cool so keep up the good workHi, Thanks for looking; Last File Browserin the first post of the thread you link to.. does not call that function; you must be using another file? $aArray= $vbs.run("FileListToArray",$sPath)^ ERRORThat is usually the line which gives an error if I have the international date settings or time settings wrong; are you able to forward a copy of the DOS file you will have genearted please? "FindFiles.txt" in your script directory? error handling when vbs in not properly installed or wrong versionI agree, but would not now how to start... Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
slightly_abnormal Posted June 12, 2006 Share Posted June 12, 2006 (edited) nice job err... one thing the norton says your filetoolbar.au3 is malicious script .maybe because of vbs? Edited June 12, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2006 Author Share Posted June 12, 2006 Hi, "norton says your filetoolbar.au3 " "filetoolbar.au3" does not have any vbs until it runs and #includes "_GuiCtrlListView", so I'm not sure; does it complain on scannnig the file on the disc, or when it runs? [or do you mean the compiled version anyway?] Thanks, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 15, 2006 Author Share Posted June 15, 2006 Hi, Update on first post; _GUICtrlListView.au3 ( 20.25k ) version to 0_57 now; June 15th; more complex [example working is Filebrowser below]lastfile_tabs.au3 ( 11.9k ) With tabs and calendar on toolbar [needs "slider.au3"] Slider.au3 ( 3.36k ) Number of downloads: 0Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
arcker Posted June 15, 2006 Share Posted June 15, 2006 simply amazing... your version of lastfile is really cool, and works ! but one thing to consider : the CPU ! on my computer, the script consume 30% of my 2400+ ... it's the toolbar that do this ? alone it's consume 2-3 %, and with the "autorefresh" , 30% i'll try to add an option to desactivate this option, because it's too big, isn't it ? -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013Â Get it Here [/list] Link to comment Share on other sites More sharing options...
randallc Posted June 15, 2006 Author Share Posted June 15, 2006 the CPU !;on my computer, the script consume 30%Thanks for looking; I am not computer-savvy enough to understand this; on my current machine, the 31% is only for about 1/2sec or less, then back to 0-1% Is taht what you mean? - Wouldn't you expect that for the amount of processing required for a refresh (reads the whole directory again, sorted by time, then selects that day's files from the lists) All the other ways of doing this are slower that I can see; but a fair compromise would be to go back to "findnextfile" each time and sort the listview by time afterwards (x2); slower a little, and flickery [i had it running that way for a while... I'll tr to find the version for you to test if you like.]; What do you think? randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
ptrex Posted June 16, 2006 Share Posted June 16, 2006 @randallc Hi here we meet again. I see that you are making a lot of effort to increase the speed if the ListView handling. As well as trying to break the 4000 Limit boundary. I appreciate what you are doing, but I sorry to say that this is not quit the best approach. I will post the a better way on doing ListView navigation, which has no limits and speed is no problem. please comment on what you see. regards, Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
randallc Posted June 16, 2006 Author Share Posted June 16, 2006 Hi, Good news; i look forward to it. Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
arcker Posted June 17, 2006 Share Posted June 17, 2006 hey, i've just commented the other guilistview approach by p.trex so, what is the best for our computers ? ^^ btw, on my computer, the script take 20-30% all the time ! not only at the start... c u ! -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013Â Get it Here [/list] Link to comment Share on other sites More sharing options...
randallc Posted June 17, 2006 Author Share Posted June 17, 2006 (edited) Hi, [btw. - You'd need to ask @ptrex if he can apply it to this application?] *** That's a worry about the cpu use staying at 30%! I'll try it on another computer; Is it...? 1. The new listView Gui approach. 2. Icons 3. Toolbar 4. Tabs? Could you please try this one (back to sans toolbar, sans vbs[except for sort], sans DOS; just tabs , icons (you acn set the default icon manually for speed), and back to your "findfirstfile") Best, Randall [PS and the "old" version reverts to your original, without my GUIListView at all; still does 30% for 1/2 sec on refresh on my machine; ] Edited June 17, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW 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