Home » Developing U++ » UppHub » TabBarCtrl and more
TabBarCtrl and more [message #24423] |
Sun, 17 January 2010 12:17  |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
I've added a new tabbed control that mimicks TabCtrl, but using QuickTabs/TabBar widgets for tabbing, which I like for its features.
It's almost a plug-in replacement for TabCtrl, with just one noticeable missing feature, which is the embedding of controls inside tabs (seldom used anyways, I guess).
For most apps should be enough to change dialog type from TabCtrl to TabBarCtrl to use new control.
To allow this, I had to make a couple of modifications of original TabBar code, which BTW don't change the original behaviour if not using the new features.
The changes consist mostly on addition of 2 new callbacks :
WhenCloseSome(Vector<Value> keys)
CancelCloseSome(Vector<Value> keys)
Which get called when closing one OR MORE tabs, with an array parameter containing all closing tabs keys.
The TabBarCtrl has also a couple of callbacks added, in respect to TabCtrl, which allow reacting to close events :
WhenClose(Vector<int> tabs)
CancelClose(Vector<int> tabs)
both are called with an integer array of item indexes.
Beware, as TabBar tabs are draggable/relocatable, TabBarCtrl keeps a map between tabs and items, which is not 1:1 it tabs get dragged. So, closing tab 1 may remove item 5, for example.
When you do Set() and Get(), the reference are always Items, not tabs, so if Item 1 correspond to tab 5, doing a Set(1) wil highlight tab 5.
There's also a small test app, TabBarCtrlTest, in bazaar.
To mrjt : I hope you don't mind for the small mods to your TabBar code, they shouldn't change any behaviour if additional features are not used, anyways.
Ciao
Max
|
|
|
Goto Forum:
Current Time: Wed May 07 22:37:16 CEST 2025
Total time taken to generate the page: 0.00872 seconds
|