Refine GUIDE adapter review feedback
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
This commit is contained in:
co-authored by
kk14222
parent
0018b44cea
commit
fefb0a5506
@@ -1527,7 +1527,8 @@ classdef EDFMAppController < handle
|
|||||||
try
|
try
|
||||||
uialert(obj.App.UIFigure, message, titleText, varargin{:});
|
uialert(obj.App.UIFigure, message, titleText, varargin{:});
|
||||||
catch
|
catch
|
||||||
errordlg(obj.formatDialogMessage(message), obj.formatDialogMessage(titleText), 'modal');
|
dialogTitle = obj.formatDialogMessage(titleText);
|
||||||
|
errordlg(obj.formatDialogMessage(message), dialogTitle, 'modal');
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ classdef EDFMGuideComponent < handle
|
|||||||
%EDFMGUIDECOMPONENT Compatibility adapter from GUIDE/uicontrol to App Designer-style properties.
|
%EDFMGUIDECOMPONENT Compatibility adapter from GUIDE/uicontrol to App Designer-style properties.
|
||||||
|
|
||||||
properties (Constant, Access = private)
|
properties (Constant, Access = private)
|
||||||
NUMERIC_FIELD_TYPE = 'numeric'
|
NumericFieldType = 'numeric'
|
||||||
end
|
end
|
||||||
|
|
||||||
properties (SetAccess = private)
|
properties (SetAccess = private)
|
||||||
@@ -33,11 +33,13 @@ classdef EDFMGuideComponent < handle
|
|||||||
properties (Access = private)
|
properties (Access = private)
|
||||||
StoredMajorTicks = []
|
StoredMajorTicks = []
|
||||||
StoredMinorTicks = []
|
StoredMinorTicks = []
|
||||||
|
IsNumericEditField logical = false
|
||||||
end
|
end
|
||||||
|
|
||||||
methods
|
methods
|
||||||
function obj = EDFMGuideComponent(handleObj)
|
function obj = EDFMGuideComponent(handleObj)
|
||||||
obj.Handle = handleObj;
|
obj.Handle = handleObj;
|
||||||
|
obj.IsNumericEditField = obj.detectNumericEditField();
|
||||||
end
|
end
|
||||||
|
|
||||||
function value = get.Value(obj)
|
function value = get.Value(obj)
|
||||||
@@ -62,7 +64,7 @@ classdef EDFMGuideComponent < handle
|
|||||||
if obj.isNumericEditField()
|
if obj.isNumericEditField()
|
||||||
value = str2double(string(get(obj.Handle, 'String')));
|
value = str2double(string(get(obj.Handle, 'String')));
|
||||||
if isnan(value)
|
if isnan(value)
|
||||||
value = [];
|
value = NaN;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
raw = get(obj.Handle, 'String');
|
raw = get(obj.Handle, 'String');
|
||||||
@@ -280,8 +282,12 @@ classdef EDFMGuideComponent < handle
|
|||||||
end
|
end
|
||||||
|
|
||||||
function tf = isNumericEditField(obj)
|
function tf = isNumericEditField(obj)
|
||||||
|
tf = obj.IsNumericEditField;
|
||||||
|
end
|
||||||
|
|
||||||
|
function tf = detectNumericEditField(obj)
|
||||||
userData = get(obj.Handle, 'UserData');
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user