Does MatLab designer support inserting Text fields and CheckBoxes inside a ListBox?

I have implemented a GUI built with C# and Windows Presentation Foundation (see attachment 'GUI.png').
I need to implement a similar GUI using Matlab designer (see attachment 'Dicom-App.png').
I would like every item in the 2nd ("Patient Struct") and 3rd Listbox ("Renamed Struct") to contain a string as well as a progressive number and also a CheckBox as displayed in the attached 'GUI.png'.
I would greatly appreciate getting access to examples of nested designer controls, if any.
Numbering the strings displayed in the 2nd and corresponding 3rd ListBox is crucial to visualize the relationship.
If controls nesting is not supported by MatLab designer, an alternative may be to synchronously scroll the 2nd and the 3rd ListBox.
Is there any example of ListBoxes synchronized scrolling?
Thank you so much
Maura (maura.monville@nhs.net)

 Risposta accettata

As far as I know, there is no support for nested controls.
Maybe using a uitable would work for what you want to do (synchronized scolling, checkboxes and associated text objects next to each other). You may want to use multiple uitables to get it right (i.e., one corresponding to what's now the 1st listbox and another one corresponding to the 2nd and 3rd listboxes).
Documentation: uitable | Table Properties

3 Commenti

Thank you.
I tried to place two ListBoxes inside a "Panel" which was accepted by the designer.
Unluckily the ListBoxes are still singularly scrollable, whereas I wanted to make each ListBox not scrollable and use a scroll bar for the panel tha would scroll the two ListBoxes synchronously.
Unluckily, the ListBox seems to have an embedded scrollable property that cannot be changed by the user.
I will try replacing the ListBoxes with Tables. There may be a problem in replacing the ListBox with a Table. That is, I do not know how many strings I have to display in each ListBox. Such a number is only known at runtime. The ListBox automatically stretches to accommodate all the items without pre-allocating any dynamicmemory.
What about a Table?
Is there any example of a Table contaiing other controls?
"Is there any example of a Table contaiing other controls?"
A Table can contain columns of checkboxes or popupmenus (in addition to text, which can be constrained to be numeric or not). All of that behavior is controlled by the ColumnFormat property:
Several examples can be found in the documentation:
"I do not know how many strings I have to display in each ListBox. Such a number is only known at runtime."
I don't think this will be a problem with a Table. The Table's Position property sets the region covered by the table, and the Data property sets the number of rows and columns (and their contents) in the Table. The Table automatically turns vertical and horizontal scroll bars on and off appropriately, depending on whether all the Data fits in the region covered by the Position. So your code might set the Table(s)' Position(s) when the figure changes size, say, and set the Table(s) Data when the user makes selections to load a data set or the user changes whatever options that determine what goes into the Table(s).
The advantage of the Table over multiple listboxes is that synchronized scrolling is done by design in the Table, whereas it's difficult if not impossible to achieve the same effect using multiple listboxes, as you have found.
Thank you.
The problem is that I am developing a GUI.
The app Designer allows me to open figure on top of the GUI but it is not part of the GUI
The designer contain the control 'Table'. I will experiement with that to see if it is possible to achieve the same functionalities available with uitable.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Prodotti

Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by