Download this file

96 lines (66 with data), 3.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
classdef ButtonBox < uix.Box
%uix.ButtonBox Button box base class
%
% uix.ButtonBox is a base class for containers that lay out buttons.
% Copyright 2009-2015 The MathWorks, Inc.
% $Revision: 1165 $ $Date: 2015-12-06 03:09:17 -0500 (Sun, 06 Dec 2015) $
properties( Access = public, Dependent, AbortSet )
ButtonSize % button size, in pixels
HorizontalAlignment % horizontal alignment [left|center|right]
VerticalAlignment % vertical alignment [top|middle|bottom]
end
properties( Access = protected )
ButtonSize_ = [60 20] % backing for ButtonSize
HorizontalAlignment_ = 'center' % backing for HorizontalAlignment
VerticalAlignment_ = 'middle' % backing for VerticalAlignment
end
methods
function value = get.ButtonSize( obj )
value = obj.ButtonSize_;
end % get.ButtonSize
function set.ButtonSize( obj, value )
% Check
assert( isa( value, 'double' ), 'uix:InvalidPropertyValue', ...
'Property ''ButtonSize'' must be of type double.' )
assert( isequal( size( value ), [1 2] ), ...
'uix:InvalidPropertyValue', ...
'Size of property ''ButtonSize'' must by 1-by-2.' )
assert( all( isreal( value ) ) && ~any( isinf( value ) ) && ...
~any( isnan( value ) ) && ~any( value <= 0 ), ...
'uix:InvalidPropertyValue', ...
'Elements of property ''ButtonSize'' must be real, finite and positive.' )
% Set
obj.ButtonSize_ = value;
% Mark as dirty
obj.Dirty = true;
end % set.ButtonSize
function value = get.HorizontalAlignment( obj )
value = obj.HorizontalAlignment_;
end % get.HorizontalAlignment
function set.HorizontalAlignment( obj, value )
% Check
assert( ischar( value ), 'uix:InvalidPropertyValue', ...
'Property ''HorizontalAlignment'' must be a string.' )
assert( any( strcmp( value, {'left';'center';'right'} ) ), ...
'Property ''HorizontalAlignment'' must be ''left'', ''center'' or ''right''.' )
% Set
obj.HorizontalAlignment_ = value;
% Mark as dirty
obj.Dirty = true;
end % set.HorizontalAlignment
function value = get.VerticalAlignment( obj )
value = obj.VerticalAlignment_;
end % get.VerticalAlignment
function set.VerticalAlignment( obj, value )
% Check
assert( ischar( value ), 'uix:InvalidPropertyValue', ...
'Property ''VerticalAlignment'' must be a string.' )
assert( any( strcmp( value, {'top';'middle';'bottom'} ) ), ...
'Property ''VerticalAlignment'' must be ''top'', ''middle'' or ''bottom''.' )
% Set
obj.VerticalAlignment_ = value;
% Mark as dirty
obj.Dirty = true;
end % set.VerticalAlignment
end % accessors
end % classdef