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 Go to previous message](theme/default/images/up.png) |
![](https://www.ultimatepp.org/forums/images/custom_avatars/648.jpg) |
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
|
|
|
Goto Forum:
Current Time: Mon Jun 10 16:23:24 CEST 2024
Total time taken to generate the page: 0.01264 seconds
|