App Designer Capabilities - it is nerve-wrecking!

16 次查看(过去 30 天)
Hi!
I am exploring the app-designer instead of GUI. I want to use the app-designer just because it looks nicer, but I am having difficulty figuring out its capacilities. It is getting really nerve-wrecking actually b/c it is hard to find examples on app designer, even something little takes long time to figure out. I have quick questions I will list below. In an app that is compiled as a standalone:
  1. Can I add "print" to the menubar, the generic "print" we have on a typical guide?
  2. Can I add, save, saveas,... to menubar, in this save it d save whatever is seen on the app's current screen including all components?
  3. Can I manipuate a table to have move-up and move-down buttons?
  4. Can I have pan, rotate, etc. for a figure?
I think all of those are doable using "Guide", I wonder if they are doable in the app-designer? I appreciate if you guys could answer those questions!

采纳的回答

Adam Danz
Adam Danz 2019-8-1
编辑:Adam Danz 2019-8-2
1) "Can I add print to the menubar?
You can add anything you want to the menubar. From the AppDesigner interface, drag and drop the Menu Bar from the Figure Tool section to your GUI. Add a new menu item and rename the new "Menu" to "Print". Then in the MenuSelectionFcn() callback function, you can assign any subroutine you'd like. However, print() is not supported for UIFigures (bummer) so I'm not sure what you intend to print. You can always use a 3rd party screen shot program.
2) "Can I add, save, saveas...."
Similar to my comment above, save(), saveas() and savefig() are not supported for UIFigure (double bummer).
[UPDATE]
If you're working with GUIDE or a GUI developed from uicontrol(), you can add a button, name it "save", and in its callback function, you can save an image of the GUI like this.
saveas(handles.MyGUI, 'MyGUIsnapshot', 'png')
% * 'MyGui' is the handle to your GUI figure.
% * I don't recommend saving it as 'fig' since you'll end up with
% multiple GUIs instead of an image of your GUI.
3) "Can I manipuate a table to have move-up and move-down buttons? "
The tables in appdesigner already have those features.
4) "Can I have pan, rotate, etc. for a figure?"
Yes! For UI axes, both rotate3d() and pan() only support the on and off arguments.
pan(app.UIAxes, 'on')
rotate3d(app.UIAxes, 'on')
  11 个评论
Adam Danz
Adam Danz 2019-8-4
"Do you know if there is a way to use the latex format within a table cell or editable text field in app-designer?"
I'd have to do some googling. Maybe this?
" is there a way to make table values to be centered in app-designer?"
Check out the rabbitt hole (the 2 links in Walter's answer below).
While we're at it, here's a list of all properties you can change in a UItable
Baha411
Baha411 2019-8-5
Thanks for your reply! I was using those tricks in guide for centered text and the code was getting really messy when I created delete-row, add-row, up-row, down-row buttons and when there is categorical column etc for multiple tables in multiple tabs. I was hoping if it was a direct option in the app-designer, but looks not.

请先登录,再进行评论。

更多回答(1 个)

Paul Dirac
Paul Dirac 2020-3-3
It is absolutely incredible that Mathworks, after all these years, still hasn't found a decent way to create advanced GUIs.
Now, they are forcing everyone to migrate from GUIDE to App Designer, which sucks even more and imposes even more limitations. The App Designer developers seem to do everything to make GUI development with Matlab an even bigger pain in the bottom than it was with GUIDE.
  7 个评论
Ted H
Ted H 2022-12-28
编辑:Ted H 2022-12-28
@Image Analyst I might ditch app designer. My goal was to set up a simple swarm plot (similar to box and whiskers). My table has about 80 variables of measurements and categories. A user would print a swarm graph of a voltage measurement chosen from a drop down in categories across the x axis chosen by another drop down. An example might be choosing Va from the list (Va, Vb, Vc) and choosing the car variable as the category. The result is a swarm/box plot for each car in that variable across the x axis. What I am finding is appDesigner has only built in axis graph (x,y plotting like to plot a sine wave), and I have to create a swarm plot 'template' in the startup function, if I want to graph in the developed app. I have gotten as far as opening a figure window, but no data shows up. I am not even sure how to troubleshoot that (it works in regular matlab). And I have yet to find examples of how to do this. It should be simple. Matlab might need to redefine their competitors and focus development there.
Adam Danz
Adam Danz 2022-12-28
@Ted H, if you have this working outside of AppDesigner then it can work inside app designer. You can define local private functions within AppDesigner. Move your plotting function from the m file to a local function within the app. If you're not doing so already, specify the axes handles in your plotting commands. For example:
plot(app.UIAxes, __)
The app's startup function can initialize the plot and the plot can be updated any time any parameter value is changed by the users by setting up callback functions for the app components.
Alternatively, your app can generate the plot outside of appdesigner if that's what you're aiming for.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by