Work in progress - xGrid

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:

Post by Xombie »

Okay, new update. However, be aware of one thing.

This is super untested at the moment. It's basically hot-off-the-grill. As in I just finished adding stuff a few minutes ago. I wanted to upload a copy for people to check out since I won't have time to work on it for a day or so. Depends on some things.

Anyway, several new things are added. Let me see if I can remember what's different. I'll just list stuff and if it was already in, well, okay :D

You'll notice a lot of "You should be able to..." because like I said - really untested at the moment.
  • 1. Multiple column, row and cell selections are available. You should be able to hold down the control key to make multiple selections.

    2. You should be able to use your arrow keys (and page up/down) while in the grid.

    3. Also, you should be able to make selections while in the grid. Try holding down the shift key while moving the arrows.

    4. Middle button scrolling should work. Don't expect a fancy cursor change when you do it. Maybe I'll add a custom cursor a little bit later but for now it'll look like a normal mouse arrow while you do it. Should allow you to scroll in all directions.

    5. There are notes available per cell. IE, you can add a note to whatever cell you like and when you hover over it, it should display the note. I'll try spiffing it up later to look pretty...er.

    6. I've enabled some of the formatting abilities in this demo. For example, you can change the colors for a selected row, column or cell. Selecting the colored cells should show a different color.

    7. You can also change some of the text properties. These include - text color (via the 'Text Color' button or the color option from the 'Font' button), the font name, size and style and the horizontal and vertical alignment for a cell.

    8. Drawn text *should* inherit properties from columns or rows. For example, if you change the font size for a column to 20 and then add text to a cell in that column, it will display using a size of 20.

    9. Cell text editing is now in - in it's infancy. You can either start typing while a cell is selected (and the grid has focus) or you can double-click a cell. Yes, I'm aware the edit box vanishes if it scrolls slightly out of view. Scroll it back in and it's there again ~_~

    10. .... ummmm... I think that's it?
Like I said - still very much a work in progress. The code is still unoptimized and there is older legacy code next to newer (and wiser :D ) code. I'll release the code when I'm happy with how everything works. For now, try the demo and see what you think.

Download Here: http://www.seijin.net/Storage/xGrid.rar

Have fun! :D

*crosses his fingers that he didn't miss any horribly glaring bugs... again*
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Xombie,

Great new features! I have found two problems during testing:

1. When setting the font for a cell, the size is much smaller than expected.
I have to use a font size of at least 16-18 pt. to make it readable. A standard 10 pt. font is tiny.

2. Sometimes when entering text into a cell, I type "123" but the cell shows "a23".
This seems to happen only when I don't double-click in the cell before entering text.
This is hard to reproduce - it doesn't happen frequently.

Keep up the good work!

Regards,
Eric
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Thanks for the points, ebs. I knew about the small font issue already but didn't have time to mess with it. I fixed it and the "123" -> "a23" problem. That one was because wm_keyup reports numpad0 as an 'a'.

I've also thrown in a simple tab control to show how changing sheets (not bed sheets :D ) will be. I've only tested it a few times but it should behave alright. The nice thing is, there's really no limit to the number of sheets you can have. Until you actually *do* something on that sheet, it only takes up a few bytes in memory. And then it behaves like any other sheet - only using what is needed. I'll add a simple Insert/Delete Sheet right click menu thingie later ^_^

So give it a shot and see how it is. I'll apologize for how the tabs look. Kinda squished but I didn't want them to take up a lot of space :)


Download Same Place: http://www.seijin.net/Storage/xGrid.rar


PS - Do y'all think people would pay for a lightweight single executable spreadsheet? It wouldn't have a lot of frills or a huge amount of features but just basic stuff. Do you think some people might fork out... I dunno... $10? for something like that? Just out of curiousity.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

to be honest, no, people are all into copying, like it or not, there's probably not a single privately owned machine out there that runs windows and does not have a copied office on it :-/

i'd BE willing to shell out for a PBoffice though :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

once ready and debugged, I'd be very interested in forking out $10 or so for your xGrid control.

