Bug #4750
openWTabWidget::setTabEnabled behavior changed
0%
Description
In Wt-3.3.5 WTabWidget::setTabEnabled behavior changed
There is an automatic Tab switch, if a Tab is disabled.
Example:
if currentIndex = 2 and then the index 3 is disabled, the currentIndex is changed to 4.
void WTabWidget::setTabEnabled(int index, bool enable)
{
menu_->setItemDisabled(index, !enable);
}
void WMenuItem::setDisabled(bool disabled)
{
WContainerWidget::setDisabled(disabled);
if (disabled)
if (menu_)
menu_onItemHidden(menu_>indexOf(this), true);
}
void WMenu::onItemHidden(int index, bool hidden)
{
if (hidden) {
int nextItem = nextAfterHide(index);
if (nextItem != current_)
select(nextItem);
}
}
Updated by Koen Deforche almost 10 years ago
- Status changed from New to Feedback
Hey, yes this was intentional. A 'disabled' tab cannot be selected, so we shouldn't allow it to be selected?
Updated by Manfred Fuchs almost 10 years ago
No Bug
My function disabeld all tabs, and then enabled one tab. (works with WT 3.3.4)
I changed to "disable all tabs exept the active one".