Implementing multiple selection and selection range for UITable in App Designer

24 vues (au cours des 30 derniers jours)
Fatai Anifowose
Fatai Anifowose le 23 Mar 2020
Commenté : JClarcq le 11 Mai 2020
Following the notice that GUIDE will be removed from MATLAB by the end of 2020, I started developing my new projects using App Designer. To put it mildly, it's been a tough journey so far. A number of capabilities in GUIDE are not working in App Designer.
I am facing some challenges specifically on getting the UITable to work for me. The following are my specific issues:
  1. Multiple cell selection using "CTRL+ mouse click" used to be by default in GUIDE. How can I do same in App Designer? I need to programatically get the index of the selected cells.
  2. Range selection using mouse drag used to be by default in GUIDE. How can I do same in App Designer? I also need to get the index of the selected cell ranges.
These are my issues for now.
Thanks.
  1 commentaire
Mary Hearn
Mary Hearn le 24 Avr 2020
I have the same issue. I am using 2019b. Is this available in 2020a?
Thank you.

Connectez-vous pour commenter.

Réponses (1)

Mohammad Sami
Mohammad Sami le 24 Avr 2020
I have no answer for your first question.
For the second question, I was able to do range selection using left click and dragging the mouse in R2020a.
% quick test
b = randi([1 10],10,10);
b = array2table(b);
f = uifigure;
t = uitable(f);
t.Data = b;
t.CellSelectionCallback = @(~,event)disp(event);
% the event object has the following properties
%CellSelectionChangeData with properties:
% Indices: [8×2 double] first column is row number, second column in column number
% DisplayIndices: [8×2 double]
% Source: [1×1 Table]
% EventName: 'CellSelection'
  2 commentaires
Mohammad Sami
Mohammad Sami le 24 Avr 2020
For more information on the supported selection options, please see the documentation of CellSelectionCallback for your version of matlab.
Further to my answer, it list all the currently available options for Contiguous Selection Options and Discontiguous Selection Options.
https://www.mathworks.com/help/releases/R2020a/matlab/ref/matlab.ui.control.tableappd-properties.html
https://www.mathworks.com/help/releases/R2019b/matlab/ref/matlab.ui.control.tableappd-properties.html
JClarcq
JClarcq le 11 Mai 2020
Current method of selecting discontinuous cell is totally non-obvious to most users.
"Then, Ctrl+click to focus another cell, and finally Shift+click to select the cell that is in focus"
Even if I know this behavior, this is really unnatural to me. Users are mostly expecting an Excel like behavior which would be:
click to focus cell, Ctrl+click to select, ctrl+shift+click, to select discontinuous groups of continous cells

Connectez-vous pour commenter.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by