Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » TabBar Major Revision
TabBar Major Revision [message #21759] Thu, 04 June 2009 13:28 Go to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I've just completed a revision of the TabBar package to both incorporate new features and improve the implementation of old ones. The changes are numerous, but the main ones:

- Upp style key/value support
- FileTabs class added to TabBar package. This is a TabBar derived class specialised for file-control (like TheIde tabs). Almost all uses of the TabBar are probably going to want something close to this.
- FileTabsExample added to Bazaar
- Tabs can now have icons attached, reducing the need for custom paint routines
- Sorting by group added
- Visual group separators added
- Scrolling behaviour fixed
- No cursor support added
- Gate callbacks added to allow owning application to cancel tab closing operations
- Tab stacking improved:
Custom stacking criteria can be specified by overloading GetStackId
Custom sorting inside stacks can be specified by overloading GetStackSortOrder
Tabs can now be iterated over as normal, but are sorted into their stacks (so don't depend on the tab order staying constant)
A stacked tab can be selected directly with the mouse
Display stacked tabs by icon or a much-simplified custom paint routine
Revision 1271.

There are probably still a few bugs and a couple of minor things to do but the major work is completed and the interface is final.

The Docking package is dependent on this and has not bee updated yet.

Documentation pending Smile

Screenshot of the FileTabsExample package:index.php?t=getfile&id=1766&private=0
(Docking.upp is being highlighted by the mouse pointer)
Re: TabBar Major Revision [message #21766 is a reply to message #21759] Thu, 04 June 2009 15:47 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Thank you!

Best regards
Iñaki
Re: TabBar Major Revision [message #21769 is a reply to message #21766] Thu, 04 June 2009 17:15 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I've just committed a version with 2 changes:
WhenClose and CancelClose callbacks weren't being called on MiddleDown
Separators now drawn using Image
Re: TabBar Major Revision [message #21770 is a reply to message #21769] Thu, 04 June 2009 17:24 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Is there a chance to include these stacking file tabs into next SVN version of TheIDE?
Re: TabBar Major Revision [message #21777 is a reply to message #21770] Thu, 04 June 2009 21:16 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Mindtraveller wrote on Thu, 04 June 2009 11:24

Is there a chance to include these stacking file tabs into next SVN version of TheIDE?

They will be there for sure Smile
Re: TabBar Major Revision [message #21783 is a reply to message #21777] Thu, 04 June 2009 23:26 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello mrjt

I have seen that in TabBar.upp are included references to files FileTabs.cpp and FileTabs.h., but they are not in TabBar folder.

Also in TabBar.h there is a #include "FileTabs.h"

Other thing to update or delete is TabBarTest, as function .Add() seems to be changed.

Best regards
Koldo


Best regards
Iñaki

[Updated on: Fri, 05 June 2009 08:38]

Report message to a moderator

Re: TabBar Major Revision [message #21797 is a reply to message #21783] Fri, 05 June 2009 11:11 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
koldo wrote on Thu, 04 June 2009 22:26

Hello mrjt

I have seen that in TabBar.upp are included references to files FileTabs.cpp and FileTabs.h., but they are not in TabBar folder.

Also in TabBar.h there is a #include "FileTabs.h"

Other thing to update or delete is TabBarTest, as function .Add() seems to be changed.

Best regards
Koldo

Sorry about that. Bit of a cock-up, I forgot to add the files.

This is fixed in revision 1280.
Re: TabBar Major Revision [message #21798 is a reply to message #21770] Fri, 05 June 2009 11:19 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Mindtraveller

Is there a chance to include these stacking file tabs into next SVN version of TheIDE?

If you want to try it out now, I've just added a QuickTabs wrapper package to the bazaar. It's very easy to add:

1- Get latest SVN (1280+ is needed)
2- Replace uppsrc/ide/QuickTabs with bazaar/QuickTabs (copying over it is ok)
3- Before compiling TheIde add the bazaar assembly to the uppsrc assembly (right click uppsrc->Edit assembly, add path to bazaar in top edit box)
4- Compile TheIde

There is an addition Settings menu added to the QuickTabs context menu for changing a few things.

It would be helpful to try it, the more it's tested the sooner it can go into the default version.

Plus I really like it, I've switched to using it myself now Smile
Re: TabBar Major Revision [message #21807 is a reply to message #21798] Fri, 05 June 2009 22:08 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mrjt wrote on Fri, 05 June 2009 13:19

If you want to try it out now, I've just added a QuickTabs wrapper package to the bazaar.
Thank you very much, I`ll try and test it.
Re: TabBar Major Revision [message #21809 is a reply to message #21807] Fri, 05 June 2009 22:34 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello mrjt

I have adapted my tabs application to the new version. It has been easy.

As I open files I have used new FileTabs class. Method GetKey(i) returns the file name with full path, but GetValue(i) returns just the file name.

Instead of Add() now it is used AddFile(file, make_active) where file is the full path. Only the file name is seen in the tab.

Just what I wanted. Thank you very much. I have seen Monaco F1 inspired you Smile

Best regards
Koldo


Best regards
Iñaki
Re: TabBar Major Revision [message #21810 is a reply to message #21798] Sat, 06 June 2009 00:19 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mrjt wrote on Fri, 05 June 2009 13:19


2- Replace uppsrc/ide/QuickTabs with bazaar/QuickTabs (copying over it is ok)
3- Before compiling TheIde add the bazaar assembly to the uppsrc assembly (right click uppsrc->Edit assembly, add path to bazaar in top edit box)
4- Compile TheIde
gives me errors:
----- ide\QuickTabs ( GUI MT MSC9 WIN32 MSC ) (8 / 36)
QuickTabs.cpp
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(10) : error C3767: '<<=': candidate function(s) not accessible
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(10) : error C2676: binary '<<=' : 'Upp::Callback' does not define this operator or a conversion to a type accept
	able to the predefined operator
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(15) : error C2039: 'OnSettingsMenu' : is not a member of 'QuickTabs'
        c:\upp\uppsrc\ide\quicktabs\QuickTabs.h(7) : see declaration of 'QuickTabs'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(15) : error C2065: 'OnSettingsMenu' : undeclared identifier
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(21) : warning C4003: not enough actual parameters for macro 'THISBACK1'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(21) : error C2059: syntax error : ')'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(22) : warning C4003: not enough actual parameters for macro 'THISBACK1'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(22) : error C2059: syntax error : ')'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(23) : warning C4003: not enough actual parameters for macro 'THISBACK1'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(23) : error C2059: syntax error : ')'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(24) : error C3867: 'TabBar::IsShowInactive': function call missing argument list; use '&TabBar::IsShowInactive' 
	to create a pointer to member
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(24) : warning C4003: not enough actual parameters for macro 'THISBACK1'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(24) : error C2059: syntax error : ')'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(35) : error C2143: syntax error : missing ';' before 'if'
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(43) : error C2065: 'tn' : undeclared identifier
C:\upp\uppsrc\ide\QuickTabs\QuickTabs.cpp(43) : error C2228: left of '.ToWString' must have class/struct/union
        type is ''unknown-type''

Re: TabBar Major Revision [message #21845 is a reply to message #21810] Mon, 08 June 2009 11:03 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Update: the same error with latest release 1289.
Am I doing something wrong?
Re: TabBar Major Revision [message #22009 is a reply to message #21798] Sun, 14 June 2009 20:15 Go to previous messageGo to next message
piotr5 is currently offline  piotr5
Messages: 107
Registered: November 2005
Experienced Member
mrjt wrote on Fri, 05 June 2009 11:19

Mindtraveller

Is there a chance to include these stacking file tabs into next SVN version of TheIDE?

If you want to try it out now, I've just added a QuickTabs wrapper package to the bazaar. It's very easy to add:

1- Get latest SVN (1280+ is needed)
2- Replace uppsrc/ide/QuickTabs with bazaar/QuickTabs (copying over it is ok)
3- Before compiling TheIde add the bazaar assembly to the uppsrc assembly (right click uppsrc->Edit assembly, add path to bazaar in top edit box)
4- Compile TheIde




I tried it now, and after some fiddling it compiled. the major difficulty was to realize that I need to change in ide.h the include-statement for QuickTabs: instead of ide/QuickTabs/QuickTabs.h, it should be without the ide/ -- QuickTabs/QuickTabs.h alone.

for completeness: the error with missing "<<=" I fixed by removing the "=", i.e. I used the "<<" operator. "OnSettingsMenu" I replaced with "SettingsMenu" and "THISBACK1" in the error-yielding lines I replaced with "THISBACK" and the erronous "tn" I changed to "fn". I also remember that I had to remove some "&" from the parameters of a function-declaration taking wstrings as argument because wstring is pickable and somewhere the function was fed with temporatry wstrings (but I suspect that a constant wstring& would have solved the problem too). ".ToWString" I have not seen among the errors. my google-svn version is 1303. there's also an error in the ide itself: SerializeTabs is undefined. I'm not sure what to do with it. for now I commented out these commands and reduced the serialization-version to 8. I hope someone will port the Tab-Serialization to TabBars (as opposed to FileTabs or QuickTabs)...
Re: TabBar Major Revision [message #22062 is a reply to message #22009] Tue, 16 June 2009 10:57 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
piotr5 wrote on Sun, 14 June 2009 19:15

mrjt wrote on Fri, 05 June 2009 11:19

Mindtraveller

Is there a chance to include these stacking file tabs into next SVN version of TheIDE?

If you want to try it out now, I've just added a QuickTabs wrapper package to the bazaar. It's very easy to add:

1- Get latest SVN (1280+ is needed)
2- Replace uppsrc/ide/QuickTabs with bazaar/QuickTabs (copying over it is ok)
3- Before compiling TheIde add the bazaar assembly to the uppsrc assembly (right click uppsrc->Edit assembly, add path to bazaar in top edit box)
4- Compile TheIde




I tried it now, and after some fiddling it compiled. the major difficulty was to realize that I need to change in ide.h the include-statement for QuickTabs: instead of ide/QuickTabs/QuickTabs.h, it should be without the ide/ -- QuickTabs/QuickTabs.h alone.

for completeness: the error with missing "<<=" I fixed by removing the "=", i.e. I used the "<<" operator. "OnSettingsMenu" I replaced with "SettingsMenu" and "THISBACK1" in the error-yielding lines I replaced with "THISBACK" and the erronous "tn" I changed to "fn". I also remember that I had to remove some "&" from the parameters of a function-declaration taking wstrings as argument because wstring is pickable and somewhere the function was fed with temporatry wstrings (but I suspect that a constant wstring& would have solved the problem too). ".ToWString" I have not seen among the errors. my google-svn version is 1303. there's also an error in the ide itself: SerializeTabs is undefined. I'm not sure what to do with it. for now I commented out these commands and reduced the serialization-version to 8. I hope someone will port the Tab-Serialization to TabBars (as opposed to FileTabs or QuickTabs)...

Oops, I forgot to mention changing the package path. Sorry.

The errors were because I was of course testing the version in the ide directory and forgot to copy the changes back before committing. I've now rectified this.

Still, glad you got it working.

The problem with TabBar serialization is that now Tabs have a separate Image/icon property and there is now way to recreate this with generic serialization alone. It's not difficult to add serialization that ignores this property, but I wanted to the think about it first so I didn't include it with this release.

[Updated on: Tue, 16 June 2009 11:03]

Report message to a moderator

Re: TabBar Major Revision [message #22098 is a reply to message #22062] Wed, 17 June 2009 16:33 Go to previous messageGo to next message
piotr5 is currently offline  piotr5
Messages: 107
Registered: November 2005
Experienced Member
mrjt wrote on Tue, 16 June 2009 10:57


The problem with TabBar serialization is that now Tabs have a separate Image/icon property and there is now way to recreate this with generic serialization alone. It's not difficult to add serialization that ignores this property, but I wanted to the think about it first so I didn't include it with this release.



one little suggestion: a TabBar doesn't really need an icon-serialization in the strict sense. I think instead we need a special icon-serialization and therefore a special icon-class. as far as I understood TabBar::Tab::img is the member storing the icon. it's of type Image. what I am thinking of is to use a class specialized on icons only. this class needs only one member in addition to the actual image: "icontag". the type of this member can be filename or a special value from an enum-list of icons. and this value then needs to be stored during serialization of the icon (and thereby during serialization of TabBar and derivatives). or better yet, don't put the actual image into the icon-class, and provide a method for translating the icontag to the image-data sored elsewhere (for example with a static look-up table containing all internal icons and already loaded files). and maybe it should be 2 icon-classes (one for enum-ed icontags and one for filenames) plus another one serving as an interface to both. on windows this file-name-icon class can be extended with exact location-infor for each icon (in windows there can be multiple icons per file, even different icon-sizes). is that what you did think of? I have not enough knowledge of upp, but I guess there is a lot of code-reuse in that idea...
Re: TabBar Major Revision [message #22100 is a reply to message #22098] Wed, 17 June 2009 17:02 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
To be honest I was just going to write a table of Images into the serialization in .iml format, maybe with a compile option to disable it and an overloadable SerializeIcon method. Each image would only be written once and they are small so this should be okay.
Re: TabBar Major Revision [message #22103 is a reply to message #22100] Wed, 17 June 2009 18:31 Go to previous messageGo to next message
piotr5 is currently offline  piotr5
Messages: 107
Registered: November 2005
Experienced Member
yes, at first I did think of that too. but it's only fitting for image-serialization, but usually users are not expected to draw any lines and dots right into an image located at a file-tab or something. the images must originate from somewhere: either hard-coded or dynamically loaded. I think I remember windows has serialied its icons at shut-down. the funny thing is that a long time after erasing the icons from the file-system, they still did decorate the desk-top. sounds more like data-junk than real serialization. for example if you decorate the tabs with a symbol for the file-type in theide, and then some new graphics-designer would contribute great icons for upp's file-types, then all users would need to close all tabs and re-open them in order to enjoy the new design...
Smile

well, that was my traits of thought. judging by your usual enthusiasm to implement something new, I would guess your hesitation in this case is a result of having similar thoughts. even the self-justification "they are small" does sound as if such a solution wouldn't be what you want. maybe you did "forget" thinking of animated gifs when writing that?
Re: TabBar Major Revision [message #22104 is a reply to message #22103] Wed, 17 June 2009 19:58 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Excuse for possibly bad thought, but why don`t you use file extension instead of tab icon? I.e. you may write it inside rounded rectangle with remarkable color, then goes filename w/o extension. And that`s all. No possible extensions after filename. Possible extensions could be shown with tooltip of tab caption.

[Updated on: Wed, 17 June 2009 20:00]

Report message to a moderator

Re: TabBar Major Revision [message #22112 is a reply to message #22103] Thu, 18 June 2009 10:57 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
piotr5 wrote on Wed, 17 June 2009 17:31

well, that was my traits of thought. judging by your usual enthusiasm to implement something new, I would guess your hesitation in this case is a result of having similar thoughts.
even the self-justification "they are small" does sound as if such a solution wouldn't be what you want. maybe you did "forget" thinking of animated gifs when writing that?

You summed up my thoughts very well Smile Basically I'm just not sure there is a 'best' solution for this. The method I outline above is the most general one I can think of, but as you point out it has potential problems.

In the case of TheIde tabs (and possibly FileTabs if I removed the custom icon ability) I would not save the Images but just get them from the filesystem at load time.

Excuse for possibly bad thought, but why don`t you use file extension instead of tab icon? 
I.e. you may write it inside rounded rectangle with remarkable color, then goes filename w/o extension. 
And that`s all. No possible extensions after filename. Possible extensions could be shown with tooltip of tab caption.

I don't like the idea of hiding the stacked tab information behind a tooltip, it would just make it hard to use IMO. Making something like this is easy though (simply overloading 2 functions does it):
index.php?t=getfile&id=1804&private=0
But I don't like it very much. I think icons are more difficult to read, even if not disabled/greyed out as in this shot.
  • Attachment: TabBar.png
    (Size: 8.79KB, Downloaded 757 times)

[Updated on: Thu, 18 June 2009 11:01]

Report message to a moderator

Re: TabBar Major Revision [message #24087 is a reply to message #21759] Sat, 26 December 2009 10:11 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I propose making group divider a simple space instead of divider. IMO it looks much better:
index.php?t=getfile&id=2069&private=0
  • Attachment: tabbar.png
    (Size: 6.10KB, Downloaded 1048 times)
Previous Topic: Docking package (plus examples)
Next Topic: Splash Screen for Your applications!
Goto Forum:
  


Current Time: Thu Mar 28 13:40:36 CET 2024

Total time taken to generate the page: 0.01524 seconds