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 » Community » Newbie corner » TabCtrl: How to add the close button(square) on the tab(s)
TabCtrl: How to add the close button(square) on the tab(s) [message #31783] Sun, 27 March 2011 15:38 Go to next message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
TheIDE apparently did something like that to allow user to close the current tab page. I have been trying to dig into theide source code, but could not find a clue. Hopefully it's that really difficult to achieve that.

Thanks,
Lance
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31827 is a reply to message #31783] Wed, 30 March 2011 10:36 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
look for the TabBar::Crosses() property
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31912 is a reply to message #31827] Wed, 06 April 2011 14:49 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Thank you kohaitoo but could you be more specific?
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31913 is a reply to message #31912] Wed, 06 April 2011 15:05 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
well,
TabBar.h:401 says
	TabBar& Crosses(bool b = true, int side = RIGHT);

so when yoy have a TabBar instance, yoy can say
mytab.Crosses();

and they are there...even when you use a TabBarCtrl instance, since it derives from TabBar.

hope this helps
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31936 is a reply to message #31913] Sat, 09 April 2011 18:25 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Sorry, I use TabCtrl.

Does TabBar do the same job as a TabCtrl or is it contained by TabCtrl?

Thanks,
Lance
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31937 is a reply to message #31936] Sat, 09 April 2011 22:19 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Hi kohait00:

Thanks. I manage to replace TabCtrl with TabBarCtrl and I see what you meant. But unlike TabCtrl, when there is no tab page at all, the TabBarCtrl has a ugly black background. How should I fix it? Always provide a default tab?

Thank you!
Lance
Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31946 is a reply to message #31937] Sun, 10 April 2011 16:03 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
sorry, i somehow didn't realize that TabCtrl was the case and not TabBar and TabBarCtrl respective. but now, that you switched (which is better anyway) i can confirm the blackscreen with no tabs sometimes.

will try to investigate how to fix that one.. for meanwhile fix maybe insert a dummy tab beeing it a StaticRect with a Background color.

Re: TabCtrl: How to add the close button(square) on the tab(s) [message #31990 is a reply to message #31946] Fri, 15 April 2011 06:27 Go to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Thanks for the tip. I am currently working on something else. I will move on to it afterwards.

I switched back to TabCtrl for now. I need to figure out how to add tab page in TabBarCtrl so that I can have multiple instances of same type of slave control (I suppose I need to provide a distinct 'Key' to the AddChild or so method).

Too much to learn Smile
Previous Topic: no build method in new install
Next Topic: Is this really a GUI RAD?
Goto Forum:
  


Current Time: Fri May 03 23:53:27 CEST 2024

Total time taken to generate the page: 0.02401 seconds