Add Custom TextField Component to Simulink Toolstrip
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Andrew Van Gerpen
am 30 Jan. 2023
Kommentiert: Jari
am 10 Feb. 2025 um 9:34
I am looking to create a custom Simulink toolstrip text input component. I see there is documentation regarding custom toolstrip components, but it seems that PushButton, DropDownButton, SplitButton, and EmptyControl are the only components available via the user API. In the Simulink Toolstrip under Simulation --> Simulate there is an input text field for simulation Stop Time (see image below). This makes me think there may be a way to create a custom text input field.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1278935/image.png)
I dug into the program files a bit and found what seems to be a toolstrip configuration file (MATLAB\R2022b\toolbox\simulink\ui\sl_studio\sl_studio\defaultToolstripCacheVersion2.json). In the file, I see a section regarding Stop Time, and the value for key "ToolType" is "TextField" (see below), but the whole file structure is much different from what is in the custom Toolstrip config .json in the documentation.
"content": {
"ActionId": "stopTimeSimAction",
"ContextType": "SimulinkStudioContext",
"IconOverride": "",
"JSONString": "",
"Label": "Stop Time",
"Name": "TextfileStopTime",
"ParentName": "",
"PopupName": "",
"ShowDescription": false,
"TextOverride": "",
"ToolType": "TextField"
},
If creating a TextField via user API isn't currently a feature, could It be added in a future version?
1 Kommentar
Thom
am 22 Feb. 2023
I have exaclty the same question. After a lot of struggle, I came to the same conclusion as Andrew.
And while we're at it: the text "Stop Time" seems to have type "label" it seems froms using slToolstripDeveloperMode('on') to peek at the title of the control. That is also missing in the API.
Akzeptierte Antwort
Raghunathraju
am 3 Apr. 2023
Hi Andrew,
Currently Custom Tab in Simulink Toolstrip is only supporting PushButton, DropDownButton, SplitButton, and EmptyControl. It is not planned to add Textfield component yet, however you can except to see the TextField component in future .
1 Kommentar
Jari
am 10 Feb. 2025 um 9:34
The user API still does not show a TextField type, but it's been nearly two years since this staff answer. Can we still expect this in the near future or has the idea been shelved?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!