CSSuiNumericField

CSSuiNumericField()

CSSUINUMERICFIELD CSS-styled numeric edit field with optional step buttons, backed by uihtml

Usage:

nf = CSSuiNumericField(parent, ‘Value’, 50, ‘Min’, 0, ‘Max’, 100) nf.ValueChangedFcn = @(s,e) fprintf(‘%.2fn’, e.Value);

Inputs:

parent : graphics container – required

Name-Value Pairs:

‘Value’ : double - numeric value (default: 0) ‘Limits’ : 1x2 double - [Min Max] convenience alias (default: [-Inf Inf]) ‘Min’ : double - minimum allowed (default: -Inf) ‘Max’ : double - maximum allowed (default: Inf) ‘Step’ : double - step for +/- buttons (0 = hidden) (default: 0) ‘DecimalPlaces’ : integer - display precision (default: 4) ‘Format’ : char - printf format string (’’ = auto) (default: ‘’) ‘Placeholder’ : char - hint text when empty (default: ‘’) ‘Label’ : char - adjacent text label (default: ‘’) ‘LabelSide’ : char - ‘left’ | ‘right’ (default: ‘left’) ‘ValueChangedFcn’ : function handle - @(src, evt) on Enter/blur (default: []) ‘ValueChangingFcn’ : function handle - @(src, evt) on each keystroke (default: []) (plus all CSSBase name-value pairs)

Outputs:

nf : CSSuiNumericField handle

Notes

CSS element schema:
#css-root Outer sizing container

.cssui-numeric Widget-type class on #css-root .css-label Adjacent text label (when Label is set) .css-control Input surface wrapper

button#nf-dec Decrement button (when Step > 0) input#inp The <input type=”text”> element button#nf-inc Increment button (when Step > 0)

.css-disabled On #css-root when Enabled=false

See also: CSSBase, CSSPreset, CSSuiEditField

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