slConvertCustomMenus
Description
slConvertCustomMenus
converts a custom Simulink® toolbar menu into a toolstrip tab that is stored in a toolstrip component
called custom
in the current folder. The new tab has the title
Custom and contains a single section with the same name as the top
level of the toolbar menu. The section is populated with the converted toolbar menu
items:
Action schemas and toggle schemas are converted into push buttons.
Container schemas are converted into drop-down buttons.
The toolbar menu is not automatically deleted during the conversion. To remove it,
delete or comment out the corresponding addCustomMenuFcn
call in the
sl_customization.m
file, save the file, and rebuild the toolstrip by
entering sl_refresh_customizations
in the MATLAB® Command Window.
If a toolstrip component called custom
already exists in the current
folder, a prompt will appear in the Command Window asking you for permission to overwrite
the component.
When the conversion is complete, the new tab can be edited like any other custom toolstrip tab. You can adjust the layout of the tab, its labels, and its functionality. See Create Custom Simulink Toolstrip Tabs for details.
slConvertCustomMenus(
converts a
custom Simulink toolbar menu into a toolstrip tab that is stored in a toolstrip component
whose name and resource location can be specified by name-value arguments. Name=Value
)
Permission to overwrite an existing toolstrip component of the same name and at the same location as the one that the conversion creates can be specified via name-value argument as well. If you do not specify this argument and such a component exists, a prompt will appear in the Command Window asking you for permission to overwrite the component.
Examples
Input Arguments
Limitations
When converting a custom toolbar menu into a toolstrip tab, any functionality that custom tabs do not support is ignored. However, you can edit the generated tab. For more information, see Create Custom Simulink Toolstrip Tabs.
If a toolstrip component with the name specified by
CompName
already exists in theCompFolder
location at the time of conversion, a prompt will appear in the Command Window asking you for permission to overwrite the component. If a component of another name already exists in theCompFolder
location, the menu cannot be converted.The conversion of a schema callback fails if its function handle points to a function local to the
sl_customization.m
file. Move all callback functions into separate function files.
Tips
To delete custom tab elements that are the result of a conversion, you can do one of the following:
Delete the resources folder located at
CompFolder
and callslReloadToolstripConfig
.Delete the JSON files of the tab in the resources folder located at
CompFolder
and callslReloadToolstripConfig
.
Version History
Introduced in R2022a