|
|
Home » Developing U++ » UppHub » TabBar: ordering of tabs by their Value (title)
|
Re: TabBar: ordering of tabs by their Value (title) [message #27088 is a reply to message #27040] |
Fri, 25 June 2010 11:50 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I have incorporated you changes, though I have changed the implementation and interface. that's partly because I'd implemented the sorting so badly to begin with I thought a rewrite was needed.
These functions are now available:
TabBar& SortTabs(bool b = true);
TabBar& SortTabsOnce();
TabBar& SortTabsOnce(TabSort &sort);
TabBar& SortTabs(TabSort &sort);
TabBar& SortTabValues(ValueOrder &sort);
TabBar& SortTabValuesOnce(ValueOrder &sort);
TabBar& SortTabKeys(ValueOrder &sort);
TabBar& SortTabKeysOnce(ValueOrder &sort);
TabBar& SortGroups(bool b = true);
TabBar& SortGroups(TabSort &sort);
TabBar& SortStacks(bool b = true);
TabBar& SortStacks(TabSort &sort);
TabBar& SortStacks(ValueOrder &sort);
bool IsValueSort() const { return tabsort; }
bool IsGroupSort() const { return groupsort; }
bool IsStackSort() const { return stacksort; }
I also finally got around to adding the ability to change the goup separators, so this function is now added:
TabBar &SetGroupSeparators(Value horz, Value vert); (the Values can be anything you would pass to ChPaint)
I have also removed TabBarCtrl (I assume it was you that committed it?). I'm open to adding something like it to the package but that version lacked polish and did not match the coding style (it used camelCase among other things).
Thanks for your additions, I'll look at the Docking submission when I get time.
[Updated on: Fri, 25 June 2010 11:51] Report message to a moderator
|
|
|
|
|
Re: TabBar: ordering of tabs by their Value (title) [message #27096 is a reply to message #27095] |
Fri, 25 June 2010 12:54 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
There is nothing to stop you using it in your own app or even adding it as a seperate package to the bazaar, it's doesn't need to be included in the TabBar package.
Part of the problem is that the TabBar isn't well suited to encapsulation like that. To make a general purpose ctrl (as it would have to be to be added to the package) you have to either duplicate a lot of the interface or expose the TabBar object, which also exposes the Callbacks that the host ctrl needs to use to function.
It's something that's very easy to do for a single solution for your own app, but difficult to create a 'proper' general purpose ctrl with correct encapsulation.
I'll think about it though, maybe some small changes to TabBar could make it work better.
[Updated on: Fri, 25 June 2010 12:55] Report message to a moderator
|
|
|
|
|
|
|
Re: TabBar: ordering of tabs by their Value (title) [message #27110 is a reply to message #27107] |
Fri, 25 June 2010 17:57 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Right.
I've modified TabBar so that it can now be used like a Ctrl (outside of a frame) and restricts it's drawing to the correct size. Suprisingly few changes were necessary and a nice side effect has been a slight rendering improvement when the scrollbar is hidden
This means that you can now inherit from it directly to make a TabBarCtrl without the use of any Callbacks and the whole interface exposed.
I have attached a package that contains my implementation of TabBarCtrl a much more comprehensive TabCtrlBarTest. I'm not going to commit it just yet as it needs more testing and I haven't tried it with Docking.
EDIT: See further down-thread for latest version
[Updated on: Mon, 28 June 2010 16:49] Report message to a moderator
|
|
|
|
|
|
|
Re: TabBar: ordering of tabs by their Value (title) [message #27148 is a reply to message #27142] |
Mon, 28 June 2010 16:49 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Well, it was a little more complex than that but I've made the changes.
Fucntion is:
TabBar::SetScrollThickness()
which sets the thickness of the blue bar in the scrollbar (the total thickness includes an extra 1 pixel on either side). The default value is 2.
I've also fixed a couple of ScrollBar related bugs in TabBarCtrl and updated TabBarCtrlTest to include option for changing thickness (under tab 3: "Layout3").
[Updated on: Mon, 28 June 2010 16:50] Report message to a moderator
|
|
|
|
|
Re: TabBar: ordering of tabs by their Value (title) [message #27174 is a reply to message #27149] |
Tue, 29 June 2010 17:53 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
Hi Mirek
i have spent some time using / adapting your new design, the TabBarCtrl : public TabBar is a good thing
i have modified / extended some things slightly, and tried to adopt / extend the TabBarCtrlTest and the FileTabsExample.
the svn stuff is there, but basicly the current state (since your rar archive was not up in svn so diff shows all your changes as well. but you will spot the stuff i did easily.
bugfix in TabBar.cpp
TabBar& TabBar::SortStacks(bool b)
{
stacksort = b; << was staticly true
added (to my best knowledge)
TabBar& TabBar::SortGroupsOnce()
TabBar& TabBar::SortGroupsOnce(TabSort &sort)
TabBar& TabBar::SortStacksOnce()
TabBar& TabBar::SortStacksOnce(TabSort &sort)
this one was not implemented
TabBar& TabBar::SortStacks(ValueOrder &sort)
this one needs to go public, since its API functions are public as well
and thus this one has to be public as well.
struct Tab : Moveable<Tab> {
Docking:
made available the sorting functions from outside.
and some static function stuff, Value converts need not be dependant to intance, if they dont use anything from it...
why not having DockableCtrl::GetContainer() public?
there are 2 changes (first 2) in DockCont.spp from me, which i dont think are usable, so spare them out, they have to do with handling..
i hope this feedback helps
-
Attachment: bazaar.rar
(Size: 243.72KB, Downloaded 278 times)
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 07:12:18 CEST 2024
Total time taken to generate the page: 0.04155 seconds
|
|
|