Download this file

71 lines (52 with data), 2.0 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
classdef Flex < handle
%uix.mixin.Flex Flex mixin
%
% uix.mixin.Flex is a mixin class used by flex containers to provide
% various properties and helper methods.
% Copyright 2016 The MathWorks, Inc.
% $Revision: 1435 $ $Date: 2016-11-17 17:50:34 +0000 (Thu, 17 Nov 2016) $
properties( GetAccess = protected, SetAccess = private )
Pointer = 'unset' % mouse pointer
end
properties( Access = private )
Figure = gobjects( 0 ); % mouse pointer figure
Token = -1 % mouse pointer token
end
methods
function delete( obj )
%delete Destructor
% Clean up
if ~strcmp( obj.Pointer, 'unset' )
obj.unsetPointer()
end
end % destructor
end % structors
methods( Access = protected )
function setPointer( obj, figure, pointer )
%setPointer Set pointer
%
% c.setPointer(f,p) sets the pointer for the figure f to p.
% If set, unset
if obj.Token ~= -1
obj.unsetPointer()
end
% Set
obj.Token = uix.PointerManager.setPointer( figure, pointer );
obj.Figure = figure;
obj.Pointer = pointer;
end % setPointer
function unsetPointer( obj )
%unsetPointer Unset pointer
%
% c.unsetPointer() undoes the previous pointer set.
% Check
assert( obj.Token ~= -1, 'uix:InvalidOperation', ...
'Pointer is already unset.' )
% Unset
uix.PointerManager.unsetPointer( obj.Figure, obj.Token );
obj.Figure = gobjects( 0 );
obj.Pointer = 'unset';
obj.Token = -1;
end % unsetPointer
end % helper methods
end % classdef