You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submitted pull request #5 allows formatting controls whose parent is not the uifigure, however, the following fails:
f = uifigure('Position', [680 558 560 420]);
t = uitree(f,'Position',[20 20 520 380]);
tn = uitreenode(t,'Text','Test me');
mlapptools.fontWeight(tn, 'bold');
with the following error:
Error using mlapptools/getWidgetID (line 363)
widgetID query timed out after 5 seconds, UI needs more time to load
Error in mlapptools.getWebElements (line 108)
widgetID = mlapptools.getWidgetID(win, mlapptools.getDataTag(uiElement));
Error in mlapptools.fontWeight (line 65)
[win, widgetID] = mlapptools.getWebElements(uiElement);
Error in Untitled4 (line 6)
mlapptools.fontWeight(tn, 'bold');
Good news - I found a way to format uitree and uitreenode objects!
It seems that uitree objects use some different system internally (possibly ReactJS), so their children don't have a widgetid field we can refer to in order to edit the style. However, they do have some other identifiers such as data-test-id and data-reactid, which we could use.
I had to rethink how we uniquely identify (and pass around) UI objects. This resulted in some refactoring an overall more robust code.
It's an improvement but unfortunately fails on subnodes, per this example:
f = uifigure('Position', [680 558 560 420]);
t = uitree(f,'Position',[20 20 520 380]);
tn = uitreenode(t,'Text','Test me');
tn2 = uitreenode(tn,'Text','Test me');
mlapptools.fontWeight(tn, 'bold'); % <-- this is OK
mlapptools.fontWeight(tn2, 'bold'); % <--- but fails here
Changed this from 'bug' to 'enhancement' because formatting trees seems to require a completely different approach than other widgets.
At the moment, only top-level tree nodes can be modified permanently, whereas sub-nodes must be visible (i.e. parent is expanded) to apply changes, and changed don't persist if the parent node is collapsed.
functionIssue6
f = uifigure('Position', [680558560420]);
t = uitree(f,'Position',[2020520380]);
tn = uitreenode(t,'Text','Lorem');
tn2 = uitreenode(tn,'Text','Ipsum');
tn3 = uitreenode(tn2,'Text','Dolor');
mlapptools.fontWeight(tn3, 'bold');
end
Activity
sco1 commentedon Jan 2, 2018
Will have to do some deeper investigation, I cannot reproduce this on my machine.
davidn-IA commentedon Jan 2, 2018
Matlab 2017b -- should have mentioned that. Have not tried it on other versions.
Dev-iL commentedon Jan 2, 2018
@davidn-IA OS ?
davidn-IA commentedon Jan 2, 2018
W10 Enterprise FCU
Dev-iL commentedon Jan 2, 2018
Ok, I can reproduce this. Let's see now....
For now I found a totally unrelated bug in
decodeDijitRegistryResult:)Add check for parent UI Figure
Dev-iL commentedon Jan 3, 2018
Good news - I found a way to format
uitreeanduitreenodeobjects!It seems that
uitreeobjects use some different system internally (possibly ReactJS), so their children don't have awidgetidfield we can refer to in order to edit the style. However, they do have some other identifiers such asdata-test-idanddata-reactid, which we could use.I had to rethink how we uniquely identify (and pass around) UI objects. This resulted in some refactoring an overall more robust code.
@davidn-IA Until the latest PR is merged, you can head over to my fork and give the new code a try!
davidn-IA commentedon Jan 3, 2018
Fantastic, thanks. Will be checking it out shortly.
davidn-IA commentedon Jan 3, 2018
It's an improvement but unfortunately fails on subnodes, per this example:
f = uifigure('Position', [680 558 560 420]);
t = uitree(f,'Position',[20 20 520 380]);
tn = uitreenode(t,'Text','Test me');
tn2 = uitreenode(tn,'Text','Test me');
mlapptools.fontWeight(tn, 'bold'); % <-- this is OK
mlapptools.fontWeight(tn2, 'bold'); % <--- but fails here
Dev-iL commentedon Jan 4, 2018
Changed this from 'bug' to 'enhancement' because formatting trees seems to require a completely different approach than other widgets.
At the moment, only top-level tree nodes can be modified permanently, whereas sub-nodes must be visible (i.e. parent is expanded) to apply changes, and changed don't persist if the parent node is collapsed.
Merge pull request #8 from Dev-iL/develop
sco1 commentedon Jan 7, 2018
Should be fixed with #8 (947c54e). @davidn-IA, how does it look on your end?
davidn-IA commentedon Jan 8, 2018
Fantastic. This is a terrific improvement, thanks!
Dev-iL commentedon Jan 8, 2018
@sco1 I wouldn't close it just yet seeing how the existing solution is not really ideal...