Jump to content

_GUICtrlListView.au3


randallc
 Share

Recommended Posts

no problem with those scripts, 2-3% of the cpu, so....

where is the problem ? i don't know

ok another thing : even if i have just one tab in ur script, it consumes the same ! so i think it's really in the loop the problem

-- 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

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

no problem with those scripts, 2-3% of the cpu, so....

where is the problem ? i don't know

ok another thing : even if i have just one tab in ur script, it consumes the same ! so i think it's really in the loop the problem

OK -

1. So does it happen with "filetoolbar" in first post as well?

2. Is it helped by a "sleep"?

While 1
    sleep(100)
???

Struggling here with the logic; It must be in the toolbar items, I think.

Best, Randall

Link to comment
Share on other sites

yes i had this idea but i've just test with a pause of 10ms... now with 100, 2-3% of the CPU

anyway, it's really strang because in my Active directory tool my loop is really big and i've no problem...

really strange, not in relation with the script so....

thx for the help

edit :

after some tests and re-tests, here is the problem :

$sTodayCalcDate = _DateAdd( 'd',$jour, _NowCalcDate())

but you have the same line, so i don't understand....

Edited 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

Oh, thanks,

Makes sense that it is a date problem with our regional differences!

At least you have a workaround with the sleep, but it is causing needless "refreshes".

ConsoleWrite("LINE "&@ScriptLineNumber&":$sTodayCalcDate="&_DateAdd( 'd',$jour, _NowCalcDate())&@LF&"$sNewDate="&$sNewDate&@LF&"$jour="&$jour&@LF)
oÝ÷ ÙƧʩºØ§i׺"    bæ­iº.·^5jwméö×ا²'^­çëzÈZºÚ"µÍIÌÍÜÕÙ^[Ñ]HHÑ]PY
    ÌÎNÙ ÌÎNË ÌÍÚÝÓÝÐØ[Ñ]J
