Egrid 3.0 grid control (replaced by egrid 4)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Egrid 3.0 grid control (replaced by egrid 4)

Post by srod »

Update: - 8 Sept 2006.
See post below for details.

Update (now Beta 2) : - 5 Sept 2006.
See post below for details.

Hi,

all the changes (bug fixes, upgrades etc.) I've made in the last couple of days have resulted in a version of egrids which is superior than previous versions.

Changes include:
  • numerous bug fixes (all deliberate bugs designed to keep people on their toes! :twisted: )
  • reduced flicker, particularly when using grid lines.
  • quicker rendering due to a streamlined painting process.
  • the code dealing with check-box cells has been completely rewritten and now offers single click editing whereby a single click on a check box will not move the selection box from another cell, but will alter the contents of the check box accordingly (subject to the usual validation checks by the developer). This is a much more ‘natural’ way of dealing with check-box cells – and looks a hell of a lot better!
It's this last point which prompted a new version and a separate release of egrids. DOWNLOAD

Regards.
Last edited by srod on Mon Sep 18, 2006 11:38 pm, edited 6 times in total.
I may look like a mule, but I'm not a complete ass.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Just tried this version and it works great.

Do you know if it will work on windows2000?

I write a few programs for use in work and this would be ideal for at least one program but I find a lot of my programs look a lot worse in work due to windows2000 api not being as good as xp.

Thanks anyway and keep up the good work :D
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Derek wrote:Do you know if it will work on windows2000?
The previous version ran okay on Win 98 (after a bit of persuading! :) ) and I haven't really altered any parts of the code for this new version which should affect win 98 in any way.

So, assuming this new version runs on Win 98 ( :) ) it should run on Win 2000 (famous last words!)

Only one way to find out though... 8)
Last edited by srod on Mon Sep 04, 2006 2:22 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Re: Egrid 3.0 (beta version 1)

Post by mskuma »

Thanks this is great.
srod wrote:This is a much more ‘natural’ way of dealing with check-box cells
Likewise, I think you should consider to carry this concept along to the other types (as mentioned before), e.g. it is still required to click the text box twice to edit it - one click should be enough (click it to select it & introduce the cursor ready for editing). Same for the combo-box, click it to dropdown the list with the previous value still selected. This is particularly an issue since the combo-box is not selected when initially clicked, so you can't use the keyboard to rapidly select a known combo-box value - you must use the mouse (at least until when a value becomes highlighted/selected, then the keyboard can be used).

I could imagine consideration of the above would really speed up the process of editing many changes in the grid.

A friendly reminder to have shift-TAB to go backwards.

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

Post by srod »

Likewise, I think you should consider to carry this concept along to the other types (as mentioned before), e.g. it is still required to click the text box twice to edit it - one click should be enough ...
Ah, but as demo program 5 shows, you can easily simulate this by using a CellCallback function.

Must admit I'm reluctant to enable this by default because I like the way it operates now, i.e. we have a choice (because of the CellCallback function). It suits my applications.

Besides, once a cell is being edited, tabbing (or pushing return) will keep the grid in 'edit mode' anyhow.
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod, I guess scratch the above comment - I see your 5th demo code there which is the single cell callback you mentioned before, which I think would solve the issue above - sorry, I forgot about that. [edit: too slow! :) ]
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

:lol:

No worries.
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod, if you double-click to resize the first column 'transparent image' in demo 2 & 4, the column width collapses down considerably. Is that expected?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

That's just normal behaviour for a ListIcon.

In both examples I haven't prevented column 1 from being resized (doing so is easy enough through a CellCallback) and so double clicking reduces the column width to the widest text entry in the column.

Since the column is empty (containing only images) ... :)
Egrid will also only draw the image if it fits completely within the cell, i.e. it will not draw part images.

Getting around this is easy. Either prevent the column from being resized (or the entire grid) or place an empty string into any cell within the column with enough space characters to give you the desired width after double clicking etc.

E.g. replace line 108 in demo 2 with

Code: Select all

SetGadgetItemText(1,b,"     ",1)
to see what I mean.
I may look like a mule, but I'm not a complete ass.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

I will probably just knock something up and try it on a works computer oneday but if it isn't as good looking as on an xp machine then that is their lose!

Time for them to upgrade :D

Thanks
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

I've tested eGrid3 with my program. It works great. The new checkboxes are perfect. :D
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:I've tested eGrid3 with my program. It works great. The new checkboxes are perfect. :D
Excellent. Must admit they make the grid far far better and fit right into my current application.

:)
I may look like a mule, but I'm not a complete ass.
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Post by MrMat »

Nice work Stephen! :D
Mat
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Hi!

Good work, indeed!

Is there a way to sort the listview columns (Like gnozal´s purelvsort)?

That would be great!


Greetings


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

Post by srod »

rw wrote:Is there a way to sort the listview columns (Like gnozal´s purelvsort)?
Hi there rw.

Sorting columns is not something I've seen a need for, so I'm afraid that I do not intend to add this. I can see no reason why Gnozal's library shouldn't work with an egrid other than there might be problems due to the multiple sublassing etc. It's worth a try; either the 2 libs are compatible, or they're not! :)

If you do implement a column sort procedure, then take care to ensure that any CellCallback function you may be using has some mechanism of identifying which column is which?

For example, you might set up a grid so that all cells in column 2 are of combo box type (you inform the library of this through a CellCallback function). Following the sort routine, you might find that this column has moved and the CellCallback has no way of informing the library that this column (whereabouts unknown) is of a combo box type! In this case it will probably revert to a normal string type cell.

Regards.

@MrMat: thanks. Glad you like it.
I may look like a mule, but I'm not a complete ass.
Post Reply