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

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 4 grid gadget - (static PB library version.)

Post by srod »

Image

egrid 4 is a complete and utter total rewrite (as I think the screenshot suggests!)

It is not compatible with earlier versions, such are the nature and scope of the changes. So any code running with an egrid version 3 will need altering before using an egrid version 4.

It is simply not comparable. See the 'history.txt' file for a list of some of the changes, e.g. extra celltypes, customised headers, better scrolling, far more 'hot keys' used etc.

I'm releasing in beta form because even though a few kind souls have been testing this out, there inevitably remain some bugs to fish out and feed to the cat. The best way is to thus release a version and let the assembled masses rip the library to shreds!

There's no manual at the moment, but a .chm help file will follow.

It's difficult to list out the features as they are now quite numerous. Indeed I've only enclosed two examples, which are not really enough to get to grips with some of the features.

Perhaps a list of user functions will help:
  • egrid_AddColumn(gadgetnum, column, text.s, width)
  • egrid_AddRow(gadgetnum, row)
  • egrid_AppendCells(gadgetnum, column)
  • egrid_ClearRows(gadgetnum)
  • egrid_CopyCells(gadgetnum, column, row, xcols, yrows)
  • egrid_CreateGrid(gadgetnum, x, y, width, height, rowheight, styleflags, furtherstyles)
  • egrid_CreateCellCallback(gadgetnum, Address)
  • egrid_FreeGrid(gadgetnum)
  • egrid_GetCellText(gadgetnum, column, row)
  • egrid_GetColumnOrderArray(gadgetnum, *memorybuffer)
  • egrid_Height(gadgetnum)
  • egrid_HideEdit(gadgetnum)
  • egrid_HideGrid(gadgetnum, state)
  • egrid_MakeCellVisible(gadgetnum, column, row)
  • egrid_NumberOfColumns(gadgetnum)
  • egrid_NumberOfRows(gadgetnum)
  • egrid_PasteCells(gadgetnum)
  • egrid_RemoveCellCallback(gadgetnum)
  • egrid_RemoveColumn(gadgetnum, column)
  • egrid_RemoveRow(gadgetnum, row)
  • egrid_Resize(gadgetnum, x, y, width, height)
  • egrid_SelectCell(gadgetnum, column, row, editingcell.b)
  • egrid_SelectedColumn(gadgetnum)
  • egrid_SelectedRow(gadgetnum)
  • egrid_SetCellText(gadgetnum, column, row, text.s)
  • egrid_SetColumnOrderArray(gadgetnum, *arrayindexes)
  • egrid_SetHeaderFont(gadgetnum, font)
  • egrid_SetHeaderHeight(gadgetnum, height)
  • egrid_SetOptions(gadgetnum, headerbordercolour, selectionbordercolour, selectionborderwidth)
  • egrid_Width(gadgetnum)
  • egrid_x(gadgetnum)
  • egrid_y(gadgetnum)
I'm not releasing the source for this library as yet (and am undecided on that score), but I have enclosed a copy of the source for the resident file so you can see all constants that you might need to use etc.
Again I'll give full details within the forthcoming .chm help manual.

One thing to note is that you should NOT use any of the Purebasic gadget commands with an egrid version 4. For example, do not use AddGadgetColumn() etc. Use the commands above instead. Use of the native PB gadget commands on a version 4 egrid will, at best, crash the program, at worst, send you off to PC World to buy a new hard drive! :)

Another thing for those used to using earlier versions; columns are now indexed from 0 to egrid_NumberOfColumns() - 1. This brings it into line with the row indexes.

Anyhow, enjoy; a lot of work has gone into this one and I reckon I've now taken a ListIcon based grid control as far as I can.

At least until version 5...

:)

http://www.purecoder.net/egrid.htm
Last edited by srod on Fri Mar 30, 2007 11:32 pm, edited 6 times in total.
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 »

That's a fantastic grid! Congrats!
Mat
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thanks Mat, aka egrid bug spotter numero uno! :)

Thanks for all the help, it's been much appreciated.
I may look like a mule, but I'm not a complete ass.
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

This is simply amazing!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

White Eagle wrote:This is simply amazing!
I'm not one for disagreeing! :lol:

Thanks. I hope it's useful.
Last edited by srod on Tue Sep 19, 2006 1:28 am, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

you should think about making it a commercial product. :)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

jack wrote:you should think about making it a commercial product. :)
I'm certainly thinking along those lines; but not so much for the PB community, because I take out as much as I put in.

A dll version of egrid 4 will follow at some point and then of course I can offer it to developers in other languages as a cheap, but what I hope is a very versatile grid etc. We'll see.
I may look like a mule, but I'm not a complete ass.
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

* Warning * Implementing egrid into your program is extremely addictive.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

White Eagle wrote:* Warning * Implementing egrid into your program is extremely addictive.
:lol:

Sounds awesome, srod. Going to play with it this weekend.
Dare2 cut down to size
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

You just saved my day Srod. Many many thanks for this unbelievable work!
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Hi,

thanks.

Don't use any #egrid_PBImage type cells at the moment because I'm going to alter the way these operate in order for developers in other languages to be able to use egrid 4. Basically I will switch image# for imageID's and introduce a new celltype of #egrid_Icon.

A bit busy at the moment, but I should get round to it this evening.

:)
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Very impressive, thanks !
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
zikitrake
Addict
Addict
Posts: 868
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Post by zikitrake »

:shock: Great! :shock:
PB 6.21 beta, PureVision User
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Very nice, go on please! :D
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

*bump* :roll:
Post Reply