How do I convert a 2-panel app into a 3-panel app?
Ältere Kommentare anzeigen
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 Kommentare
Sahithi Kanumarlapudi
am 16 Dez. 2020
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
am 21 Jan. 2021
Antworten (1)
jingye wang
am 19 Jan. 2021
0 Stimmen
3 Kommentare
Gregory Lewin
am 21 Jan. 2021
jingye wang
am 3 Feb. 2021
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
am 4 Mär. 2021
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 :(
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!