diff --git a/gui_support/app/EDFMAppController.m b/gui_support/app/EDFMAppController.m index c6486bc..0fad940 100644 --- a/gui_support/app/EDFMAppController.m +++ b/gui_support/app/EDFMAppController.m @@ -1527,7 +1527,8 @@ classdef EDFMAppController < handle try uialert(obj.App.UIFigure, message, titleText, varargin{:}); catch - errordlg(obj.formatDialogMessage(message), obj.formatDialogMessage(titleText), 'modal'); + dialogTitle = obj.formatDialogMessage(titleText); + errordlg(obj.formatDialogMessage(message), dialogTitle, 'modal'); end end diff --git a/gui_support/app/EDFMGuideComponent.m b/gui_support/app/EDFMGuideComponent.m index 50ec11b..3ca33c6 100644 --- a/gui_support/app/EDFMGuideComponent.m +++ b/gui_support/app/EDFMGuideComponent.m @@ -2,7 +2,7 @@ classdef EDFMGuideComponent < handle %EDFMGUIDECOMPONENT Compatibility adapter from GUIDE/uicontrol to App Designer-style properties. properties (Constant, Access = private) - NUMERIC_FIELD_TYPE = 'numeric' + NumericFieldType = 'numeric' end properties (SetAccess = private) @@ -33,11 +33,13 @@ classdef EDFMGuideComponent < handle properties (Access = private) StoredMajorTicks = [] StoredMinorTicks = [] + IsNumericEditField logical = false end methods function obj = EDFMGuideComponent(handleObj) obj.Handle = handleObj; + obj.IsNumericEditField = obj.detectNumericEditField(); end function value = get.Value(obj) @@ -62,7 +64,7 @@ classdef EDFMGuideComponent < handle if obj.isNumericEditField() value = str2double(string(get(obj.Handle, 'String'))); if isnan(value) - value = []; + value = NaN; end else raw = get(obj.Handle, 'String'); @@ -280,8 +282,12 @@ classdef EDFMGuideComponent < handle end function tf = isNumericEditField(obj) + tf = obj.IsNumericEditField; + end + + function tf = detectNumericEditField(obj) userData = get(obj.Handle, 'UserData'); - tf = isstruct(userData) && isfield(userData, 'Type') && strcmp(userData.Type, obj.NUMERIC_FIELD_TYPE); + tf = isstruct(userData) && isfield(userData, 'Type') && strcmp(userData.Type, obj.NumericFieldType); end end