EndFunc Posted April 4, 2007 Share Posted April 4, 2007 Can't seem to find syntax for it or one that I can manipulate to do but is there a select all for a List box. _GUICtrlListSelItemRange() doesnt seem to help as it needs a start and stop. Any suggestions? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
EndFunc Posted April 4, 2007 Author Share Posted April 4, 2007 Can't seem to find syntax for it or one that I can manipulate to do but is there a select all for a List box._GUICtrlListSelItemRange() doesnt seem to help as it needs a start and stop. Any suggestions?NM I think I found it. _GUICtrlListSetSel() EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
EndFunc Posted April 4, 2007 Author Share Posted April 4, 2007 NM I think I found it. _GUICtrlListSetSel() Ok I do have question. Is there a way to have _GUICtrlListDeleteItem remove a specific item from a list box and not just top most item? Also to make sure its selected first? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
GEOSoft Posted April 4, 2007 Share Posted April 4, 2007 Ok I do have question. Is there a way to have _GUICtrlListDeleteItem remove a specific item from a list box and not just top most item? Also to make sure its selected first?$SList = _GUIListGetSelItems($My_ListCtrl) ;Returns an array of the selected Items For $I = 1 To Ubound($SList)-1 _GUIListDeleteItem($My_ListCtrl,$SList[$I]); deletes the item Next George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
EndFunc Posted April 4, 2007 Author Share Posted April 4, 2007 (edited) $SList = _GUIListGetSelItems($My_ListCtrl) ;Returns an array of the selected Items For $I = 1 To Ubound($SList)-1 _GUIListDeleteItem($My_ListCtrl,$SList[$I]); deletes the item Next Thanks alot that was very helpful! I have a problem with trying to get this to tell me if it is a dir or a file. The code I tried using a stringinstr and using a "." won't work. It has the opposite effect. I want it to tell me if it is a file by having a "." in and if not it's a dir. Any other suggestions?? Dim $sCount = _GUICtrlListCount($SourceEdit) If $sCount = "0" Then GUICtrlSetData($Console,"No additional files or folders selected during this process." & @CRLF & @CRLF, 1) Else $sAll = _GUICtrlListSetSel($SourceEdit, 0) If($sAll == $LB_ERR) Then MsgBox(16,"Error","Unknown error from _GUICtrlListSetSel") EndIf $ret = _GUICtrlListGetSelItemsText ($SourceEdit) If (Not IsArray($ret)) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListGetSelItemsText") Else For $i = 1 To $ret[0] If $ret[$i] = StringInStr($ret[$i], ".") Then MsgBox(0, "Selected files", $ret[$i]) GUICtrlSetData($Console, $ret[$i] & " has been added to transfer." & @CRLF, 1) GUICtrlSetData($Console, "Transfering " & $ret[$i] & @CRLF, 1) EndIf Next EndIf Edited April 4, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
GEOSoft Posted April 4, 2007 Share Posted April 4, 2007 (edited) Thanks alot that was very helpful! I have a problem with trying to get this to tell me if it is a dir or a file. The code I tried using a stringinstr and using a "." won't work. It has the opposite effect. I want it to tell me if it is a file by having a "." in and if not it's a dir. Any other suggestions?? Dim $sCount = _GUICtrlListCount($SourceEdit) If $sCount = "0" Then GUICtrlSetData($Console,"No additional files or folders selected during this process." & @CRLF & @CRLF, 1) Else $sAll = _GUICtrlListSetSel($SourceEdit, 0) If($sAll == $LB_ERR) Then MsgBox(16,"Error","Unknown error from _GUICtrlListSetSel") EndIf $ret = _GUICtrlListGetSelItemsText ($SourceEdit) If (Not IsArray($ret)) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListGetSelItemsText") Else For $i = 1 To $ret[0] If $ret[$i] = StringInStr($ret[$i], ".") Then MsgBox(0, "Selected files", $ret[$i]) GUICtrlSetData($Console, $ret[$i] & " has been added to transfer." & @CRLF, 1) GUICtrlSetData($Console, "Transfering " & $ret[$i] & @CRLF, 1) EndIf Next EndIf If $ret[$i] = StringInStr($ret[$i], ".") Then is wrong. If StringInStr($Ret[$i], ".") Then Better yet if you have the full file path If Not StringInStr(FileGetAttrib($Ret[$I]),"D") Then Edited April 4, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
EndFunc Posted April 5, 2007 Author Share Posted April 5, 2007 is wrong. If StringInStr($Ret[$i], ".") Then Better yet if you have the full file path If Not StringInStr(FileGetAttrib($Ret[$I]),"D") Then Man, you're a life saver. Works perfectly. Thank you! EndFuncAutoIt is the shiznit. I love it. 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