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

Post your working scripts, libraries and tools
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

03 Jan 2014, 05:15

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.
Last edited by just me on 28 Apr 2016, 08:24, edited 2 times in total.
Remaining with AHK 1.1.25.02 until v2 will become beta.
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

13 Mar 2015, 05:42

* Update 1.1.00.00 *
Remaining with AHK 1.1.25.02 until v2 will become beta.
rajat
Posts: 8
Joined: 07 Feb 2014, 13:35

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

31 Jul 2015, 10:19

This is an awesome set of functions mate, many thanks!
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

17 Dec 2015, 09:15

@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 :)
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

17 Dec 2015, 10:43

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.
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

17 Dec 2015, 11:19

Ahhhh, is that what the States* means? That any parameters after that all are States?
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

17 Dec 2015, 11:49

Correct!
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

18 Dec 2015, 12:15

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
}
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

18 Dec 2015, 12:36

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.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

06 Jan 2016, 11:46

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.
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

07 Jan 2016, 02:52

It's a bug and will be fixed. Thanks for reporting!
Remaining with AHK 1.1.25.02 until v2 will become beta.
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

07 Jan 2016, 04:52

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.
Remaining with AHK 1.1.25.02 until v2 will become beta.
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

07 Jan 2016, 05:17

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

Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

07 Jan 2016, 07:58

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!
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

28 Apr 2016, 07:59

*Update 1.1.01.00* (Added LV_EX_GroupGetState() contributed by Pulover)
Remaining with AHK 1.1.25.02 until v2 will become beta.
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

28 Apr 2016, 08:26

Took the chance and added LV_EX_GroupGetHeader() as suggested by kczx3 above, too.
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

10 May 2016, 12:46

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!
just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

11 May 2016, 09:50

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.
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
kczx3
Posts: 423
Joined: 06 Oct 2015, 21:39

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

12 May 2016, 09:12

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

just me
Posts: 4865
Joined: 02 Oct 2013, 08:51
Location: Germany

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

13 May 2016, 09:33

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

Remaining with AHK 1.1.25.02 until v2 will become beta.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: ArdaS and 14 guests