xGrid (Spreadsheet / Grid Control) for PB4

Developed or developing a new product in PureBasic? Tell the world about it.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

xGrid (Spreadsheet / Grid Control) for PB4

Post 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
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Haven't had an opportunity to test it yet, but regardless, thanks again for another fine contribution.

cheers
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

thanks Xombie, looking good :D
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Big and nice Job :D
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

:D

Champion stuff. Thanks, Xombie
@}--`--,-- A rose by any other name ..
Amundo
Enthusiast
Enthusiast
Posts: 200
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Post 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...
Last edited by Amundo on Wed May 10, 2006 11:58 pm, edited 1 time in total.
Win10, PB6.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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.
Amundo
Enthusiast
Enthusiast
Posts: 200
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Post by Amundo »

Thanks Xombie, yeah, just edited my original post, can't be compiling it properly.
Win10, PB6.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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
:)
Amundo
Enthusiast
Enthusiast
Posts: 200
Joined: Thu Feb 16, 2006 1:41 am
Location: New Zealand

Post 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...
Win10, PB6.x, okayish CPU, onboard video card, fuzzy monitor (or is that my eyesight?)
"When the facts change, I change my mind" - John Maynard Keynes
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Good tip, jack. Thanks.
@}--`--,-- A rose by any other name ..
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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.
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post 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
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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'.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply