[LIB] LV_EX - update on 2016-04-28

Post your working scripts, libraries and tools
User avatar
kczx3
Posts: 370
Joined: 06 Oct 2015, 21:39

Re: [LIB] LV_EX - update on 2016-04-28

07 Mar 2017, 13:45

What kind of data can be stored in the item's lParam? I am attempting to store a GUID and am not receiving the same string back when calling LV_EX_GetItemParam(). i.e. "a7a04166-ea26-11e6-8a43-0225b501000d"
just me
Posts: 4415
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [LIB] LV_EX - update on 2016-04-28

08 Mar 2017, 05:06

lParam will accept pointer-sized numeric values. If you want to use it for strings, store a pointer to the string.
User avatar
kczx3
Posts: 370
Joined: 06 Oct 2015, 21:39

Re: [LIB] LV_EX - update on 2016-04-28

08 Mar 2017, 07:52

Ok, I figured it out. I had been storing the address to the string correctly but was neglecting to use StrGet to retrieve the actual string stored at that address after retrieving the item's lParam.

EDIT:
So in my instance, I am populating the ListView using an Object containing support ticket information. Is there a way to store the address of a particular field in that object? Unforunately, I used a temp variable for storing the GUID and then assigning the address of that temp variable to the lParam so it get's overwritten for each row that is added. The below didn't work

Code: [Select all] [Download] GeSHi © Codebox Plus

for ticket in oIMTickets[queue] {
currTicket := oIMTickets[queue][ticket]
currRow := LV_Add("", currTicket["processid"], currTicket["incidentname"])
LV_EX_SetItemParam(IMLV_LView, currRow, &currTicket["sessionid"])
LV_EX_SetGroup(IMLV_LView, currRow, groupNum)
}
just me
Posts: 4415
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [LIB] LV_EX - update on 2016-04-28

08 Mar 2017, 10:25

Code: [Select all] [Download] GeSHi © Codebox Plus

	LV_EX_SetItemParam(IMLV_LView, currRow, currTicket.GetAddress("sessionid"))
?
User avatar
kczx3
Posts: 370
Joined: 06 Oct 2015, 21:39

Re: [LIB] LV_EX - update on 2016-04-28

08 Mar 2017, 12:48

Ah, I was looking at the documentation and only looked at Objects. Didn't realize the subitems had their own pages. Thanks!
Dravenizer
Posts: 1
Joined: 08 Apr 2017, 19:03

Re: [LIB] LV_EX - update on 2016-04-28

19 Jun 2017, 05:01

Hello! I have a listview like this one:
Col1|Col2
1234|AAA
9655|CCC
2564|AAA
4456|BBB
4556|AAA
7889|CCC
I would liek to group them by all distinct values in col2, like this: (note i want to display the full value as group header - AAA, not just alphabeticly - A )
Col1|Col2
AAA-------------
1234|AAA
2564|AAA
4556|AAA
BBB--------------
4456|BBB
CCC-------------
9655|CCC
7889|CCC
I only saw examples of grouping by row number and not by values. Can you point me to the right approach? I am guessing i should have a mechanism that loops trough the given column, extracts all distinct values and then check if which cell belongs to which value and group accordingly? Btw a function that accepts column number as parameter and automaticly clears all groupings,and then groups the listview by all values inside a column sounds super awesome and useful.
Thanks for sharing the amazing work !
just me
Posts: 4415
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [LIB] LV_EX - update on 2016-04-28

19 Jun 2017, 06:00

You cannot assign a row to a group 'by value'. You might pull the values you want to use as group headers from the contents, add the groups, and assign the related rows by row number.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Relayer, tank and 16 guests