Work in progress - xGrid
Work in progress - xGrid
This is a very very very early version of something I am working on. As such, it's not a code release but an exe to try out. It's all PB commands and WinAPI.
Basically, I'm trying to create a spreadsheet ala Microsoft Excel. I'm starting from the ground up building a custom 'control'. This is all hand drawn. There is no "real" limit to the number of columns and rows but for the purpose of this demo, I've limited it. The limit is not hard coded so it can be removed very easily.
The only things you can do currently in the demo is resize columns or rows, select columns or rows (even ranges) and scroll.
The base code is in place to allow multiple 'sheets' per control. Also, since I'm hand-drawing everything, it will be no problems at all to have all kinds of nice formatting per cell. Colors, alignment, etc... Multiple types will work per cell - strings or numbers (probably add in jack's nice double library for better math stuffs), etc... Sorting or whatever can be added nicely.
The nice thing about the way I have it set up is that it's all virtual. That's why it can display a theoretically unlimited amounts of rows and columns. They don't actually exist. The only time they exist is if you make a change to them. For example, I don't store the widths of the columns unless you change them. And then I store the width only for the columns that are changed. Fairly lightweight.
I'll work with it until I finish the current part and add in the cell manipulation and then I will post the code. Not sure if I will continue working on it after that. I guess it depends on if there's interest in it.
Without further ado, here is the program. It's an exe compressed by rar so just unrar it. No code is publicly available yet.
http://www.seijin.net/Storage/xGrid.rar
Let me know how it looks. No need to give me bug reports as I'm very aware of what current problems are ^_^ I'm just curious as to what y'all think of it so far. If it looks promising or not. I should have cell text editing by Monday (it's late Thursday night now).
EDIT: Fixed broken link. Sorry! ^_^
Basically, I'm trying to create a spreadsheet ala Microsoft Excel. I'm starting from the ground up building a custom 'control'. This is all hand drawn. There is no "real" limit to the number of columns and rows but for the purpose of this demo, I've limited it. The limit is not hard coded so it can be removed very easily.
The only things you can do currently in the demo is resize columns or rows, select columns or rows (even ranges) and scroll.
The base code is in place to allow multiple 'sheets' per control. Also, since I'm hand-drawing everything, it will be no problems at all to have all kinds of nice formatting per cell. Colors, alignment, etc... Multiple types will work per cell - strings or numbers (probably add in jack's nice double library for better math stuffs), etc... Sorting or whatever can be added nicely.
The nice thing about the way I have it set up is that it's all virtual. That's why it can display a theoretically unlimited amounts of rows and columns. They don't actually exist. The only time they exist is if you make a change to them. For example, I don't store the widths of the columns unless you change them. And then I store the width only for the columns that are changed. Fairly lightweight.
I'll work with it until I finish the current part and add in the cell manipulation and then I will post the code. Not sure if I will continue working on it after that. I guess it depends on if there's interest in it.
Without further ado, here is the program. It's an exe compressed by rar so just unrar it. No code is publicly available yet.
http://www.seijin.net/Storage/xGrid.rar
Let me know how it looks. No need to give me bug reports as I'm very aware of what current problems are ^_^ I'm just curious as to what y'all think of it so far. If it looks promising or not. I should have cell text editing by Monday (it's late Thursday night now).
EDIT: Fixed broken link. Sorry! ^_^
Thanks for the kind words.
@thefool - should be easy enough to do. I did a little test to see if it was possible without a huge amount of work and it looks promising ^_^
@Blade - I will watch out for that. You mean you just leave the mouse on top of the column headers and, without moving the mouse at all, the cursor will sometimes vanish?
UPDATE: I made some code updates.
Also, if you ever say to yourself, "Hey, this looks kinda like Excel..." well, yeah, I'm basing the look and some of the functionality on Excel.
Download at the same place ^_^
UPDATE 2: Made it so that a single cell selection will not have a blue-ish 'fill' and will instead only have the black border. And updated it to 'light up' the column and row header for the cell. As always, download at the same place.
@thefool - should be easy enough to do. I did a little test to see if it was possible without a huge amount of work and it looks promising ^_^
@Blade - I will watch out for that. You mean you just leave the mouse on top of the column headers and, without moving the mouse at all, the cursor will sometimes vanish?
UPDATE: I made some code updates.
- 1. Multiple row, column and cell selections should work by holding down the control key.
2. Cell selection should be working now. The column and row headers will 'light up' based on what cell is selected.
3. New cursor when mouse is over a cell.
4. When making a single cell selection or a contiguous cell range selection, a border will be drawn around the cell or range. A little rectangle will be drawn in the lower-right corner for possible future usage.
5. Various bug fixes and internal enhancements.
Also, if you ever say to yourself, "Hey, this looks kinda like Excel..." well, yeah, I'm basing the look and some of the functionality on Excel.
Download at the same place ^_^
UPDATE 2: Made it so that a single cell selection will not have a blue-ish 'fill' and will instead only have the black border. And updated it to 'light up' the column and row header for the cell. As always, download at the same place.
Ohhhhhhhhhhhhhhhhhh.
No wonder Blade was having problems. I feel stupid. Fixed the vanishing cursor and the floating rectangle.
The vanishing cursor is because I don't know how to include the cursors in the exe and then load them from within the exe. I thought I could do a IncludeBinary but I don't know how to read that back. LoadCursor_() does not seem to work if I tell it to use ?Label. Any ideas? In the meantime, I'm including the custom cursors with the *.rar file.
No wonder, Blade
Download at the same place.
No wonder Blade was having problems. I feel stupid. Fixed the vanishing cursor and the floating rectangle.
The vanishing cursor is because I don't know how to include the cursors in the exe and then load them from within the exe. I thought I could do a IncludeBinary but I don't know how to read that back. LoadCursor_() does not seem to work if I tell it to use ?Label. Any ideas? In the meantime, I'm including the custom cursors with the *.rar file.
No wonder, Blade

Download at the same place.
-
- Enthusiast
- Posts: 731
- Joined: Wed Apr 21, 2004 7:12 pm
Very impressive indeed! I've always wondered if anybody would be able to recreate Offive with PB and it looks like this is a great first step. I wonder, do you think it will be possible to make a Word control (you know, the blank page that you write on)?
~I see one problem with your reasoning: the fact is thats not a chicken~
I forgot to reset 1 single variablesrod wrote:Nice work there.
A slight bug though. Widen a column, then widen a row and if I then click in the cell lying in both the resized column and the resized row, the incorrect cell gets selected.
Impressive work nevertheless.


Until I get home, please download from the Pure Basic myftp server.
File:1->xGrid.rar

@Killswitch - I'm planning on making a simple spreadsheet but I don't think I personally will be doing any other 'office' products. Should be easy-ish to do some Word type program with the scintilla stuff right? Hell, maybe we could each pick a product and do a PureOffice

Update: Yet another update to fix a problem when making multiple cell selections. Still download from myftp.org link in this post.
-
- Enthusiast
- Posts: 731
- Joined: Wed Apr 21, 2004 7:12 pm
D'ya know that's exactly what I was thinking! I'm not sure if scintilla would work (is it soley tied to edior gadets, or the 'scintilla' gadget?) - I was thinking more of something from scratch like this
.
PureOffice would deffinatly be cool though!

PureOffice would deffinatly be cool though!
~I see one problem with your reasoning: the fact is thats not a chicken~