Page 1 of 3

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

Posted: 03 Jan 2014, 05:15
by just me
Additional functions for GUI ListView controls.

Primarily [CLASS] version released on the old forum -> board/topic/80686-class-guilistviewex-added-functions-for-gui-listviews/.

Well, this is a !!! LIB !!! version of my originally released CLASS_GuiListViewEx. I added some more functions, most of them are intended to be used primarily in Report view.

ChangeLog


LV_EX.png


I only did some quick testing, so you might find some issues or bugs. If so, report them here, please.

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



:arrow: Sources at GitHub.
:arrow: Docs at GitHub.
:arrow: Download from GitHub.

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 13 Mar 2015, 05:42
by just me
* Update 1.1.00.00 *

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 31 Jul 2015, 10:19
by rajat
This is an awesome set of functions mate, many thanks!

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 17 Dec 2015, 09:15
by kczx3
@just me

I haven't been able to figure out the right combination of commands to create a collapsible listview group but set that group to initially be collapsed. Setting the state to Collapsible makes it expanded but setting it to Collapsed makes it so you can't expand it. Help plz :)

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 17 Dec 2015, 10:43
by just me
The LV_EX_GroupSetState() function replaces all states with the passed states.

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

LV_EX_GroupSetState(HLV, GrouID, "Collapsible")
includes the Normal (expanded) state implicitely, because its value is 0x00.

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

LV_EX_GroupSetState(HLV, GrouID, "Collapsed")
will remove the Collapsible state.

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

LV_EX_GroupSetState(HLV, GrouID, "Collapsed", "Collapsible")
will set both states.

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 17 Dec 2015, 11:19
by kczx3
Ahhhh, is that what the States* means? That any parameters after that all are States?

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 17 Dec 2015, 11:49
by just me
Correct!

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 18 Dec 2015, 12:15
by kczx3
More help needed. So I currently have a listview with 2 groups, the first has the header hidden and the second is now set to be collapsible but initially collapsed. What I now want to do is scroll the listview to the bottom should the user expand the second group. I first need to find a way to determine how to track the user's movements and clicks/double clicks. It seems none of the built in A_* variables give any useful info when the header is double clicked or the Arrow is clicked to expand the group.

As for the scrolling, I was looking at checking for LVM_GETGROUPSTATE but not sure if that's what I need to be using. Does this look even remotely correct?

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

; ======================================================================================================================
; LV_EX_GetGroupState - Gets the state of a group by group ID
; ======================================================================================================================
LV_EX_GetGroupState(HLV, GroupID) {
; LVM_GETGROUPSTATE = 0x105C -> https://msdn.microsoft.com/en-us/library/bb774936(v=vs.85).aspx
; LVGS_COLLAPSED = 0x00000001
SendMessage, 0x105C, %GroupID%, 0x00000001, , % "ahk_id " . HLV
Return ErrorLevel
}

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 18 Dec 2015, 12:36
by kczx3
Oh wait! That function works actually. It only checks for LVGS_COLLAPSED := 0x00000001 though. Not sure if there is a way to check for all applied states.

So now I just need to figure out how to check if they double clicked on the group header, and if so, check the state of LVGS_COLLAPSED and if it is not collapsed, scroll to the bottom.

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 06 Jan 2016, 11:46
by kczx3
Thoughts on this function?

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



The message is returning successfully because ErrorLevel is getting set to the GroupID but I'm having trouble correctly extracting the header text. Wonder if I need to make use of the LV_EX_PWSTR(Str, ByRef WSTR) function.

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 07 Jan 2016, 02:52
by just me
It's a bug and will be fixed. Thanks for reporting!

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 07 Jan 2016, 04:52
by just me
Haha, I thought it would be a part of my lib, but it isn't. It's faulty, though. So I'll fix your function.

Re: [LIB] LV_EX - update on 2015-03-13

Posted: 07 Jan 2016, 05:17
by just me

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


Re: [LIB] LV_EX - update on 2015-03-13

Posted: 07 Jan 2016, 07:58
by kczx3
just me wrote:Haha, I thought it would be a part of my lib, but it isn't. It's faulty, though. So I'll fix your function.


I think its a great addition to your library. I really can't call it my function seeing as I tried piecing it together based on your work. And then you ended up fixing it anyhow!

I do just want to tell you that all your work here is brilliant. I've learned a lot from deciphering your work. Bravo!

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

Posted: 28 Apr 2016, 07:59
by just me
*Update 1.1.01.00* (Added LV_EX_GroupGetState() contributed by Pulover)

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

Posted: 28 Apr 2016, 08:26
by just me
Took the chance and added LV_EX_GroupGetHeader() as suggested by kczx3 above, too.

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

Posted: 10 May 2016, 12:46
by kczx3
So I'm looking into trying to extend the functionality that LV_EX has. They are quite a few parameters to the LVGROUP structure, albeit only supported on newer OS versions, that I'm interested in. Of particular interest, is the Task Link which is clickable text in the group header that sends a LVN_LINKCLICK notification via WM_NOTIFY. I attempted to add another parameter to LV_EX_GroupIsnert() but am not seeing any results from it.

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



I tried getting the offsets correct by talking with GeekDude in the IRC chat. Not sure if those are off or if there is a mystery puzzle piece I am missing. I also contemplated making a new function to handle this by mimicking LV_EX_GroupSetState() but this also fails to function properly.

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



Lastly, my concern is monitoring for this notification. I make use of Class_LV_Colors in nearly all ListViews that I make which also monitors WM_NOTIFY, I believe. I don't think I could use both then and monitor the notifications from each.

I'd like to try and pick this up myself so if there are any hints you may have to offer that would be helpful. The more I learn the less I have to ask you ;). As always, thanks!

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

Posted: 11 May 2016, 09:50
by just me
Hi kczx3,

the structure size of the extended LVGROUP version for Vista+ is not correct. I corrected your LV_EX_GroupSetTask() function and it is working for me:

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



Related to WM_NOTIFY -> LVN_LINKCLICK I think that you can monitor it with an own function if you use a function object. The default message handler of LV_Colors() does not touch LVN_LINKCLICK notifications, so both should work But it possibly might cause the well-known freezing issue.

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

Posted: 12 May 2016, 09:12
by kczx3
Well, I think I'm getting there... Last bit is to get the iSubItem from the NMLINK structure so that I know what group's link was clicked. Assumption would be that my offsets are again incorrect.

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


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

Posted: 13 May 2016, 09:33
by just me
Well, your assumption was right. ;)

I corrected the offset. You didn't add the size of the leading NMHDR structure. Also, the first 4 fields of the LITEM structure as well as iItem and iSubItem are 4 bytes long (Uint/Int), and the iItem field following the LITEM structure has to be aligned to a DWORD boundary, so 2 extra bytes must be added:

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