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 » trouble with tabs ((identifying selected tab))
Re: trouble with tabs [message #52483 is a reply to message #52480] Mon, 07 October 2019 08:31 Go to previous message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
Hello Roboloki

Yes, I would do it your way.
In addition, it is possible to join the menu functions in one. For example:

	tab.WhenSet = [&] {
		PromptOK("Selected tab " + FormatInt(tab.Get()));

		if (tab.IsAt(a1)) {
			PromptOK("At a1");
			menu.Set(THISBACK1(MainMenu, 1));
		} else if (tab.IsAt(a2)) {
			PromptOK("At a2");
			menu.Set(THISBACK1(MainMenu, 2));
		}
	};

...		

void Blam::MainMenu(Bar& bar, int num) {
	bar.Sub(Format(t_("Cookie %d"), num), [=](Bar & bar, int num) {
		bar.Add(Format(t_("Eat cookie %d"), num), THISBACK1(func, num));
	});
}


Best regards
IƱaki

[Updated on: Mon, 07 October 2019 08:31]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Background color of layout
Next Topic: How do I change TabCtrl tab size
Goto Forum:
  


Current Time: Mon Jun 10 16:23:24 CEST 2024

Total time taken to generate the page: 0.01264 seconds