As to a speadsheet that small: it would be of interest, but not on pc's. If you can talk Fred into supporting PocketPC's, I'd be interested....
Last edited by dell_jockey on Mon Oct 10, 2005 2:06 pm, edited 1 time in total.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

@blueznl - I'm sure you're right. I was just wondering if people would like a small portable single executable spreadsheet and be willing to pay money for it. However, if US pirates haven't made it clear enough, my few trips to China made it crystal clear. Pirating is king :?

@dell_jockey - I hadn't considered trying to market it as a separate control. If I went that route, I'd probably release a "donation-ware" mini spreadsheet and then possibly charge $5 for a grid control. Not sure yet. On one hand, I wouldn't mind making a little bit of money off it (I've never sold any of my programs or code) but I'm not sure how many would be interested in a grid control or even if mine is up to the task.

If I did sell the control for $5, what kind of features would you expect to see? And this would be compiled into a library like purelvcolor, etc...?

I never had to do this kind of thing so it's all new to me. Would that be something people are interested in? Not sure how many pb'ers are looking for a grid control.

Last note - the version I linked to yesterday also shows resizing and how it looks.

Is the program running okay? What operating systems are y'all using? Is it's speed decent?
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Xombie,

I just tried your latest version. The font sizing works fine now. The tabs are a great feature.

The resizing seems to work OK, except there is a lot of flickering when the grid and the scrollbars are redrawn.
I am running Windows XP Pro, and this happens when "Show window contents while dragging" is enabled in the Display Properties.
With this option turned off, only one redraw occurs, so there is no flicker.

My preference for the control would definitely be in a compiled library. I would happily pay $5.00 (maybe a little more) for the current feature set.
I would want a way to control things like the number of rows/columns, all of the cell attributes (on the buttons), and the tab setting and scrollbars from my program.

You keep making new versions and I'll keep testing them! :wink:

Regards,
Eric
theNerd
Enthusiast
Enthusiast
Posts: 131
Joined: Sun Mar 20, 2005 11:43 pm

Post by theNerd »

I would be interested in a Spreadsheet control for $5-$10.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I think I will just release the code for this. I will release it early November because I will be on a trip for two weeks starting this Friday. I don't want to release the code and then vanish for 2 weeks while people try things. So, I'll wait to release the code itself when I get back. Releasing the code does not mean I will never update the project again. I hope to still be the one to update the 'official' code but I guess we'll see what happens.

To be honest, I was being kind of greedy. I hoped to make a small freeware spreadsheet (well, donationware) and not release the code so I had an edge but then I thought that was silly and would just release the code. Of course, if you feel like donating money to me, I won't stop you. It'd certainly force me to make updates :D

In the meantime, I hoped to make a library so people could test how it works in their own app but it seems like tailbite doesn't like me. It always crashes at the 'splitting functions' step. Are there any special processes that need to be done when creating? The only difference I did was to make a few of the Procedures into ProcedureDLLs - the ones I want to be visible. I have a lot of constants, some enumerations and a few global variables (global to the grid functions, anyway, not needed for the whole project). Am I supposed to do something different for those?

Anyway, I uploaded a new test exe.

This version includes a complete overhaul of the code that draws the grid itself. I also fixed a few bugs and glitches along the way. I'm wondering if I introduced more when I changed the drawing code but I didn't see any problems yet. I tweaked some of the color and text positioning while I was at it.

I've also added in a simple ability to add new sheets (right-click on the tabs). No delete ability yet, that's next and shouldn't be *too* hard to do. I'd do it now except I'm going jogging after I post this :D

I also added another little formatting button to allow for drawing of text at an angle.

The other major thing in this version (other than the drawing overhaul) is the ability to limit to a specific number of columns and rows. This is set at control creation so in the demo, I prompt the user for column and row number and then pass that to the control. I haven't tested this yet much. Any area beyond the columns or rows should be an unselectable gray area.

Double-clicking on the column or row dividers should resize that cell appropriately, based on the longest/tallest font.

I think that's it for now. I'm not sure how to handle flickering. I imagine it's something to do with double-buffering but I have no good code examples for me to try it. I guess for now it'll have to be a negative for the code ^_^;

