Side on tab view

BlitzMax Forums/MaxGUI Module/Side on tab view

matibee(Posted 2012) [#1]
I need a tall narrow tab view and I don't like the way multiple tabs bunch up and scroll on the standard tab view. So, inspired by this, I've had a go at making my own side tabber..



Source here (it's a first draft so don't expect too much).

I'm here to ask for your help in making it window re-size friendly.

It's just a collection of panels and I don't seem to be able to use SetGadgetLayout to correctly control the width and height after a re-size.

I'm not planning on adding the ability to scroll through the tabs when the window is too small in height, instead I might stick it in a scroll panel for when it reaches a set minimum size.

I'm prepared to recalculate all the panel positions if that's what it takes, but this also has the drawback that if it's done on a WINDOW_SIZE message, it will be distorted while the window is being re-sized.

Any help greatly appreciated, and the final version will go into the code archives.

Cheers
Matt


matibee(Posted 2012) [#2]
Quick update.

Looking more into JoshK's source, I've added an event hook and adjusting the position of the panels on the fly. It's not finished, but so far so good :)


jsp(Posted 2012) [#3]
For the layout, copy the stuff over I added:




matibee(Posted 2012) [#4]
Perfect!

And you did it all with SetGadgetLayout? I was convinced that wasn't even possible.

Great job, thanks.


jsp(Posted 2012) [#5]
Biggest problem was to figure out which panel was meant, thus some SetGadgetColor inside the code to identify them :)


matibee(Posted 2012) [#6]
Agreed, the code's a bit of a mess, but it was really a proof of concept at that stage.

Thanks to you, I'm now making it safe for human consumption ;)


matibee(Posted 2012) [#7]
Okay, everything updated for a final check over before I drop it in the code archives.

It now has its own event handler, and managed panels so it acts kind of autonomously (no more Poll() or switching views required).

Original image and download overwritten.

Thanks again jsp. I really hope this community stays around for a while yet. BMax is a great language but the lack of activity here does worry me.

If anyone wants to test on other OS's and post a screen shot I'd be really grateful (the above pic from WinXP).

Cheers
Matt

Last edited 2012


jsp(Posted 2012) [#8]
Works fine here and looks quite cool!
Well done.


matibee(Posted 2012) [#9]
Thanks again jsp. A code archive entry submitted, and the download zip now contains the photoshop doc I made and took the sample images from.

Looking at your additions I've realised why I was having no luck with setgadgetlayout :/ My experience of setgadgetlayout was limited to using EDGE_ALIGNED on all four sides and I always assumed the arguments were left,top,right,bottom (as in x,y,w,h). Doh!


AdamRedwoods(Posted 2012) [#10]
Very nice!

does this also support other orientations (ie horizontal alignment) in a top and bottom arrangement?


matibee(Posted 2012) [#11]
Other orientations?? :) No, I'm afraid not. I simply needed this orientation for my app and wasn't really planning on taking it any further.

A mirrored version should be easy enough (ie tabs on the right), but top and bottom tabs would require a bit of work. My biggest fear is that its limitations will quickly become a major PITA if it's taken out of its comfort zone.


matibee(Posted 2012) [#12]
Well... I've just tried this on my fresh Ubuntu install :/

It looks like FLTK requires gadgets to start and end on certain pixel boundaries (say 8x8) or power of 2, so it's stretching all the panels. Does anyone know if that's usual? Going back to windows now with the fltk drivers to see what happens.