How do I convert a 2-panel app into a 3-panel app?
古いコメントを表示
The title kind of says it all.
I have made a 2-panel app with App Developer, but I want a 3rd panel. None of the code controlling the panels is editable (side note: why?), and trying to drag a new panel onto the app just leads to disaster.
How do I do this?
2 件のコメント
Sahithi Kanumarlapudi
2020 年 12 月 16 日
Hi,
You could add the third panel to the app by usual drag and drop of componets to the design view.
Could you provide more information on what you mean by 'code controlling the panels' ?
I might be able to provide more info if you could be more specific on what your two- panel app consisted of.
Gregory Lewin
2021 年 1 月 21 日
回答 (1 件)
jingye wang
2021 年 1 月 19 日
0 投票
3 件のコメント
Gregory Lewin
2021 年 1 月 21 日
jingye wang
2021 年 2 月 3 日
function myUpdateAppLayout(app, event)
currentFigureWidth = app.UIFigure.Position(3);
if(currentFigureWidth <= app.onePanelWidth)
% Change to a 3x1 grid
app.GridLayout.RowHeight = {678, 678, 678};
app.GridLayout.ColumnWidth = {'1x'};
app.CenterPanel.Layout.Row = 1;
app.CenterPanel.Layout.Column = 1;
app.LeftPanel.Layout.Row = 2;
app.LeftPanel.Layout.Column = 1;
app.RightPanel.Layout.Row = 3;
app.RightPanel.Layout.Column = 1;
elseif (currentFigureWidth > app.onePanelWidth && currentFigureWidth <= app.twoPanelWidth)
% Change to a 2x2 grid
app.GridLayout.RowHeight = {678, 678};
app.GridLayout.ColumnWidth = {'1x', '1x'};
app.CenterPanel.Layout.Row = 1;
app.CenterPanel.Layout.Column = [1,2];
app.LeftPanel.Layout.Row = 2;
app.LeftPanel.Layout.Column = 1;
app.RightPanel.Layout.Row = 2;
app.RightPanel.Layout.Column = 2;
else
% Change to a 1x3 grid
app.GridLayout.RowHeight = {'1x'};
app.GridLayout.ColumnWidth = {445, 445, '1x'};
app.LeftPanel.Layout.Row = 1;
app.LeftPanel.Layout.Column = 1;
app.CenterPanel.Layout.Row = 1;
app.CenterPanel.Layout.Column = 2;
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 3;
end
end
Bowen Shi
2021 年 3 月 4 日
Hi,
Have you find a way to convert the app layout from 2 panel to 3 panel? I just build a new 3-Panel App and copy all the component and code into the new app. I don't think this is a proper way though :(
カテゴリ
ヘルプ センター および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!