JBZY    ÌÍÜÕÙ^[Ñ]IÉÝÈ   ÌÍÜÓ]Ñ]H[PÛÛÛÛUÜ]J    ][ÝÓSH    ][ÝÉ[ÐØÜ[S[X[É][ÝÎÌÍÜÕÙ^[Ñ]OI][ÝÉ[×Ñ]PY
    ÌÎNÙ ÌÎNË ÌÍÚÝÓÝÐØ[Ñ]J
JI[Ð[É][ÝÉÌÍÜÓ]Ñ]OI][ÝÉ[ÉÌÍÜÓ]Ñ]I[Ð[É][ÝÉÌÍÚÝI][ÝÉ[ÉÌÍÚÝ[ÐBoÝ÷ Ù©ÝjÖ¢ëvÛJÞ~·¬©Ý±éÝëa¢Ç¥w¬¶(®Ú.µ«­¢+ÙÕ¹}ÉÉÍ  ÀÌØí½ÍͥȰÀÌØí±¥ÍѤ($ÀÌØíÍ9ÝÑô}Ñ ÌäíÌäì°ÀÌØí©½ÕÈ°}9½Ý
±Ñ ¤¤(%
½¹Í½±]É¥Ñ ÅÕ½Ðí1%9ÅÕ½ÐìµÀíMÉ¥ÁÑ1¥¹9յȵÀìÅÕ½ÐìèÀÌØíÍQ½å
±ÑôÅÕ½ÐìµÀí}Ñ ÌäíÌäì°ÀÌØí©½ÕÈ°}9½Ý
±Ñ ¤¤µÀí1µÀìÅÕ½ÐìÀÌØíÍ9ÝÑôÅÕ½ÐìµÀìÀÌØíÍ9ÝѵÀí1µÀìÅÕ½ÐìÀÌØí©½ÕÈôÅÕ½ÐìµÀìÀÌØí©½ÕȵÀí1¤

See if you get any from 141 (I don't) and send me data from both lines

Thanks,

Randall

Link to comment
Share on other sites

here is the complete log when i start the script :

>"C:\Program Files\AutoIt3\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\test\lastfiles_tabs.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams    
>Running AU3Check (1.54.1.1)  params:  from:C:\Program Files\AutoIt3\beta
+>AU3Check ended.rc:0
>Running:(3.1.1.126):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\test\lastfiles_tabs.au3" 
Function FileListToArray(ReadFile)
    Dim objFileSystem: Set objFileSystem = CreateObject( "Scripting.FileSystemObject") 
    Dim fso, fso1,f1, InFile, ReadString,FileArray()
    Set InFile = objFileSystem.OpenTextFile(ReadFile, 1)
    Dim intPointer, intUpper, intLower, varHolder: intPointer=0
        ReDim Preserve FileArray(0)
    Do While Not InFile.AtEndOfStream
        ReDim Preserve FileArray(ubound(FileArray)+1)
        ReadString = InFile.ReadLine
FileArray(intPointer) =left(ReadString,10)&"|"&mid(ReadString,37)&"|"&mid(ReadString,13,5)&"|"&round(CSng(mid(ReadString,18,18))/1024)&"|"&right(ReadString,4) 
        intPointer=intPointer+1
    Loop
    InFile.Close
        ReDim Preserve FileArray(ubound(FileArray)-1)
    FileListToArray=FileArray
End function   Current;.TXT
Current;.bak
Max;.au3
_FirstList :2127 mseconds to search. for C:\test\
LINE 218:$sTodayCalcDate=2006/06/18
$sNewDate=2006/06/18
$jour=0
Function FileListToArray(ReadFile)
    Dim objFileSystem: Set objFileSystem = CreateObject( "Scripting.FileSystemObject") 
    Dim fso, fso1,f1, InFile, ReadString,FileArray()
    Set InFile = objFileSystem.OpenTextFile(ReadFile, 1)
    Dim intPointer, intUpper, intLower, varHolder: intPointer=0
        ReDim Preserve FileArray(0)
    Do While Not InFile.AtEndOfStream
        ReDim Preserve FileArray(ubound(FileArray)+1)
        ReadString = InFile.ReadLine
FileArray(intPointer) =left(ReadString,10)&"|"&mid(ReadString,37)&"|"&mid(ReadString,13,5)&"|"&round(CSng(mid(ReadString,18,18))/1024)&"|"&right(ReadString,4) 
        intPointer=intPointer+1
    Loop
    InFile.Close
        ReDim Preserve FileArray(ubound(FileArray)-1)
    FileListToArray=FileArray
End function   Current;.TXT
Current;.bak
Max;.au3
_FirstList :2131 mseconds to search. for C:\
LINE 218:$sTodayCalcDate=2006/06/18
$sNewDate=2006/06/18
$jour=0
Function FileListToArray(ReadFile)
    Dim objFileSystem: Set objFileSystem = CreateObject( "Scripting.FileSystemObject") 
    Dim fso, fso1,f1, InFile, ReadString,FileArray()
    Set InFile = objFileSystem.OpenTextFile(ReadFile, 1)
    Dim intPointer, intUpper, intLower, varHolder: intPointer=0
        ReDim Preserve FileArray(0)
    Do While Not InFile.AtEndOfStream
        ReDim Preserve FileArray(ubound(FileArray)+1)
        ReadString = InFile.ReadLine
FileArray(intPointer) =left(ReadString,10)&"|"&mid(ReadString,37)&"|"&mid(ReadString,13,5)&"|"&round(CSng(mid(ReadString,18,18))/1024)&"|"&right(ReadString,4) 
        intPointer=intPointer+1
    Loop
    InFile.Close
        ReDim Preserve FileArray(ubound(FileArray)-1)
    FileListToArray=FileArray
End function   Current;.TXT
Current;.bak
Max;.au3
_FirstList :2057 mseconds to search. for C:\Program Files\
LINE 218:$sTodayCalcDate=2006/06/18
$sNewDate=2006/06/18
$jour=0
Function FileListToArray(ReadFile)
    Dim objFileSystem: Set objFileSystem = CreateObject( "Scripting.FileSystemObject") 
    Dim fso, fso1,f1, InFile, ReadString,FileArray()
    Set InFile = objFileSystem.OpenTextFile(ReadFile, 1)
    Dim intPointer, intUpper, intLower, varHolder: intPointer=0
        ReDim Preserve FileArray(0)
    Do While Not InFile.AtEndOfStream
        ReDim Preserve FileArray(ubound(FileArray)+1)
        ReadString = InFile.ReadLine
FileArray(intPointer) =left(ReadString,10)&"|"&mid(ReadString,37)&"|"&mid(ReadString,13,5)&"|"&round(CSng(mid(ReadString,18,18))/1024)&"|"&right(ReadString,4) 
        intPointer=intPointer+1
    Loop
    InFile.Close
        ReDim Preserve FileArray(ubound(FileArray)-1)
    FileListToArray=FileArray
End function   Current;.TXT
Current;.bak
Max;.au3
_FirstList :1887 mseconds to search. for C:\Documents and Settings\Yoan.CRASH\Mes documents\
LINE 218:$sTodayCalcDate=2006/06/18
$sNewDate=2006/06/18
$jour=0
_FirstList :11481 mseconds to search. for total
LINE 218:$sTodayCalcDate=2006/06/18
$sNewDate=2006/06/18
$jour=0

-- 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

  • 3 weeks later...
  • 2 weeks later...

hi guy !

ok, i've included your function in my script for AD v3 (release soon)

but i've a unknown issue :

problem => how do i do for icons ? because with _guictrllistviewcreateitem, no handle is returned, but i've added the following before the end function

EndIf
    return $ar_LISTVIEW[$i_LISTVIEWNumItemsView]
EndFunc   ;==>_GUICtrlCreateListViewItem

and it works ^^

but i think you have included this feature, but i don't know how to use it

and another issue...sort doesn't work..i don't know why

i think it depends of the declaration of $b_descending, but... dunno

Edited 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

Hi,

In which script of mine does the sort not work?... in all the examples in the zip they work on my machine, as do the icons; eg SearchFast etc...

There are some extra parameters as you will see in the function declarations; give me an example script?

In fact, I now have checkboxes sorting with icons if you know how to declare them (see example of checkboxes)

best, Randall

pS you shouldn't need to return the handle, as I have declared the array of handles as global..., and the icons should already be attached (they are re-attached after the sort , so that is why it takes longer to sort with icons.)

Edited by randallc
Link to comment
Share on other sites

edit : ok seems to work, but the arrayreverse doesn't do anything....

i'm near

so.... dunno

case $msg=$Listegroupemembres
                    ;msgbox(0,"",GUICtrlGetState($Listegroupemembres))
                    
                    __guictrllistviewsort($Listegroupemembres,$B_DESCENDING,GUICtrlGetState($Listegroupemembres))

arrayhandles fixed ^^, thx for the advice

Edited 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

sry i can't post the code for now, because too unstable and dangerous if executed as it

i have forgotten to say that when i remove the icons from the list view, the array didn't sort too

so...

here is the declaration of the guilistview :

$Listegroupemembres = _GUICtrlCreateListView("Membres du Groupe | Chemin LDAP", 525, 40, 305, 270,$LVS_REPORT)

;...additem

_GUICtrlCreateListviewItem($rs1 & "|" & $essai[$i], $Listegroupemembres)

;...guigetmsg


case $msg=$Listegroupemembres
                    ;msgbox(0,"",GUICtrlGetState($Listegroupemembres))
            
                    __guictrllistviewsort($Listegroupemembres,$B_DESCENDING,GUICtrlGetState($Listegroupemembres))

-- 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

Hi randallc,

I've been using your include file in many of my scripts. As mentioned to you earlier, I am very impressed with it. Yesterday I tried to add one of my compiled script to my BARTPE cd. But I got an error

"Error: Variable must be of type "Object"". So then I tried to compile one of your "sort" codes (taken from your example in the first page) and I get the same error for that too. Below is the precise error:

$vbs = ObjCreate("ScriptControl")
$vbs.language="vbscript"
$vbs^ERROR

Error: Variable must be of type "Object".

All your scripts work fine on my regular PC where XP Home is installed. I only have a problem when running on my BartPE CD. On my BARTPE cd, I have VB5 and VB6 plugins installed as well as WMI and WSH. I have sample scripts of these types and can confirm that the sample types eg test.vbs, test.wsf etc work fine. Is there a certain VB file required, that I must have in my BARTPE build to avoid this error. Would love to use this Autoitscript on my BARTPE. Perhaps you can tell me if something in the script needs to be modified for wider usability. Thanks in advance.

Link to comment
Share on other sites

Hi,

Although I have used Bart stuff years ago, I have not kept up.

It used to be that it relied on an older DOS version than WinXP's, so it might not have support for the scripting object?

Best, randallc

(PS you could just rewrite the vbs code to be saved as a vbs script and runwait it each time, in the funcs which I use vbs object, just like saving the code of a bat file and saving it, then runwait it.. I haven't tried the modification, but it would probably work for you...)

Link to comment
Share on other sites

Hi randallc,

My BARTPE has XP SP2. Its almost like a replica of my desktop PC, but I am afraid it does not pull that particular registry setting or system file that would prevent the error from happening. Everything else works fine on my BARTPE, so I am led to believe that some extra VB runtime file or whatever its called (not normally needed in the smooth functioning of XP) is needed to prevent this error and hence I was asking if you knew. I mean various VB apps that I tested work fine in my BARTPE environment along with all Autoit codes etc. I guess if noone has an answer to this/ or if noone has come across such an issue, I guess I will have to keep this in my 'list of things to do' and move on for the time being :whistle:

But thanks again for your suggestion....

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

New version of _GUICtrlListView will work in winME (and 98 I hope?...) as well as maybe bartPE; , if they have vbscript installed [doesn't use scripting object..] [** interested to hear...]

The version of search will also work in those OSs, as well as Win2K.["SearchMine.au3"]

Best, Randall

Link to comment
Share on other sites

OK,

I have Guisorting working in bartPE as well as WinME [barts has to have WSH shell plugin for vbscript, and still does not have scripting object... unless someone can tell me how..]

Best, Randall

Link to comment
Share on other sites

  • 6 months later...

Hello !

Your example script is very fast, but can't get it to work in my script, I get the message as you can see in the attached file.

I have 18 columns in my ListView, is there som limitation on how many columns you can have ?

$MEListView = _GUICtrlCreateListViewIndexed("Index|Model|HW id|S/N|Dep|Proj|User|Status|Build|Cam|NOR|NAND|eNAND|Sibley|DuoMem|BT-SPI|BT-UART|Faulty",20,110,960,270,   $LVS_SHOWSELALWAYS, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL))  
    GUICtrlSetOnEvent($MEListView,"_MEListViewSort")

Func _MEListViewSort()
    _GUICtrlListViewSort($MEListView, $B_DESCENDING, GUICtrlGetState($MEListView))
EndFunc
Link to comment
Share on other sites

Hello !

Your example script is very fast, but can't get it to work in my script, I get the message as you can see in the attached file.

I have 18 columns in my ListView, is there som limitation on how many columns you can have ?

$MEListView = _GUICtrlCreateListViewIndexed("Index|Model|HW id|S/N|Dep|Proj|User|Status|Build|Cam|NOR|NAND|eNAND|Sibley|DuoMem|BT-SPI|BT-UART|Faulty",20,110,960,270,   $LVS_SHOWSELALWAYS, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL))  
    GUICtrlSetOnEvent($MEListView,"_MEListViewSort")

Func _MEListViewSort()
    _GUICtrlListViewSort($MEListView, $B_DESCENDING, GUICtrlGetState($MEListView))
EndFunc
Hi,

Not sure; but note your syntx is wrong for this; "__GUICtrlListViewSort($MEListView, $B_DESCENDING, GUICtrlGetState($MEListView))"; double underscore at start?

Best, randall

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...