comparison aim-mat/tools/@parameter/parameter.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children 20ada0af3d7d
comparison
equal deleted inserted replaced
-1:000000000000 0:74dedb26614d
1 % method of class @parameter
2 %
3 % (c) 2003-2008, University of Cambridge
4 % Maintained by Tom Walters (tcw24@cam.ac.uk), written by Stefan Bleeck (stefan@bleeck.de)
5 % http://www.pdn.cam.ac.uk/cnbh/aim2006/tools/parameter
6 % $Date: 2008-06-10 18:00:16 +0100 (Tue, 10 Jun 2008) $
7 function dstr=parameter(inp,mode,position)
8 % class parameter
9
10
11 if nargin<1
12 param.name='data structure';
13 param.entries=[];
14 else
15 if isobject(inp)
16 param=inp;
17 else
18 if isstr(inp)
19 param.name=inp;
20 param.entries=[];
21 else
22 error('data structure must be called with a name');
23 end
24 end
25 end
26
27
28
29 % protected variables (only accessible through set/get)
30
31 % version number.
32 % Version 1.0: basic functionallity works
33 param.version='1.0';
34
35
36 % these values are used when a gui is used
37 % that one is the default value that is given back when the gui is closed
38 param.default_value='';
39
40 % that one defines whether the gui is modal or not
41 if nargin < 2
42 param.mode='nonmodal';
43 else
44 if strcmp(mode,'modal') || strcmp(mode,'nonmodal')
45 param.mode=mode;
46 else
47 disp('mode not recognised');
48 param.mode='nonmodal';
49 end
50 end
51 % data that the user can use to shift it between gui and application:
52 param.userdata=[];
53
54 % north - top center edge of screen
55 % south - bottom center edge of screen
56 % east - right center edge of screen
57 % west - left center edge of screen
58 % northeast - top right corner of screen
59 % northwest - top left corner of screen
60 % southeast - bottom right corner of screen
61 % southwest - bottom left corner
62 % center - center of screen
63 % onscreen - nearest location with respect to current location that is on
64 % screen The position argument can also be a two-element vector [h,v], where depending on sign, h specifies the
65 % the default position of the gui is in the top right corner
66 if nargin <3
67 param.position='center';
68 else
69 if strcmp(position,'north') || strcmp(position,'south') || strcmp(position,'west') || strcmp(position,'east') || strcmp(position,'northeast') || strcmp(position,'northwest') || strcmp(position,'southeast') || strcmp(position,'southwest') || strcmp(position,'center') || strcmp(position,'onscreen')
70 param.position=position;
71 elseif size(position)==2
72 param.position=position;
73 else
74 disp('position not reconised');
75 param.position='center';
76 end
77 end
78
79 % where the focus is directly after calling
80 param.firstfocus='';
81
82 % diosplayed when with the mouse over it
83 param.tooltiptext='';
84
85
86 % a couple of informations that are used during installations (private
87 % variables
88 param.panelinfo=[];
89
90 dstr=class(param,'parameter');
91
92
93