Skip to content

Commit a68d650

Browse files
KhlickDev-iL
authored andcommitted
Cherry-picked a couple of commits from Khlick/develop
New warning + uibutton handling.
1 parent cac2336 commit a68d650

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mlapptools.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ function fontWeight(hUIElement, weight)
286286
warnState = mlapptools.toggleWarnings('off');
287287
widgetID = WidgetID('data-test-id', char(struct(hUIElement).NodeId));
288288
warning(warnState); % Restore warning state
289-
case {'uipanel', 'figure', 'uitabgroup', 'uitab', ...
290-
'uiswitch', 'uitoggleswitch', 'uirockerswitch'}
289+
case { ...
290+
'uipanel', 'figure', 'uitabgroup', 'uitab', 'uibutton', ...
291+
'uiswitch', 'uitoggleswitch', 'uirockerswitch' ...
292+
}
291293
widgetID = WidgetID('data-tag', mlapptools.getDataTag(hUIElement));
292294
case 'uitable'
293295
TAB_PREFIX = "mgg_";
@@ -789,17 +791,20 @@ function unlockUIFig(hUIFig)
789791

790792
function oldState = toggleWarnings(toggleStr)
791793
OJF = 'MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame';
794+
JFR = 'MATLAB:ui:javaframe:PropertyToBeRemoved';
792795
SOO = 'MATLAB:structOnObject';
793796
if nargout > 0
794-
oldState = [warning('query',OJF); warning('query',SOO)];
797+
oldState = [warning('query',OJF); warning('query',SOO); warning('query',JFR)];
795798
end
796799
switch lower(toggleStr)
797800
case 'on'
798801
warning('on',OJF);
799802
warning('on',SOO);
803+
warning('on',JFR);
800804
case 'off'
801805
warning('off',OJF);
802806
warning('off',SOO);
807+
warning('off',JFR);
803808
otherwise
804809
warning(['Unrecognized option "' toggleStr '". Please use either "on" or "off".']);
805810
end

0 commit comments

Comments
 (0)