Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?>
=======
<?xml version='1.0' encoding='UTF-8'?>
>>>>>>> stash
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
Expand Down
59 changes: 51 additions & 8 deletions test/+wt/+test/DatetimeSelector.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ function testTimeZoneName(testCase)
testCase.verifyTimeZoneDisplay();

% Verify the Value field was updated
actValue = string(w.Value.TimeZone);
testCase.verifyMatches(actValue, expValue)

testCase.verifyValueTimeZone(expValue)

end %function


Expand Down Expand Up @@ -322,18 +321,62 @@ function verifyTimeZoneDisplay(testCase, expVal)
expVal (1,1) string = testCase.Widget.Value.TimeZone
end

import matlab.unittest.constraints.Eventually
import matlab.unittest.constraints.IsEqualTo

% Give a moment for any display updates
pause(0.01);
drawnow
% pause(0.01);
% drawnow
%
% % Verify correct timezone is selected
% actVal = string(testCase.Widget.TimeZoneControl.Value);
% testCase.verifyEqual(actVal, expVal);

% % Verify the correct timezone
% testCase.verifyThat(...
% @()getTimeZoneFromComponentDateTime(testCase.Widget.TimeZoneControl,"Value"),...
% Eventually(IsEqualTo(expVal), "WithTimeoutOf", 5));'

testCase.verifyPropertyValue(testCase.Widget.TimeZoneControl, "Value", expVal);

end %function


function verifyValueTimeZone(testCase, expVal)
% Verify the time zone in Value matches the expected value

% Verify correct timezone is selected
actVal = string(testCase.Widget.TimeZoneControl.Value);
testCase.verifyEqual(actVal, expVal);
arguments
testCase
expVal (1,1) string
end

import matlab.unittest.constraints.Eventually
import matlab.unittest.constraints.IsEqualTo

% Verify the correct timezone
testCase.verifyThat(...
@()getTimeZoneFromComponentDateTime(testCase.Widget,"Value"),...
Eventually(IsEqualTo(expVal), "WithTimeoutOf", 5));

end %function

% function verifyTimeZone

end %methods


end %classdef


%% Helper functions
function tz = getTimeZoneFromComponentDateTime(comp, propName)

arguments
comp (1,1) matlab.graphics.Graphics
propName (1,1) string
end

tz = string(comp.(propName).TimeZone);

end %function

17 changes: 11 additions & 6 deletions widgets/+wt/+abstract/BaseInternalDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,24 @@ function positionOver(obj, refComp)
obj.IsWaitingForOutput = true;
waitfor(obj,'IsWaitingForOutput',false)

% Produce output
% Complete the wait action
% Is the dialog still present?
if isvalid(obj)

% Assign the output
output = obj.Output;
lastAction = obj.LastAction;

% Check for deletion criteria and delete dialog
obj.checkDeletionCriteria()

else

% Dialog or figure was deleted
output = [];
lastAction = "close";
end


% Check for deletion criteria
obj.checkDeletionCriteria()
end

end %function

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

% Close Button
obj.CloseButton = uibutton(obj.OuterPanel);
obj.CloseButton = uibutton(obj);
obj.CloseButton.Text = "";
obj.CloseButton.Tag = "close";
obj.CloseButton.IconAlignment = "center";
Expand Down
Loading