AppDesigner issues: reordering and undeleting callbacks, turning off Code Analyzer markup
Mostrar comentarios más antiguos
In the AppDesigner code view editor, the callbacks appear in a certain order. I was wondering if there was a way to shuffle them into a different order, other than the obviously inconvenient way of deleting and rewriting them from scratch. Cut & paste doesn't appear to be an option.
Also, I seem to find (this is in R2017a) that when I delete a callback using the context menu in the callbacks tab, there is no going back. In other words, the Undo toolbar button doesn't become active to let me restore it. Is it supposed to be that way?
Finally, is there really no way of suppressing Code Analyzer markup? If I upgrade to R2017b would I have this capability? There is an "Enable app coding alerts" checkbox, but all that does is get rid of warning icons along the right hand edge of the editor. The squiggly red underlining doesn't go away.
2 comentarios
Michael Amonson
el 28 de Feb. de 2018
I'm running R2017b and need some method to reorder the callbacks. I can't believe this is so difficult! This is a huge oversight. There should be an easy way of allowing the user to reorder the callbacks. Any insight or guidance would be greatly appreciated!
Matt J, concerning your question about R2017b and suppressing Code Analyzer markup, unchecking the "Enable app coding alerts" box in the View section under the Editor tab is supposed to suppress the alerts, but it has no effects whatsoever.
Jon
el 14 de Mzo. de 2018
I submitted the following as a Service Request in August 2017: When building a user interface with App Designer I find that the callbacks get entered into the code in the order that they are created. This is not necessarily the most logical way to organize the code. I would like to reorder the callbacks into a more logical order (e.g. grouping callbacks that all relate to the same underlying controller). I can not find any way to reorder them. Is there a way to do it? Please let me know.
I received the reply: As of R2017a, it is not possible to reorder callbacks in App Designer code. I have notified our development team of this enhancement, and they will consider it for future releases of MATLAB.
I have since updated to 2017B but still have the same problem. I really would prefer to move ahead using App Designer rather than going back to using Guide, but this inability to reorder the callbacks is a real obstacle. I hope that this gets some elevated priority from the developers soon.
Respuesta aceptada
Más respuestas (2)
Melissa Williams
el 12 de Dic. de 2018
4 votos
Hi everyone,
The R2019a pre-release is live as of today. If you have access to it, you can try out:
- reordering your callbacks in App Designer by dragging and dropping them in the Code Browser Callbacks tab (to the left of the Editor window in Code View).
- turning off Code Analyzer - in the MATLAB preferences panel, under Code Analyzer, turn off "Enable integrated warnings and error messages" This change will take effect in both the MATLAB and App Designer editors. (If you already had turned it off for the MATLAB editor, it should just be off in App Designer).
16 comentarios
Matt J
el 4 de Feb. de 2019
Mallory Kosfeld
el 5 de Abr. de 2019
Whenever I reorder the callbacks in the Code Browser Callbacks tab, they stay in that order until I close and reopen App Designer. When I reopen my .mlapp the callbacks revert to whatever order they were previously in, even if I run or save my mlapp. Is this a bug or am I doing something wrong?
Melissa Williams
el 8 de Abr. de 2019
Hi Mallory,
Unfortunately, yes this is bug and I have captured it and we will be working on a fix.
Thank you for sharing this with us.
-Melissa
Mallory Kosfeld
el 8 de Abr. de 2019
Darn, okay. Thanks for looking into it!
Jon
el 9 de Abr. de 2019
It looks like you've already added it to your bug reports, but I also have the same experience as Mallory - The reordering of the callbacks is not persistent. Too bad, I was so happy to finally have this functionality included.
Melissa Williams
el 30 de Abr. de 2019
Hi everyone,
This has been fixed in R2019a Update 1 which is available now. Reordering callbacks will now remained saved with your app.
-Melissa
Mallory Kosfeld
el 1 de Mayo de 2019
Melissa,
It works for me now! The update fixed it. Thank you!
Mallory
Per code analyzer messages, can't we selectively silence them with %#ok flags? I know that %#ok the literal works, but that suppresses ALL warnings on the line. I want the individual control, but I can't figure out what to put inside the < >. Can you tell me the manual flag for "Use app.<name> to reference a property of app." until suppression is integrated?
Melissa Williams
el 24 de Jun. de 2019
To manually supress the specific warning you mention, "Use app.<name> to reference a property of app." try %#ok<ADPROP>
Greg
el 26 de Jun. de 2019
Thanks for the reply, but that one doesn't work. I get a new message stating "A Code Analyzer message was once suppressed here, but the message is no longer generated." Is there anywhere - like buried in <matlabroot> or such - to look at a complete list of suppression tags? I understand it would likely be difficult to read, but I'm willing to try.
Melissa Williams
el 26 de Jun. de 2019
Which release are you using?
Greg
el 26 de Jun. de 2019
R2019a.
Melissa Williams
el 27 de Jun. de 2019
There are few suppression codes introduced specifically for the App Designer use cases.
User references a class property, but does not use the obj.PropertyName syntax
- %#ok<ADPROP>
- %#ok<ADPROPLC> (depending on the coding pattern it's one or the other, they both produce the same message)
User declares class method, but does not provide object reference in the method declaration
User declares class method, but does not provide 'app' as the first argument.
- %#ok<ADAPPREF>
User calls a function, with same name as a class method
- %#ok<ADMTHDINV>
Greg
el 2 de Jul. de 2019
%#ok<ADPROPLC> worked perfectly.
Thank you for the list, it will be nice to turn off the others if they arise.
Jens Haldrup
el 12 de Jul. de 2019
Will you consider making it possible to reorder elements in the component browser also?
Matt J
el 29 de En. de 2020
CallumP
el 9 de Feb. de 2020
2 votos
Can't help with the code analyser markyup but I wrote this: https://uk.mathworks.com/matlabcentral/fileexchange/71838-hierarchyviewer which allows you to reorder components and callbacks.
Categorías
Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!