@@ -353,8 +353,11 @@ case verLessThan('matlab','9.7') % R2019a
353
353
354
354
hController = struct(struct(hUIFig ).Controller);
355
355
% Check for Controller version:
356
- switch subsref(ver(' matlab' ), substruct(' .' ,' Version' ))
357
- case {' 9.0' ,' 9.1' } % R2016a or R2016b
356
+ switch true
357
+ case verLessThan(' matlab' ,' 9.0' ) % <= R2015b
358
+ throw(MException(' getWebWindow:MATLABTooOld' ,...
359
+ ' MATLAB versions before R2016a are not supported!' ));
360
+ case verLessThan(' matlab' ,' 9.2' ) % R2016a or R2016b (i.e., 9.0-9.1)
358
361
hWin = hController .Container .CEF ;
359
362
otherwise % R2017a onward
360
363
hWin = struct(hController .PlatformHost ).CEF;
@@ -701,13 +704,16 @@ function unlockUIFig(hUIFig)
701
704
warning(warnState );
702
705
end % getDataTag
703
706
704
- function [widgetID ] = getDecendentOfType(hWin , ancestorDataTag , descendentType )
707
+ function [widgetID ] = getDecendentOfType(hWin , ancestorDataTag , descendentType , descId )
705
708
% This method returns a node's first descendent of a specified <type>.
706
709
% See also:
707
710
% https://dojotoolkit.org/reference-guide/1.10/dojo/query.html#standard-css2-selectors
711
+ if nargin < 4
712
+ descId = 0 ;
713
+ end
708
714
widgetquerystr = sprintf(...
709
- ' dojo.getAttr(dojo.query("[data-tag^=''%s'' ] %s ")[0 ], "%s ")' , ...
710
- ancestorDataTag , descendentType , mlapptools .DEF_ID_ATTRIBUTE );
715
+ ' dojo.getAttr(dojo.query("[data-tag^=''%s'' ] %s ")[%u ], "%s ")' , ...
716
+ ancestorDataTag , descendentType , descId , mlapptools .DEF_ID_ATTRIBUTE );
711
717
try % should work for most UI objects
712
718
ID = hWin .executeJS(widgetquerystr );
713
719
if ~strcmpi(ID ,' null' )
0 commit comments