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

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

srod wrote:How about using a column of checkboxes and those which are checked get deleted when the user hits the delete button etc?
I think it's easy to solve with egrid_CreateCellCallback().
srod wrote:If this is a big problem then I'll reinstate the original functionality, but then the emphasise is on the developer to hide the selection box whenever another control receives the focus.
It's better if it is possible to control it. Perhaps it would be a good idea to use a flag like '#egrid_AlwaysShowSelection'
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 »

Good idea, I'll get on it.
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 »

SUCCESS!!!

Have managed to 'persuade' Tailbite to produce a unicode version of egrid - which doesn't crash!!!

A bit more testing to do, but fingers crossed...


**EDIT: have been busy today! Shift/tab works as requested. Have added an extra flag #egrid_AlwaysShowSelection used when creating an egrid which works as requested by Thorsten1867 (above) and of course have managed to create a unicode version of the library.
I won't be able to upload until later though as I am away from my broadband connection at the moment.

@mskuma: I don't necessarily see a problem with using an egrid for large datasets. After all, an egrid is simply a ListIcon given an extra polish and a fresh coat of paint! If it does slow down too much, then consider using a standard header as opposed to a custom one. Also, go easy on other customisations perhaps.
I do intend allowing for 'virtual' egrids at a later date which should also help when using very large data sets 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: 8 October 2006.

A few ammendments (still at beta 2).

Have added 'shift/tab' functionality to tab in reverse through the grid etc. Have ammended the egrid_AddColumn() function so that a column index of -1 causes the new column to be appended etc. Have also added the creation flag #egrid_AlwaysShowSelection which prevents the selection box from vanishing whenever an egrid loses focus.

Most importantly, however, is the fact that the download now contains 3 versions of the library:
  • an ANSI non-threadsafe version
  • an ANSI threadsafe version
  • a UNICODE non-threadsafe version (for testing purposes only at the moment).
If the unicode version proves to be stable then a 4th version will be forthcoming; a UNICODE threadsafe... :)

http://www.purecoder.net/egrid.htm
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 »

Neat.

Thank you for following up on that!
Dare2 cut down to size
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

I've download the new version.
Now I get the error, that 'egrid_containerID()' is missing.
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 download the new version.
Now I get the error, that 'egrid_containerID()' is missing.
Thorsten, this function is no longer exported because with all the added commands, I could see no need for it. I can't think why you'd want the controlid of the container gadget?

Anyhow, here's a workaround:

Code: Select all

GetParent_(GadgetID(#egrid)) ;Handle of the container gadget.

Code: Select all

GetDlgCtrlID_(GetParent_(GadgetID(#egrid))) ;The controlid of the container gadget.
I hope this helps.
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 »

Thanks! It works, but I don't understand, why it must be removed. With 'egrid_containerID()' it was possibel to use eGrid with other libaries (e.g. PV_Gadgets).
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 »

Ah yes I see. Sorry, forgot about that.

I can reinstate the command for the next version if you'd like. I must admit though that I'd rather keep it out as it encourages some 'dodgy dealings' where an egrid is concerned and if such code breaks the lib, then I cannot really be held to account! :)
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 »

Did someone say "dodgy dealings" 8) I'm in!
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 »

Aye, there's always an aussie around when there's 'dodgy dealings' afoot! :D

hehe.
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 »

I think all 'PureVisionXP'-User would be glad, if you add 'egrid_containerID()' again.
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 »

Ok, but it was never really documented anyhow. I think I made one mention of it in a much earlier version of egrid.

I will reinstate it. In the meantime, just create your own procedure named egrid_ContainerID() and using the above workaround etc.
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 »

Dare wrote:Thank you for following up on that!
Agreed. Thanks srod for keeping on top of it! I'm looking forward to trying it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

You're welcome.

btw, I have fixed the gridline alignment problem - turned out to be easier than I thought!

The fix will only work if you use a custom header with an egrid as I have no control over the placement of the gridlines or the painting of a standard Windows header.

Will upload new versions tomorrow afternoon. :)
I may look like a mule, but I'm not a complete ass.
Post Reply