Creazione di componenti personalizzati della UI
Creare componenti personalizzati della UI da utilizzare nelle proprie applicazioni o da condividere con altri. È possibile utilizzare i componenti personalizzati per estendere le funzionalità dei componenti esistenti della UI, per suddividere le applicazioni di grandi dimensioni in parti indipendenti e manutenibili e per progettare un'interfaccia che consenta agli utenti di personalizzare e riutilizzare un componente tra più applicazioni. Creare componenti personalizzati in modo interattivo in App Designer o programmatico creando una sottoclasse della classe di base di ComponentContainer
. In entrambi i casi, è possibile configurare i componenti per utilizzarli in modo interattivo nelle applicazioni di App Designer.
Classi
matlab.ui.componentcontainer.ComponentContainer | Base class for developing custom UI component objects (Da R2020b) |
Metodi
Funzioni
appdesigner.customcomponent.configureMetadata | Configure custom UI component for use in App Designer (Da R2021a) |
appdesigner.customcomponent.removeMetadata | Remove custom UI component from App Designer (Da R2021a) |
Argomenti
Creazione dei componenti nell’App Designer
- Create a Simple Custom UI Component in App Designer
Walk through the basic steps to interactively create a simple custom UI component. - Create Public Properties for Custom UI Components in App Designer
Create and validate custom UI component property values by specifying data types, default values, and property validation functions. - Create Callbacks for Custom UI Components in App Designer
Create public callbacks for your custom UI component that can be used to program the component behavior in an app. - Define Custom UI Component Startup Tasks in App Designer
Perform one-time startup tasks when a custom UI component is first created in an app. - Verify Behavior of Custom UI Components in App Designer
Verify that the public properties, callbacks, and display of your component appear and behave as expected. - Write Property Set Methods for Custom UI Components in App Designer
Perform custom validation of public properties by writing set methods for those properties. - Create Event Data for Custom UI Component Callbacks
Define event data associated with a callback that provides information about a user interaction. - Write Tests for Custom UI Component
Write automated tests to verify the behavior of a custom UI component.
Creazione dei componenti in modo programmatico
- Develop Custom UI Components Programmatically
Walk through the basic steps to author a custom UI component class using MATLAB® functions. - Manage Properties of Custom UI Components Programmatically
Validate property values, optimize how properties update, and customize how properties display for the UI components you author. - Create Custom UI Component With HTML
Use HTML UI components to author custom UI component classes with more flexibility.
Utilizzo e condivisione di componenti
- Configure Custom UI Components for App Designer
Enable interactive use of your custom UI components in App Designer. - Configure Property Display for Custom UI Components in App Designer
Design public properties of your component to enable users to easily use the component in an App Designer app.