Champak Posted February 28, 2008 Posted February 28, 2008 I know this is simple but it's flying over me. I switched from using GUICtrlCreateList to using _GUICtrlListView_Create because I needed to display two columns. The problem now is that I can't click (highlight) an element and retrieve something based on the name I highlighted....because I don't know how with this function (I couldn't figure it out in the help file). So how do I do that?...retrieve the text of the highlighted element in the first column?
Moderators SmOke_N Posted February 28, 2008 Moderators Posted February 28, 2008 None of these (along with many many other "get" functions) work for your needs? _GUICtrlListView_GetItemText _GUICtrlListView_GetItemTextArray _GUICtrlListView_GetItemTextString Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Champak Posted February 28, 2008 Author Posted February 28, 2008 Ha, the ONE that I didn't look at was the one. I did the GetItemText, but that didn't work for me, and didn't do the GetItemTextArray, because of how the help said it worked...but I didn't try the GetItemTextString, and that worked sort of. It isn't really doing what I want because it is returning the whole row, but I guess I can use stringreplace I believe to fix that. So I'll go ahead and try that.
LIMITER Posted February 28, 2008 Posted February 28, 2008 (edited) You can use all the functions from _guictrllistview UDF to work with the normal listview (guictrlcreatelist) by using this : $listhndl = GUICtrlGetHandle($playlist);CHANGE THIS WITH THE HANDLE OF THE NORMAL LISTVIEW CTRL _GUICtrlListView_GetItemCount($listhndl) Hope it helps ! Edited February 28, 2008 by LIMITER
Champak Posted February 28, 2008 Author Posted February 28, 2008 Is there a better way of doing this? $String = _StringReverse(_GUICtrlListView_GetItemTextString($SongListView)) $String = _StringReverse(StringTrimLeft($String, StringInStr($String, "|", 2, 1)))
GaryFrost Posted February 28, 2008 Posted February 28, 2008 You can use all the functions from _guictrllistview UDF to work with the normal listview (guictrlcreatelist) by using this : $listhndl = GUICtrlGetHandle($playlist);CHANGE THIS WITH THE HANDLE OF THE NORMAL LISTVIEW CTRL _GUICtrlListView_GetItemCount($listhndl) Hope it helps ! You don't need to do that for the functions to work with the built-in control SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
GaryFrost Posted February 28, 2008 Posted February 28, 2008 Is there a better way of doing this? $String = _StringReverse(_GUICtrlListView_GetItemTextString($SongListView)) $String = _StringReverse(StringTrimLeft($String, StringInStr($String, "|", 2, 1))) if you need to get the text from one column of the listview just use _GUICtrlListView_GetItemText. It will work if you use it correctly. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Champak Posted February 29, 2008 Author Posted February 29, 2008 OK, I figured this way msgbox(0,0,_GUICtrlListView_GetItemText($SongListView, _GUICtrlListView_GetSelectionMark($SongListView)) It seems to work...haven't really ran it through it's passes and scenarios, but is the the way you were referring to as the "correct" way?
Moderators SmOke_N Posted February 29, 2008 Moderators Posted February 29, 2008 Is there a better way of doing this? $String = _StringReverse(_GUICtrlListView_GetItemTextString($SongListView)) $String = _StringReverse(StringTrimLeft($String, StringInStr($String, "|", 2, 1)))Do you have an actual example string without the "_StringReverse"? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Champak Posted February 29, 2008 Author Posted February 29, 2008 (edited) I don't know what you mean, but what I did in post 8 is working well for me...and it is without "_StringReverse". Thanks. _GUICtrlListView_GetItemText($SongListView, _GUICtrlListView_GetSelectionMark($SongListView)) ...Unless I shouldn't be doing it like this.?.?. Edited February 29, 2008 by Champak
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