Borrar filtros
Borrar filtros

Making a GUI for receiving/checking user input - how to arrange GUI and validation checks

5 visualizaciones (últimos 30 días)
Sorry if my question sounds general, I'm new to GUI and frontend/backend ideas and all that (mostly I just do scripts for math hw and such) but I make it more specific here. I have a program that runs through various processes (A -> B -> C -> etc), where each process depends on a different set of inputs. I want to make a GUI to help the user manage the inputs for whichever processes they want to run (maybe A-D, maybe ACD, etc). So what I'm thinking of building is:
  1. A UIFigure with a TabGroup where each tab has EditFields, Buttons, etc for a process, and the user can use these to submit their inputs
  2. This GUI will make use of function callbacks like ValueChangedFcn to run instant checks as the user inputs parameters - if they select something and a new option becomes available, or if they put in a bad character so an error pops up - all of these should occur immediately
  3. And finally, I also want the user to be able to load previously created input structs and have the contents be checked, presumably with the same functions used by the GUI, but not necessarily through the GUI; that is, if it's just being checked, this could be done through the command line
So my question is: what are the design principles I should follow for this? I'm thinking:
  1. A top-level class that gets the required Tabs based on what parts of the process the user wants to run.
  2. Each Tab should have a class that just organizes the components on the page. Each component might have a callback to the appropriate function for checking, so -
  3. Each Tab should also have a class with methods that check the input parameters
  4. As for users being able to load/check input structs, maybe this would mean the Tab classes would have a constructor that would accept an input struct and set the parameters, then have the Tab class also call the Checks?
  5. If the user wants to check input files on the command line, the Tab class could print out any errors that occurred?
To figure out the correct approach, I looked for open-source software that might have similar things pop up - FileZilla had some similar GUIs for inputs, and I think they have all their function checks in cpp files like this one (manual_transfer.cpp), but not sure where the GUI details are (I'm not very familiar with C++). I also saw another example where they include the validation check as part of the GUI class. Is this the way to go?
Any thoughts, examples, or references would be much appreciated!

Respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by