Bug in TabGroup appearance in AppDesigner (R2019b)

4 次查看(过去 30 天)
I experience what I think is a bug of AppDesigner.
Consider a TabGroup_child inside a TabGroup_parent.
If the TabGroup_child is not in the first tab of TabGroup_parent, at startup the default tab of TabGroup_child doesn't appear as selected (highlighted) even if it actually is. A user click on another tab of TabGroup_child will correctly select it, and subsequently a click on the default tab will make it appear as selected.
This issue is not present if TabGroup_child is in the first tab of TabGroup_parent.

回答(7 个)

Vincenzo
Vincenzo 2020-6-12
编辑:Vincenzo 2020-6-12
Thanks for your answer, but I probably didn't well explained the issue.
I have an external TabGroup; inside the first tab there is an internal TabGroup; inside the second tab there is another internal TabGroup.
By default, the first tab of the external TabGroup is selected, along with the first tab of the internal TabGroup of the first tab of the external TabGroup.
If I click on the second tab of the external TabGroup, the default selection of its internal TabGroup is its first tab, but it appears as if no tab is selected at all.
Only if I click on purpose on the first tab it appears as selected.
I can confirm the first tab is selected by default even if it doesn't appear so because what it's shown is the content of the first tab, instead of the content of the second tab. The issue is only graphical.
The issue is reproducible with any internal TabGroup inside a tab of the external TabGroup except for the first one.

Chidvi Modala
Chidvi Modala 2020-7-1
This is a bug. I have brought this issue to the notice of our developers and will try to fix it in future releases.
  1 个评论
Vincenzo
Vincenzo 2020-7-1
Thank you, I'll look forward for it. Perhaps you or someone else can tell if the bug is still present in R2020b?

请先登录,再进行评论。


Philipp Boecker
Philipp Boecker 2020-11-22
push

Chidvi Modala
Chidvi Modala 2020-6-12
This looks like an expected behavior. When you first create TabGroup_parent, the highlighted region will be around the TabGroup_parent by default but not around TabGroup_Child because we selected the TabGroup_parent and the priority will be given to it. You can observe the following
  • When you create a TabGroup_parent, since you are selecting the TabGroup_parent, the highlighted area is not around TabGroup_child but it is around the TabGroup_parent as shown below
  • When you select either Tab1 or Tab 2, the highlighted region will be around the respective tabs as shown below
  • When you again click on TabGroup_parent, the highlighted region will be around the entire Tabgroup.

Vincenzo
Vincenzo 2020-6-23
no one is able to replicate the issue I described? It's only a problem for me?
  1 个评论
Edward Burdak
Edward Burdak 2021-9-30
I too am experiencing the same issue - but I'm a greenhorn to all this APP designer so I may have finger problems
Taking note of Kim's reply below I attempted to shortcut by
app.TabGroup.SelectedTab = app.TabComponetBrowserName
The tab changes as expected in the container and the highlight on the tab switches correctly as expected for all tabs except the first tab in the group. For the fist tab the components are shown correctly but the "highlight" on the tabname is not set.

请先登录,再进行评论。


Kim Sander
Kim Sander 2020-9-9
I am experiencing the exact same issue.
Until the bug is fixed I am using a workaround.
% Creating external tab group
ExternelTabGroup = uitabgroup(app.UIFigure);
ExternelTabGroup.Position = [10, 10, 400, 400];
ExternalTab1 = uitab(ExternelTabGroup);
ExternalTab1.Title = 'Tab1';
ExternalTab2 = uitab(ExternelTabGroup);
ExternalTab2.Title = 'Tab2';
% Creating internal tab group 1
InternalTabGroup1 = uitabgroup(ExternalTab1);
InternalTab1A = uitab(InternalTabGroup1);
InternalTab1A.Title = 'Tab1A';
InternalTab1B = uitab(InternalTabGroup1);
InternalTab1B.Title = 'Tab1B';
InternalTab1C = uitab(InternalTabGroup1);
InternalTab1C.Title = 'Tab1C';
% Select tab 2 before creating its internal tab group
ExternelTabGroup.SelectedTab = ExternalTab2;
drawnow % Sometimes drawnow may be required
% Creating internal tab group 2
InternalTabGroup2 = uitabgroup(ExternalTab2);
InternalTab2A = uitab(InternalTabGroup2);
InternalTab2A.Title = 'Tab2A';
InternalTab2B = uitab(InternalTabGroup2);
InternalTab2B.Title = 'Tab2B';
InternalTab2C = uitab(InternalTabGroup2);
InternalTab2C.Title = 'Tab2C';
% Restore original tab selection
ExternelTabGroup.SelectedTab = ExternalTab1;

Peng Li
Peng Li 2022-11-15
Had the same issue in 2022a. I have worked out a temporal solution. What I did that can show the right selection was that in the StartupFcn of the App, you force the child tab group to select another tab (for example, the second one or the third one or anyone except the first one). And then, in the parent tab selection change callback, when you select the tab that contains the child tabgroup, you switch the selection of the child tabgroup to the first one that you mean to.

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by