egrid 4 grid gadget - (static PB library version.)

Developed or developing a new product in PureBasic? Tell the world about it.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

srod wrote:Sorry rw, you'll need to be a little more specific.

If you've got more than 10000 rows, but most of them are empty then... why have 10000 rows in the first place? :)
in such scenarios a data structure called 'sparse matrix' is used. This is a structure where memory is only allocated for cells that have content. To manage such a beast, you need double-linked lists for each of the rows and columns with routines that handle the deletion and insertion of new cell content (= memory allocations for the cells, updating the linked lists, etc.). Nice exercise that.... :)


I like eGrid a lot! Keep up the good work. As soon as I'm not just playing around with it, I'll register.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Hi!

Of course I create the rows dynamically.

I think i understand the virtual grid concept and will wait for it.

I understand that for the vitrtual grid, there had to be some problems to solve, e.g. vertical scrollbar interaction, column sort ...

Now, i have a lot of work to do with egrid even without virtual grids.

Take your spare time .

rw
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

BETA 4 rev 1 released. 26th October 2006.

The last (and first!) revision before the first release version (except for bug fixes etc.)

I have removed the yukky default Windows gridlines in favour of customised gridlines - which look a lot better.

I have also added the facility to apply fully customisable borders to individual cells which can be quite effective. You can add any combinations of left, top, right and bottom borders. Thin solid lines, thick solid lines, dashed borders etc.

Here's a screenshot of a simple example:

Image

Incidentally, the above example grid dynamically calculates the totals as the user enters the data etc.

See the (incomplete) help manual (egrid_CreateCellCallback() command) for details of how to apply such borders. Alternatively, see demo program 6 (from which the above screenshot was taken).


NOTE: judicious use of borders (particularly in combination with gridlines) can be very unsightly indeed. At the end of the day, an egrid is a Windows List View control and, as such, adding such borders is not an 'exact science' as I am having to work within the constraints of the underlying control. It's a process of trial-and-error with these I'm afraid. If you run across what you think is a bug, try moving a border from one cell to an adjacent one to get the look you're after. I've done my best, but the ListIcon is not a particularly friendly animal where individual borders are concerned.

Still, some very nice effects are possible if you are careful.


Also, the usual round of bug fixes and quite a few enhancements, particularly with the header control and resizing columns which is now far more stable than my first attempt at customising this process!

I'll give this a week for bug fixes and then the first full release will appear (famous last words! :) )

Regards.

http://www.purecoder.net/egrid.htm

**EDIT** It's just occurred to me that unregistered users will not be able to run demo 6 properly because of the 10 row maximum! You'll need to edit the demo slightly to see the totals row!

1 bug fixed already! Doh! :oops: A very minor one! Fix will be included in the next release.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

BETA 4 rev 1 released. 28th October 2006.

To those who have downloaded Beta 4 rev 1, please download again as a few adjustments have been made in order to circumvent a problem with the PB image library where threadsafe / subsystems are concerned.

Please see the Bug Forum for details.

:)
I may look like a mule, but I'm not a complete ass.
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Hi srod!

Beta 4 works nice here!

Would you please look at the minimal custom header height.
For the default font the header height has to be 26 to render correctly
(header click).

Optical the header is to large for the font size.

Kepp up the great work.

By

tw
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

The default font on my machine requires a minimum header height of 22.

It depends on your setup etc.

When an egrid is created, I set the header height to 20. This was done for various reasons which I won't go into here. If you change the font, then you must use egrid_SetHeaderFont() to get a proper 'fit'.

I guess I could construct the header so that it matches the default font when the egrid is created, but I never saw this as a big deal. I'll have a look at this tonight as I will be out all day.

Regards.

**EDIT**: Okay, I've adjusted the way the header renders its text and the library now calculates the initial header height to 'just fit' the default font. Will include in the next update.
I may look like a mule, but I'm not a complete ass.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Nice.

But don't make it too auto-smart or we'll get to a place where we have to write code to overwrite the clever bits. If that made sense ... :)

IMO, rather just have the stuff that lets us set things as we need.
Dare2 cut down to size
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

No worries. The changes made to the header affect just the initial height and should allow rw to seat his default font within a narrower header.

You can still manually set the height and the font etc. :)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Update. 31st October 2006.

Have uploaded a completed .chm manual for the library (finally! :) )

http://www.purecoder.net/egrid.htm
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Update. 1st November 2006.

Have altered the checkbox type cells so that if the user clicks into such a cell, but the cursor is not directly over the checkmark, then the cell is selected (but the state of the checkmark is not altered). Previously the cell would not have been selected under such circumstances.

This update also includes the minor alterations to the header described above and the completed .chm manual.

Install is now in the form of a .exe and the archive format is zip.

http://www.purecoder.net/egrid.htm
I may look like a mule, but I'm not a complete ass.
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Hi!

Works perfectly here!

Thank yuo for the update.


rw
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Have discovered a bug regarding the #egrid_CellUpdated message being called more times than required. It is now fixed and will be included in the next update.

:)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Full release version. 3rd November 2006.

Release 1.0.

:)

http://www.purecoder.net/egrid.htm
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

Great! Thank a lot!

Two questions:
Why has this file "egrid_Resident..res" two points?
Can you add German to the installer?
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thorsten1867 wrote:Great! Thank a lot!
Two questions:
Why has this file "egrid_Resident..res" two points?
Can you add German to the installer?
It's a Tailbite thing I reckon. I can never be bothered to change it! :) You can rename it to whatever you like of course.

As for the German installer, I'd first need someone to translate the licence and the read me etc.
I may look like a mule, but I'm not a complete ass.
Post Reply