I'll take a look at allowing the custom scrollbars/tabs to be turned off. Shouldn't be too hard, either. I was going to go that route initially but then decided I'd just add them for the demo. So I may totally get rid of the custom scrollbars & tabs. Not sure.

Incidentally, ebs, TheNerd, what would you fellas use the grid for?

Download Here: http://www.seijin.net/Storage/xGrid.rar
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Wonderful job!
I just found two bugs:

- Create a 4x4 sheet, resize the elements a bit and doubleclick in the gray area: a "hidden" cell can be edited :)

- Resizing rows: The cursor should changes shape in between two rows. Right now that area is in thb bottom of every row.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Blade wrote:Wonderful job!
I just found two bugs:

- Create a 4x4 sheet, resize the elements a bit and doubleclick in the gray area: a "hidden" cell can be edited :)

- Resizing rows: The cursor should changes shape in between two rows. Right now that area is in thb bottom of every row.
Alright, I fixed that first bug.

I'm not sure what you mean about the 'resizing rows' comment, however. Can you explain a little more?

I've made several changes to existing procedures in hopes that it would speed them up and make them easier to use with other procedures. That meant fixing a lot of new bugs as I did it. A LOT of new bugs :cry:

But hopefully now it's faster with a more stable base. I guess we'll see over time :) I've also done a rather large overhaul of the input key fuctions. As an example, you *should* be able to hit tab and have the selected cell jump to the right. Hitting enter should move down, using the arrows while editing a cell will save the contents and then move to the cell. Hitting the end key followed by the arrows should behave similar to Excel and jump to the next contiguous block of text. Etc... lots of changes to how the keyboard reacts so let me know if I missed something there.

I've also started working on cell type processing. Right now I'm just allowing for four types to be changed (no hardcoded limit to the different types at the moment, I'm just allowing 4 for the demo to kind of show it). I've just begun this part so don't expect much at the moment. Currency is set up to show red when negative and also to right-align when no alignment is set. Number types will right-align but show black negatives. Dates aren't set up to do anything different at the moment.

So, yeah, don't expect miraculous things to happen when you change the type :) I'll be working on it tomorrow so that it behaves more like a spreadsheet. IE, entering a date and then changing to a number format will give the numeric value of the date. Or entering a number and then changing to date type will show the date equivalent, etc...

After that will be some simple formula calculations.

I used the new optimization stuff going around just to see how it works :) Let me know if bugs are spotted or etc...

Have fun!

Download Here: http://www.seijin.net/Storage/xGrid.rar
theNerd
Enthusiast
Enthusiast
Posts: 131
Joined: Sun Mar 20, 2005 11:43 pm

Post by theNerd »

Xombie, I write a lot of database apps in VB and grids are always used. This would help me write various business apps in PureBasic that normally I wouldn't be able to.
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Xombie wrote:I'm not sure what you mean about the 'resizing rows' comment, however. Can you explain a little more?
Well, to resize the rows (vertically) you have to grab the line that is between two rows (just like resizing columns).
The bug is that to grab that line I have to place the pointer some pixels above it.
In other words, the "grab area" is a bit misplaced.
Fred
Administrator
Administrator
Posts: 18238
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Looks very promizing !
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Blade wrote:Well, to resize the rows (vertically) you have to grab the line that is between two rows (just like resizing columns).
The bug is that to grab that line I have to place the pointer some pixels above it.
In other words, the "grab area" is a bit misplaced.
Oh. Yeah. Fixed. I think ^_^

Okay, I didn't plan on releasing any more demo code before I go for vacation but here's another executable. I'm adding it in addition to the previous demo because this one is just for viewing and debugging. And does some weird stuff. Like I have cut cells set to change back color. None of the right-click stuff for columns or rows works. Just the popup menu will display. Also, the cursors are now stored as a resource so there is just the single exe.


Anyway, I'll be gone for two weeks now. Try this demo to see how right-clicking and other things work. My new plan is to release a small spreadsheet and the code at the same time so maybe the code won't be ready until December.

http://www.seijin.net/Storage/xGrid2.rar

Sorry for the rush but I'm literally running out of the door to catch my bus to the airport!
Post Reply