annotate aim-mat/tools/@parameter/parameter.m @ 4:537f939baef0 tip

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