tomwalters@0: % method of class @parameter tomwalters@0: % bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org tomwalters@0: function dstr=parameter(inp,mode,position) tomwalters@0: % class parameter tomwalters@0: tomwalters@0: tomwalters@0: if nargin<1 tomwalters@0: param.name='data structure'; tomwalters@0: param.entries=[]; tomwalters@0: else tomwalters@0: if isobject(inp) tomwalters@0: param=inp; tomwalters@0: else tomwalters@0: if isstr(inp) tomwalters@0: param.name=inp; tomwalters@0: param.entries=[]; tomwalters@0: else tomwalters@0: error('data structure must be called with a name'); tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: % protected variables (only accessible through set/get) tomwalters@0: tomwalters@0: % version number. tomwalters@0: % Version 1.0: basic functionallity works tomwalters@0: param.version='1.0'; tomwalters@0: tomwalters@0: tomwalters@0: % these values are used when a gui is used tomwalters@0: % that one is the default value that is given back when the gui is closed tomwalters@0: param.default_value=''; tomwalters@0: tomwalters@0: % that one defines whether the gui is modal or not tomwalters@0: if nargin < 2 tomwalters@0: param.mode='nonmodal'; tomwalters@0: else tomwalters@0: if strcmp(mode,'modal') || strcmp(mode,'nonmodal') tomwalters@0: param.mode=mode; tomwalters@0: else tomwalters@0: disp('mode not recognised'); tomwalters@0: param.mode='nonmodal'; tomwalters@0: end tomwalters@0: end tomwalters@0: % data that the user can use to shift it between gui and application: tomwalters@0: param.userdata=[]; tomwalters@0: tomwalters@0: % north - top center edge of screen tomwalters@0: % south - bottom center edge of screen tomwalters@0: % east - right center edge of screen tomwalters@0: % west - left center edge of screen tomwalters@0: % northeast - top right corner of screen tomwalters@0: % northwest - top left corner of screen tomwalters@0: % southeast - bottom right corner of screen tomwalters@0: % southwest - bottom left corner tomwalters@0: % center - center of screen tomwalters@0: % onscreen - nearest location with respect to current location that is on tomwalters@0: % screen The position argument can also be a two-element vector [h,v], where depending on sign, h specifies the tomwalters@0: % the default position of the gui is in the top right corner tomwalters@0: if nargin <3 tomwalters@0: param.position='center'; tomwalters@0: else tomwalters@0: 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: param.position=position; tomwalters@0: elseif size(position)==2 tomwalters@0: param.position=position; tomwalters@0: else tomwalters@0: disp('position not reconised'); tomwalters@0: param.position='center'; tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: % where the focus is directly after calling tomwalters@0: param.firstfocus=''; tomwalters@0: tomwalters@0: % diosplayed when with the mouse over it tomwalters@0: param.tooltiptext=''; tomwalters@0: tomwalters@0: tomwalters@0: % a couple of informations that are used during installations (private tomwalters@0: % variables tomwalters@0: param.panelinfo=[]; tomwalters@0: tomwalters@0: dstr=class(param,'parameter'); tomwalters@0: tomwalters@0: tomwalters@0: