Page 15 of 25
Posted: Wed Oct 18, 2006 6:43 pm
by srod
(I'm having problems with a major redrawing issue at the moment so the next update will be a little delayed.

)
Try #egrid_CellUpdated. Whenever a checkbox is clicked, it fires this event to inform the program that the cell has changed.
Not sure about altering the checkbox by using the spacebar though.
Posted: Thu Oct 19, 2006 10:09 pm
by srod
BETA 4 released. 19th October 2006.
This is quite a big one and what will be the last beta before a full release.
Added a Unicode threadsafe version of the lib and everything is packaged within a nice installer (thanks to Thorsten1867's excellent EasySetup

).
Numerous bug fixes, a new cell type (command buttons), numerous requests addressed and mostly implemented. Vastly improved integration with PURELVSort (thanks Gnozal). Note, egrid now automatically removes the selection box when a sort is underway so you no longer need to do this yourself.
A lot of changes on the headers have been forced on me by various bugs in the Windows common controls library. The biggest is the fact that I've had to take over the column resize completely and code this from scratch. The result is a far faster and smoother resize as I've essentially removed the full column resize as you drag (removed the #HDS_FULLDRAG - but herein lie the Windows bugs).
Did some testing on Win 98 and got it working. Subsequent alterations may mean the code doesn't run properly on win 98. I'll test this again when I get the time.
An extra demo program shows how to reinstate the selection box after a column resize or a column drag etc.
I've been testing the new stuff for quite some time, but haven't had so much time to test whether I've broken any of the old code!
Please see the
history page for a list of changes.
Have also added a free-and-cheerful message board to the egrid site. Why not indeed!
Right, I'm off to get some sleep!
http://www.purecoder.net/egrid.htm
Posted: Fri Oct 20, 2006 6:08 pm
by rw
Hi srod!
Thanks for the new version. It´s almost perfect. The integration with
purelvsort is very useful. The new #egrid_RegainFocus event works
perfect.
My remarks on the new version:
The header rendering (No custom header) has changed. With the default
PB-font the header must now have a minmum height of 26 to render
correctly. Although the the header icon of purelvsort vanished. Please
take a look.
With custom header the minimum size is although 26. It´s only optical, but
could you take a look if the minimum size could be reduced?
I think you need a egrid_setHeaderWidth command. For now i use the purelvsort command, but i think we need a native egrid-command.
Really very very good work!
By
rw
Posted: Fri Oct 20, 2006 6:34 pm
by srod
rw wrote:Hi srod!
Thanks for the new version. It´s almost perfect. The integration with
purelvsort is very useful. The new #egrid_RegainFocus event works
perfect.
Thanks. It was a lot of work.
rw wrote:My remarks on the new version:
The header rendering (No custom header) has changed. With the default
PB-font the header must now have a minmum height of 26 to render
correctly. Although the the header icon of purelvsort vanished. Please
take a look.
Have fixed the column height problem. Well done for spotting that. That one escaped me.
The thing is that in order for the new command button type cells to 'blend' in with the header cells, I was forced to attack the header and alter the 'standard' header to a custom one made to look as much like a standard one as I could manage. In doing this I screwed around with the margins etc. Forgot about that!
It also meant me sacrificing the sort icon - something you'll have to live without I'm afraid. I will eventually allow the use of icons in header cells, so you can place some icons of your own for the sorting etc.
rw wrote:I think you need a egrid_setHeaderWidth command. For now i use the purelvsort command, but i think we need a native egrid-command.
I was thinking about that, but there's enough commands already. Remember that the #egrid_RegainFocus will not fire if you alter the column width in code. I can alter this I guess if you really need it.
rw wrote:Really very very good work!
Next update will be a few days away as I'm off for a piss up .. uhm I mean cultural visit...

Posted: Fri Oct 20, 2006 6:57 pm
by rw
Hi!
I write a code to fill the egrid on cursor movement. Problem here is if the
user takes the vertical scrollbar to move the egrid. Do you know if it´s
possible to get the scrollbar position and recognize.
Perhaps a winapi way?
Thanks
rw
Posted: Fri Oct 20, 2006 7:03 pm
by srod
Not sure what you're after here? Why not just populate the whole grid?
Are your working towards a virtual grid or something?
Posted: Fri Oct 20, 2006 7:06 pm
by ts-soft
thx for the new version
can you change the packformat from the installer, from jcalg1 to zip
i have a other folderstructure for the examples, so i will unpack this by
myself.
regards
Thomas
Posted: Fri Oct 20, 2006 7:08 pm
by srod
Will do.
How do you unpack it yourself? If you don't mind me asking.
Posted: Fri Oct 20, 2006 7:27 pm
by rw
Hi!
Don´t know what a virtual grid is

.
It´s the performance. Try to populate the grid with > 10000 rows.
rw
Posted: Fri Oct 20, 2006 7:27 pm
by Thorsten1867
ts-soft wrote:can you change the packformat from the installer, from jcalg1 to zip
It's possible to create both, a setup program and a ZIP-file, with EasySetup.
Posted: Fri Oct 20, 2006 7:35 pm
by srod
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?

Posted: Fri Oct 20, 2006 8:17 pm
by rw
Hi!
I fill the grid with the first 100 (from 10000) dataitems. Then, if the user
scrolls down (cursordown, pagedown) i load the next 100 dataitems and apend them in egrid.
If the vertical scrollbar is used i must append xxx dataitems. If i could catch the scrollbar (scrollbar position) i could do that.
Grettings
rw
Posted: Fri Oct 20, 2006 8:27 pm
by srod
Right, it's win api I'm afraid.
I haven't time to test this, but you need to subclass the egrid and examine the #WM_VSCROLL message.
Psuedo code for your #WM_VSCROLL handler:
i) call the 'previous' handler with CallWindowProc_(). This is essential as I have completely customised the scrolling of an egrid.
ii) Use a combination of the #LVM_GETTOPINDEX and #LVM_GETCOUNTPERPAGE to figure out the top most visibleitem and the number of visible rows etc.
Afraid I haven't time to code this and I'm not 100% sure this will do what you're after without alteration.
This isn't really something I can add to the library except to say that what you're really after is a 'virtual' egrid and this will have to wait a while I'm afraid.

Posted: Fri Oct 20, 2006 9:16 pm
by rw
No problem!
I don´t think, that this must belong to the egrid lib.
I will try it with the winapi.
What are virtaul grids?
rw
Posted: Sat Oct 21, 2006 8:52 am
by srod
rw wrote:What are virtaul grids?
Right, I'm away for a few days now so won't be able to help out for a while.
To be honest rw, I would advise that you halt what you're doing because it just doesn't make sense to set up an egrid with 10000 rows but only ever fill 100 rows with data.
The egrid library will not be any faster for doing things this way as it only paints the visible cells anyhow (mostly!). That is 10000 rows with only 100 containing text will not be any faster than 10000 rows with every row containing text. Granted, I accept that the speed problems will be in loading the original data etc. but I think you should look elsewhere to get around this.
Either set up the egrid with 100 rows and load them dynamically, or... wait for the virtual egrid!
A virtual egrid would NOT store any of the cell contents (and neither would Windows). Instead, every time a cell needed to be painted, egrid would call your Cellcallback function and ask for the text etc. This would be the ideal way of addressing your problems.
Unfortunately, implementing this into egrid is not as straight forward as it sounds because of certain 'dirty tricks' which I've used to cut a few corners!
A virtual egrid is now next on the 'todo' list.
