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 » U++ Library support » TabCtrl » How to highlight particular tab when corresponding button is clicked
How to highlight particular tab when corresponding button is clicked [message #33080] Wed, 06 July 2011 07:53 Go to next message
Monty.mvh is currently offline  Monty.mvh
Messages: 31
Registered: July 2011
Location: Bangalore
Member
Hi friends,
I have 5 tabs and each tab has its own button..
When a particular button is clicked ,corresponding tab has to get opened and set..But problem is am able to open the tab by clicking the button but only tab 1 is getting highlighted while other tabs after opening thru respective buttons remain in the background...

What is the function i need to call to set particular tab when corresponding button is clicked...
Re: How to highlight particular tab when corresponding button is clicked [message #33135 is a reply to message #33080] Sun, 10 July 2011 13:10 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Monty!

I'm not sure if I understand correctly... Do you mean something like this?
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

class App:public TopWindow {
	typedef App CLASSNAME;
	TabCtrl tabs;
	Button b1,b2,b3;
	Label c1,c2,c3;
public:
	App(){
		c1.SetLabel("Content of tab 1 ...");
		c2.SetLabel("Content of tab 2 ...");
		c3.SetLabel("Content of tab 3 ...");
		
		Add(tabs.VSizePos(30).HSizePos());
		tabs.Add(c1.SizePos(),"Tab 1");
		tabs.Add(c2.SizePos(),"Tab 2");
		tabs.Add(c3.SizePos(),"Tab 3");

		Add(b1.TopPos(5,20).LeftPos(  5,50));
		Add(b2.TopPos(5,20).LeftPos( 60,50));
		Add(b3.TopPos(5,20).LeftPos(115,50));
		b1.SetLabel("Set 1");
		b2.SetLabel("Set 2");
		b3.SetLabel("Set 3");
		
		b1<<=THISBACK1(SetTab,0);
		b2<<=THISBACK1(SetTab,1);
		b3<<=THISBACK1(SetTab,2);
	}
	void SetTab(int n){
		tabs.Set(n);
	}
};

GUI_APP_MAIN{
	App().Sizeable().Run();
}


If I didn't get it right, please try to explain you problem once more...

Best regards,
Honza

[Updated on: Sun, 10 July 2011 13:41]

Report message to a moderator

Re: How to highlight particular tab when corresponding button is clicked [message #33156 is a reply to message #33135] Tue, 12 July 2011 06:27 Go to previous message
Monty.mvh is currently offline  Monty.mvh
Messages: 31
Registered: July 2011
Location: Bangalore
Member
Hi Honza,
Your code perfectly matched the need of mine..Thank you very much..Very helpful one..
Previous Topic: TabBar crash fix (very crude one, needs author to rewrite it)
Next Topic: How to define classes for tabs with in the tabs..
Goto Forum:
  


Current Time: Tue Apr 23 20:11:24 CEST 2024

Total time taken to generate the page: 0.01858 seconds