[MAXGUI] Table Gadget

BlitzMax Forums/MaxGUI Module/[MAXGUI] Table Gadget

Scaremonger(Posted 2007) [#1]
TTableview v1.0
I cannot believe there is not a Grid control in Maxgui!

Anyway... I've written one (Well started anyways). I will probably keep developing it if anyone is interested; but for now, it does the job I needed it for.



It's pure Max code, and therefore platform independant.

// SNIP - Please refer to update later in document //


tonyg(Posted 2007) [#2]
Have you seen this and this ?


Scaremonger(Posted 2007) [#3]
Yes, but the first one is a property sheet. Useful; but not quite the same.

The second only run in windows.

Mine is cross platform...


tonyg(Posted 2007) [#4]
I didn't mean as competition but as a 'template'. Never mind. I should be clearer.


Brucey(Posted 2007) [#5]
I started one of these using a Canvas too... but would rather it was using native controls.

Shame skid is too busy to sort out the framework for it, then I could implement the GTK version pretty quickly...

Oh well...

Keep up the good work :-)


Grisu(Posted 2007) [#6]
I thought Skid was working on this?

But let's reinvent the wheel over and over until maxgui2 finally sees daylight.


Brucey(Posted 2007) [#7]
But let's reinvent the wheel over and over until maxgui2 finally sees daylight.

Sounds like a good idea.

You go first :-)


Dreamora(Posted 2007) [#8]
Reinvent would assume that:

1. Its worked on that (you know we hope for that since day 1 of MaxGUI)
2. There will be a MaxGUI2


Scaremonger(Posted 2007) [#9]
TTableview v2.0
Just finished working on a second improved version.



The "cells" can now be any TGadget you like, but they default to lables if you put Text into them. Empty ones have no gadget. The scrollbars are automatic.

Rows and columns can be added / removed or resized dynamically as you wish.

The best thing about this is that it is not an add-on; it is a custom TGadget, and is pure Blitzmax code.

(Ignore the sliders outside the table-view, these were for my test code so I could see what happened when the table was resized with data in it).

I just need to tidy up the code, and I'll publish it.. Watch this space.


Scaremonger(Posted 2007) [#10]
Another teaser: A Property box...




degac(Posted 2007) [#11]
These 'improvements' are very interesting...good job


Scaremonger(Posted 2007) [#12]
I've published TTableview version 2.0 on my website...

Let me know if there are any bugs, or additions that you would like to see.


degac(Posted 2007) [#13]
Good.
It should be useful a system to retrieve info about the cell under the mouse (ie:x and y position, the gadget...) or some functions to 'lock/unlock' the cells.

ps: _TTableview_Redraw function will redraw from 0 until X (or Y): it will be more interesting (and useful) to offert to the user the possibility to show cells from a choosen point (like a sort of 'viewport').

pps: you have a problem with the method 'SetColor' in the type TTableView: everytime you call (from a method or a function) SetColor Bmax believe you want YOUR method. Try to change the name in SetCellColor.

Very good.


Scaremonger(Posted 2007) [#14]
Thanks for the feedback.

I think the setcolor problem is related to the one I had in the redraw. It looks like there are some problems in the ProxyGadget implementation. (Using setcolor changes label background; silly things like that).

I'll add the others to my work list. Cheers.


Koriolis(Posted 2007) [#15]
Thanks to share, I'll do good use of this.


DavidDC(Posted 2007) [#16]
The idea is great!

But this is what I get when I run your demos on an intel iMac. Am I missing something?

David






Blueapples(Posted 2007) [#17]
Same here on my Mac. I wish I had some time to debug it, but things are just crazy lately.


CASO(Posted 2007) [#18]
This is awesome!
I wrote a simple excel-like program for keeping track of running times and I can't imagine being able to do it that easily without TTableview 2.0


Scaremonger(Posted 2007) [#19]
Sorry; been on holiday....

Not sure why the MAC would not render the gadgets in the cells. It's pure Blitzmax / Maxgui code.

I'll see if I can get hold of a Mac to do some testing.


Dreamora(Posted 2007) [#20]
Mac + UI is bound to Apple enforced restrictions.
Perhaps you try to create gadgets to small and they just get killed. (its the same like: button size can not be set on apple through the gadget size. if the text is too small it gets resized down again)


DavidDC(Posted 2007) [#21]
I've only just glanced at the code and I confess I'm still not sure how it works.

You're not putting gadgets on top of a canvas are you? Because I know OS X doesn't enjoy that.


Scaremonger(Posted 2007) [#22]
Yeah; the gadgets are on a canvas.

If I force a refresh of all the gadgets when the canvas is redrawn; that might fix it.

I now have a MacOSX test environment. Just got to figure out how to install BM on it... (Never used one before).


CS_TBL(Posted 2007) [#23]
Why not put the gadgets on a panel?


Brucey(Posted 2007) [#24]
Yeah; the gadgets are on a canvas.

Oh dear.... good luck with that :-)


Scaremonger(Posted 2007) [#25]
Currently empty "cells" are drawn as rectangles on the canvas. Changing the Canvas to a Panel would mean I need to create a load of empty Labels in order to show something that is not there.


CS_TBL(Posted 2007) [#26]
hm, still I think there might be a smarter way to solve that, but it might require to trow away some soup.. :P


Scaremonger(Posted 2007) [#27]
Do gadgets on panels work okay on the Mac?


CS_TBL(Posted 2007) [#28]
I don't have a Mac, but afaik panels are here *because* you can place gadgets on 'em, and in case of multiple sets of radiobuttons, you even *have* to use panels.


DavidDC(Posted 2007) [#29]
Yes, gadgets work on panels on the mac. As CS_TBL said...


Scaremonger(Posted 2007) [#30]
TTableview v2.1
New version; but have not got my MacOSX test environment running yet, so please let me know.

Thanks to degac for requesting these:
* Changed SetColor() To SetBGColor()
* You can now obtain the cell under the mouse.
Two New methods rowAtY() And colAtX() allow you To find out where the mouse has been clicked. See the new spreadsheet example for sample code.

Also:
* Changed the Canvas into a Panel To fix problem on the Mac (hopefully).
* Optional borders around table gadget (Default To ON).
When you create the Tableview, the style option defaults to a border which can be removed if required. To do this set the last parameter To zero.

Samples included:
* Table Grid v2.1
* Property box v2.1
* Spreadsheet v2.1 - See below

Some documentation is available on my website .




degac(Posted 2007) [#31]
I will try the new version asap...!


degac(Posted 2007) [#32]
Tested the SpreedSheet example. I found a little bug
1. Click on a cell to 'activate' it
2. Move the sliders (the vertical one or the horizontal is the same) to move the sheet
3. Click again on another cell

You will have 2 (or more) cells 'activated', I suppose this is a bug. And it seems that you lose the alignment mouseXY and cellXY.

In any case a very good improvement for MaxGUI!
Thank you


Scaremonger(Posted 2007) [#33]
Thanks Degac, I've fixed that one.

v2.11 is available for download from the website.


DavidDC(Posted 2007) [#34]
Well this is a lot closer to working (well done!), Intel OS X 10.4.10.

You can't select any items in the combo box though. The dropdown box disappears when you try to move the mouse over a row. It opens so you can see the combo contents; you just can't select.

The other fields seem to be working

-David




Scaremonger(Posted 2007) [#35]
I've run this under Ubuntu, and it's got a whole different set of issues.

From what I can see MaxGUI is far from Cross platform. It needs so many tweaks for each OS that I don't see how I can use it going forward.

However; I am very keen to see what Brucey is producing here


Garfield(Posted 2007) [#36]
project is broken? no link above will work

I´m really interested in gadgets for programming tableviewing.

Why is those stuff not implemented in Bmax yet?

I´ve tried any tricks but no luck, the only way are the listboxes, but every listbox have its own scrollbar if more content inside as the gadget hight is :(

and to work with tabs inside the listbox is not possible, because of missing settabs inside these gadget

an impotant thing is the possibility to select the whole line and only one at the same time, maybe a workaround with textareas, tabs and a code to manage the selection?

this is what I´mlooking for: (Example Mac OS-X Mail Programm )




doswelk(Posted 2007) [#37]
That's why everybody is waiting for this: http://www.blitzbasic.com/Community/posts.php?topic=72179


Scaremonger(Posted 2007) [#38]
I'm not going to develop this further, and will not be using MaxGUI myself going forward.

As doswelk says above; we are all waiting for wxWidgets.