Skip to content

Commit c7837cb

Browse files
authored
Merge pull request #167 from mathworks/r2026a_issues
R2026a issues
2 parents 8c49e6b + f7c4b78 commit c7837cb

File tree

3 files changed

+62
-18
lines changed

3 files changed

+62
-18
lines changed

resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/zElVE5iTAf8BJd9MCDX_B5ptDqYd.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
<<<<<<< HEAD
21
<?xml version="1.0" encoding="UTF-8"?>
3-
=======
4-
<?xml version='1.0' encoding='UTF-8'?>
5-
>>>>>>> stash
62
<Info>
73
<Category UUID="FileClassCategory">
84
<Label UUID="design"/>

test/+wt/+test/DatetimeSelector.m

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ function testTimeZoneName(testCase)
171171
testCase.verifyTimeZoneDisplay();
172172

173173
% Verify the Value field was updated
174-
actValue = string(w.Value.TimeZone);
175-
testCase.verifyMatches(actValue, expValue)
176-
174+
testCase.verifyValueTimeZone(expValue)
175+
177176
end %function
178177

179178

@@ -322,18 +321,62 @@ function verifyTimeZoneDisplay(testCase, expVal)
322321
expVal (1,1) string = testCase.Widget.Value.TimeZone
323322
end
324323

324+
import matlab.unittest.constraints.Eventually
325+
import matlab.unittest.constraints.IsEqualTo
326+
325327
% Give a moment for any display updates
326-
pause(0.01);
327-
drawnow
328+
% pause(0.01);
329+
% drawnow
330+
%
331+
% % Verify correct timezone is selected
332+
% actVal = string(testCase.Widget.TimeZoneControl.Value);
333+
% testCase.verifyEqual(actVal, expVal);
334+
335+
% % Verify the correct timezone
336+
% testCase.verifyThat(...
337+
% @()getTimeZoneFromComponentDateTime(testCase.Widget.TimeZoneControl,"Value"),...
338+
% Eventually(IsEqualTo(expVal), "WithTimeoutOf", 5));'
339+
340+
testCase.verifyPropertyValue(testCase.Widget.TimeZoneControl, "Value", expVal);
341+
342+
end %function
343+
344+
345+
function verifyValueTimeZone(testCase, expVal)
346+
% Verify the time zone in Value matches the expected value
328347

329-
% Verify correct timezone is selected
330-
actVal = string(testCase.Widget.TimeZoneControl.Value);
331-
testCase.verifyEqual(actVal, expVal);
348+
arguments
349+
testCase
350+
expVal (1,1) string
351+
end
352+
353+
import matlab.unittest.constraints.Eventually
354+
import matlab.unittest.constraints.IsEqualTo
355+
356+
% Verify the correct timezone
357+
testCase.verifyThat(...
358+
@()getTimeZoneFromComponentDateTime(testCase.Widget,"Value"),...
359+
Eventually(IsEqualTo(expVal), "WithTimeoutOf", 5));
332360

333361
end %function
334362

363+
% function verifyTimeZone
364+
335365
end %methods
336366

337367

338368
end %classdef
339369

370+
371+
%% Helper functions
372+
function tz = getTimeZoneFromComponentDateTime(comp, propName)
373+
374+
arguments
375+
comp (1,1) matlab.graphics.Graphics
376+
propName (1,1) string
377+
end
378+
379+
tz = string(comp.(propName).TimeZone);
380+
381+
end %function
382+

widgets/+wt/+abstract/BaseInternalDialog.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,24 @@ function positionOver(obj, refComp)
316316
obj.IsWaitingForOutput = true;
317317
waitfor(obj,'IsWaitingForOutput',false)
318318

319-
% Produce output
319+
% Complete the wait action
320+
% Is the dialog still present?
320321
if isvalid(obj)
322+
323+
% Assign the output
321324
output = obj.Output;
322325
lastAction = obj.LastAction;
326+
327+
% Check for deletion criteria and delete dialog
328+
obj.checkDeletionCriteria()
329+
323330
else
331+
324332
% Dialog or figure was deleted
325333
output = [];
326334
lastAction = "close";
327-
end
328-
329335

330-
% Check for deletion criteria
331-
obj.checkDeletionCriteria()
336+
end
332337

333338
end %function
334339

@@ -403,7 +408,7 @@ function setup(obj)
403408
obj.OuterPanel.ButtonDownFcn = @(~,evt)onTitleButtonDown(obj,evt);
404409

405410
% Close Button
406-
obj.CloseButton = uibutton(obj.OuterPanel);
411+
obj.CloseButton = uibutton(obj);
407412
obj.CloseButton.Text = "";
408413
obj.CloseButton.Tag = "close";
409414
obj.CloseButton.IconAlignment = "center";

0 commit comments

Comments
 (0)