What's the best way to handle tabbed images?

BlitzMax Forums/MaxGUI Module/What's the best way to handle tabbed images?

sswift(Posted 2009) [#1]
I'm porting my trexture generator to BlitzMax, and I stuck trying to decide how to best proceed with my tabbed interface.

I have a bunch of tabs. Each tab needs to display a different image. If the image is larger than will fit in the tabber, then it will have scrollbars. Some tabs will have their scrollbars linked so when you scroll one, the other scrolls as well. And one tab will need to display 3D objects, and so will need to have a canvas.

What I'm wondering is what's the best way to set up these tabs. Should I have a canvas for each one? Should I have a single canvas and just switch the image? Should I have multiple panels? Is it possible to simply set the background image for a panel and would that be better for scrolling images with the scrollbars?

There's just so many options I'm not sure which direction to go in. I'm afraid if I have multiple canvasses that BlitzMax isn't gonna like that. I'm not even sure if I can even do that actually. And I'm wondering if I'm gonna have problems with really high res images if I try to display them on a 3D canvas instead of doing some kinda 2D windows thing displaying the image on a panel. I mean the textures can be like 4096x4096. And who knows if all my users will have 3D cards that can display images of that res.

Anyway, if anyone's got any insight on how I should best move forward with this it would be helpful. I'd hate to go to all the trouble to code up a multi-canvas setup only to find out BlitzMax can't handle it, or the scrolling would be a lot smoother with panel graphics.

Oh, and I forgot to mention, I'll need to be able to scale the images as well. So maybe for speed's sake canvases are gonna be neccessary no matter what since scaling huge images probably won't be fast enough for my tastes.


slenkar(Posted 2009) [#2]
try the single canvas approach


degac(Posted 2009) [#3]
I agree, try the single canvas approch, it's simpler and more efficient.


SebHoll(Posted 2009) [#4]
Is it possible to simply set the background image for a panel and would that be better for scrolling images with the scrollbars?

Yep - you could use the new ScrollPanel proxy-gadget and set the client area to the dimensions of the image. You can then call SetPanelPixmap() on the client panel, to display the picture, and the gadget will look after all the scrolling for you.


jsp(Posted 2009) [#5]

Each tab needs to display a different image


Try to use a panel as often as possible, it will be handled by the OS once you set it and you don't have to take care yourself. You can set even different properties.



Should I have a canvas for each one


Use multiple canvasses only if they are visible at the same time, otherwise I would stick with one.
DX has no special problems with it AFAIK and for OGL use the GLShareContext() command.



I'm afraid if I have multiple canvasses that BlitzMax isn't gonna like that.


Just init the canvas you are drawing to just before you do so, that's it.


And who knows if all my users will have 3D cards that can display images of that res


Probably not. You could tile your image in 64x64 blocks and display only what's visible.



Anyway, if anyone's got any insight on how I should best move forward with this it would be helpful.


I think you should really start with Seb's ScrollPanel and see how it goes. It looks like it would quite good fit your needs.


skidracer(Posted 2009) [#6]
I'd stay away from tabs and go for something a little more modern like this use of thumbnails which could represent layers for multiple selection or some such: