Page 1 of 4

xGrid (Spreadsheet / Grid Control) for PB4

Posted: Wed May 10, 2006 9:07 pm
by Xombie
I've updated the original xGrid code for PB4 (99% of the effort was in adding Define for the variables).

I've also added in a new IsNumber() and expression solving function so that should speed up any expressions by a lot. However, I had to rework how it handles cell referencing so I'd appreciate any reports on bugs in the expression solver. Also, there are only two functions at the moment - Round() and Max(). I'll add more later and I welcome any suggestions.

The project is not unicode compatible at the moment. That's a later update. Probably much later since I have a lot of other things to do and this is a pretty low priority to me. It's a large project, doesn't make any money and I don't actually use it so it's not as fun for me to update.

Features are still missing as this is a direct conversion from the original xGrid code. And I'm sure there are a lot of bugs. Let me know if you find some.

Doubles and Quads are supported so accuracy (precision?) should be much better.

What else? I dunno. Oh, here's a simple screenshot...

Image

Shows a formula and how it works with a cell reference.

Let me know if y'all find anything or just drop a note to say hey. Oh, and it's LGPL.

http://www.seijin.net/Storage/Code/xGrid/xGrid.7z

Posted: Wed May 10, 2006 9:38 pm
by rsts
Haven't had an opportunity to test it yet, but regardless, thanks again for another fine contribution.

cheers

Posted: Wed May 10, 2006 9:51 pm
by jack
thanks Xombie, looking good :D

Posted: Wed May 10, 2006 10:12 pm
by Droopy
Big and nice Job :D

Posted: Wed May 10, 2006 10:39 pm
by Xombie
Fun with cell colors :)

Image

That's supposed to be "PUREBASIC 4.00 :P X-Grid" ... I never claimed to be an artist :D

Posted: Wed May 10, 2006 10:41 pm
by Dare2
:D

Champion stuff. Thanks, Xombie

Posted: Wed May 10, 2006 11:43 pm
by Amundo
WOW!

Only had a quick play (I'm at work...shhhh...don't tell the boss). My God, this is awesome! Very nice!

Thank you, this is excellent! Only problem is, no cursor/mouse pointer while over the grid area. Must be my setup, will play around some more.

Cheers Xombie!

DOH! The lack of cursor must be in the way I'm compiling, will continue to play...

Posted: Wed May 10, 2006 11:55 pm
by Xombie
Thanks, fellas :D

@Amundo - When I compile the program (using Japbe for PB4), I use resources. If you pull up Main.pb with a plain text editor, you'll see the info at the bottom of the file.

Code: Select all

; ResourceType3=4
; ResourceName=2
; ResourceLanguage=0
; ResourceFile=old_CellSelect.cur
; ResourceType3=4
; ResourceName=3
; ResourceLanguage=0
; ResourceFile=RowSelect.cur
; ResourceType3=4
; ResourceName=4
; ResourceLanguage=0
; ResourceFile=ColumnSelect.cur
; ResourceType3=4
; ResourceName=5
; ResourceLanguage=0
; ResourceFile=SizeV.cur
; ResourceType3=4
; ResourceName=6
; ResourceLanguage=0
; ResourceFile=SizeH.cur
I haven't messed around with the PB editor's resource usage so I'm not sure how to set this up. Maybe someone else can chime in?

I think the PB editor loads an .rc file so maybe...

Code: Select all

2	CURSOR	old_CellSelect.cur
3	CURSOR	RowSelect.cur
4	CURSOR	ColumnSelect.cur
5	CURSOR	SizeV.cur
6	CURSOR	SizeH.cur
With that saved as xGrid.rc and then go to Compiler->Compiler Options->Resources Tab->" ... " and load xGrid.rc? In the PB editor.

Maybe.

Posted: Thu May 11, 2006 12:00 am
by Amundo
Thanks Xombie, yeah, just edited my original post, can't be compiling it properly.

Posted: Thu May 11, 2006 12:02 am
by jack
jack wrote:a tip for people using the PB IDE.
assuming that you created a folder "C:\Program Files\PureBasic\Examples\xGrid" and extracted xGrid to that folder.
save the following as "cursors.rc" in same folder

Code: Select all

2	cursor	discardable "C:\\Program Files\\PureBasic\\Examples\\xGrid\\old_CellSelect.cur"
3	cursor	discardable "C:\\Program Files\\PureBasic\\Examples\\xGrid\\RowSelect.cur"
4	cursor	discardable "C:\\Program Files\\PureBasic\\Examples\\xGrid\\ColumnSelect.cur"
5	cursor	discardable "C:\\Program Files\\PureBasic\\Examples\\xGrid\\SizeV.cur"
6	cursor	discardable "C:\\Program Files\\PureBasic\\Examples\\xGrid\\SizeH.cur"
now goto compilers/options/resources and add cursors.rc
:)

Posted: Thu May 11, 2006 12:10 am
by Amundo
jack wrote:
jack wrote:a tip for people using the PB IDE.
assuming that you created a folder "C:\Program Files\PureBasic\Examples\xGrid" and extracted xGrid to that folder.
save the following as "cursors.rc" in same folder

:)
Thanks Jack! :D

It's even MORE beautiful now...brings a tear to my eye...

Posted: Thu May 11, 2006 1:04 am
by Dare2
Good tip, jack. Thanks.

Posted: Thu May 11, 2006 1:16 am
by Xombie
Stooop eet... I'm blushing :oops:

:D

As long as it's useful for something, I'm happy. Or not. I learned a lot while plodding through the process of making that sucker.

Posted: Thu Jun 15, 2006 3:01 pm
by ebs
xombie,

Your new xGrid is GREAT!

I have one suggestion to make it easier to resize the column width.
Right now, I have to put my cursor exactly on the dividing line between two columns to be able to resize a column.
Since the line is only one pixel wide, this is very hard!
Please consider allowing a "margin" on either side of the divider, maybe 10 pixels or so.

This idea isn't my original; I "borrowed" it from Microsoft's Excel spreadsheet.
But there's no shame in sharing a good idea, is there? :wink: :wink:

Regards,
Eric

Posted: Thu Jun 15, 2006 6:25 pm
by Flype
yes, huge work, congrats.

i noticed a little bug about formulas:

for example '=A4+C5' is ok but not with 'double letters column' like '=AB4+CE5'.