[v2] ZeeGrid class

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

[v2] ZeeGrid class

02 Apr 2019, 14:01

This is a wrapper class for the awesome ZeeGrid control. This control used to only be available commercially but it appears that the author, David Hillard, released it free of charge in 2015. See his website for documentation and downloads of the Dlls. I also have the Dlls on my GitHub repository for it.

This class is very much just a port of the class I recently posted for the Scintilla control. Since it is completely message based, these are easy to wrap into classes that use the message names as methods.

GitHub Repository - https://github.com/kczx3/AHK-ZeeGrid

There is an included sample as well. Here's a screenshot.
ZeeGrid.png
ZeeGrid.png (25.17 KiB) Viewed 5817 times
robodesign
Posts: 932
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [v2] ZeeGrid class

02 Apr 2019, 16:14

This is utterly nice! Great work!
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: [v2] ZeeGrid class

02 Apr 2019, 17:02

thumbsup

User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: [v2] ZeeGrid class

02 Apr 2019, 20:09

Hi kczx3, thanks for sharing.
Just say that with SendMessage, in addition to having a significantly worse performance than DllCall, you should be careful with the return value in 32-bit compilations when it can be negative. If you expect a negative value, you must use SendMessage(...)<<32>>32, as indicated in the documentation (making the performance even worse). I have seen that some messages return -1 to indicate an error.

:wave:
freakkk
Posts: 25
Joined: 21 Sep 2014, 20:14

Re: [v2] ZeeGrid class

02 Apr 2019, 21:25

You are on a roll man! :D

This reminds me a lot of the RaGrid control majkinetor wrapped way back in the day. I can't wait to dig into this one too!
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [v2] ZeeGrid class

03 Apr 2019, 07:37

Hi there! Thank you for checking it out.
Flipeador wrote:
02 Apr 2019, 20:09
Just say that with SendMessage, in addition to having a significantly worse performance than DllCall, you should be careful with the return value in 32-bit compilations when it can be negative. If you expect a negative value, you must use SendMessage(...)<<32>>32, as indicated in the documentation (making the performance even worse). I have seen that some messages return -1 to indicate an error.
Are you stating that if I use DllCall to invoke SendMessage that it will perform better and I will not have to perform the adjust on the return value?

I've noticed that the control is actually much slower than the standard ListView when added many rows. The control doesn't provide any messages for scrolling but I think I could handle WM_VSCROLL and perform virtualization of the data.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: [v2] ZeeGrid class

03 Apr 2019, 07:55

kczx3 wrote:Are you stating that if I use DllCall to invoke SendMessage that it will perform better and I will not have to perform the adjust on the return value?
Exactly.

Code: Select all

DllCall("User32.dll\SendMessageW", "Ptr", this.grid.hwnd, "Ptr", msg, "Ptr", wParam, "Ptr", lParam, "Ptr")
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [v2] ZeeGrid class

03 Apr 2019, 15:13

wow. very nice. Thank you!
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: [v2] ZeeGrid class

18 Apr 2019, 09:47

very nice looking control and good job on the library, thanks for sharing

any chance you're working on a v1 compatible version?
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [v2] ZeeGrid class

18 Apr 2019, 10:06

gwarble wrote:
18 Apr 2019, 09:47
very nice looking control and good job on the library, thanks for sharing

any chance you're working on a v1 compatible version?
Negative. I strictly work in v2 for anything new. I never wish to go back to using GUIs the old way.
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: [v2] ZeeGrid class

18 Apr 2019, 11:22

>> any chance you're working on a v1 compatible version? <<
Negative. I strictly work in v2 for anything new. I never wish to go back to using GUIs the old way.
Fair enough... if I take your work and make a v1 compatible version, would you prefer I:
a) share it in this thread
b) share it in a new thread
c) keep it to myself
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [v2] ZeeGrid class

18 Apr 2019, 15:19

I would recommend you make a new thread.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [v2] ZeeGrid class

19 Apr 2019, 02:38

Another nice one kczx3, good job :thumbsup:

Thanks for sharing, cheers.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [v2] ZeeGrid class

20 May 2019, 11:27

@kczx3, I wonder if you might be able to help me with this error when running the example (Win7 64-bit, various AHK_2 versions:

Code: Select all

---------------------------
ZeeGrid_Sample.ahk
---------------------------
Error:  No object to invoke.

	Line#
	114: Throw Exception(this.__class "::" key "

Unknown property!", -1)
	115: }
	117: Return this.ZeeGridBase[key]
	118: }
	003: {
	003: Return  ExitApp()
	003: }
--->	003: main.OnEvent("close", () => ExitApp())
	005: grid := new ZeeGrid(main, "w600 h400", "", A_PtrSize = 8 ? "ZeeGridx64.dll" : "ZeeGrid.dll")
	006: grid.OnEvent(grid.ZGN_RIGHTCLICK, Func("onRightClick"))
	008: grid.DimGrid(10)
	009: grid.AllocateRows(100)
	010: grid.ShowRowNumbers(true)
	011: grid.EnableRowSizing(true)
	012: grid.SetColumnHeaderHeight(25)

The current thread will exit.
---------------------------
OK   
---------------------------
I've tried it with 2.0 versions from a090 through a103. It won't run at all until a099, and the next few versions throw this error. Thanks!
The only change I made in the example was

Code: Select all

#Include ZeeGrid.ahk
instead of

Code: Select all

#Include <ZeeGrid>
to reflect where ZeeGrid.ahk is (i.e. in the script dir).
Thanks!
Regards,
burque505
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: [v2] ZeeGrid class

20 May 2019, 11:55

Odd. And it does work if you leave it referencing a lib location?
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [v2] ZeeGrid class

20 May 2019, 12:03

I will try that, just a sec.
EDIT: Tried it with ZeeGrid.ahk in a LIB folder below the script dir (and a copy of the DLLs there for good measure), and also with a copy in the LIB folder in the AutoHotkey directory. Odd. I'm sure it's working for everyone else from the posts.
EDIT: And it works fine for me on a Win10 Pro machine using 2.0_a103. :bravo: Thanks for the great script!
Regards,
burque505
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: [v2] ZeeGrid class

14 Mar 2021, 07:50

Thanks for this good thing.
Difficult to edit for AHK V1?
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: [v2] ZeeGrid class

15 Oct 2021, 10:29

Hi Is There A Way To Provide Corrections to V2? Does not work in recent versions.

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: sanmaodo and 31 guests