PageRenderTime 56ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/other_authors/seagrid/sources/presto_install.m

http://m--pack.googlecode.com/
MATLAB | 1 lines | 0 code | 0 blank | 1 comment | 0 complexity | c5721dc12e89de2f38809e63b985afc6 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. % Installer: "presto_install.m" % Created: 31-May-2002 09:37:55. function bund_driver % bund_driver -- Driver for "bund" bundles. % bund_driver (no arguments) contains Matlab commands % to inflate the instructions and files that are % encoded into the "bund_data" function of this package. % Copyright (C) 2001 Dr. Charles R. Denham, ZYDECO. % All Rights Reserved. % Disclosure without explicit written consent from the % copyright owner does not constitute publication. % Version of 14-Jun-2001 10:54:16. % Updated 03-Aug-2001 13:43:17. help(mfilename) BINARY_TAG = '?'; CR = char(13); LF = char(10); comp = upper(computer); if any(findstr(comp, 'PCWIN')) % Windows. NL = [CR LF]; elseif any(findstr(comp, 'MAC2')) % Macintosh. NL = CR; else % Unix. NL = LF; end c = zeros(1, 256); c(abs('0'):abs('9')) = 0:9; c(abs('a'):abs('f')) = 10:15; disp([' ']) disp([' ## This installer is ready to expand its contents,']) disp([' ## starting in the present directory: "' pwd '"']) disp([' ## To abort, execute an interruption now.']) disp([' ## Otherwise, to continue, press any key.']) disp([' ']) try pause catch disp([' ## Installation interrupted.']) disp([' ']) return end tic w = which(mfilename); fin = fopen(w, 'r'); if fin < 0, return, end found = ~~0; while ~found s = fgetl(fin); if isequal(s, -1) fclose(fin); return end s = strrep(s, LF, ''); % Not necessary? s = strrep(s, CR, ''); % Not necessary? if isequal(s, 'function bund_data') found = ~~1; end end fout = -1; done = ~~0; while ~done s = fgetl(fin); if isequal(s, -1) fclose(fin); return end if length(s) > 0 if s(1) ~= '%' f = findstr(s, 'bund_setdir'); if any(f) theDir = eval(strrep(s, 'bund_setdir', '')); status = mkdir(theDir); switch status case 1 disp([' ## Directory created: "' theDir '"']) case 2 disp([' ## Directory exists: "' theDir '"']) otherwise error([' ## Error while making new directory.']) end try cd(theDir) catch error([' ## Unable to go to directory: "' theDir '"']) end else try eval(s); catch error([' ## Unable to evaluate: "' s '"']) end end elseif length(s) > 1 & s(2) == BINARY_TAG hx = double(s(3:end)); % Assume hex data. bin = 16*c(hx(1:2:end)) + c(hx(2:2:end)); fwrite(fout, bin, 'uchar'); else fprintf(fout, '%s', s(2:end)); fprintf(fout, NL); end end end fclose(fin); disp([' ## Elapsed time: ' num2str(fix(10*toc)/10) ' s.']) function bund_data bund_setdir('presto') bund_setdir('@presto') disp(' ## Installing: "detach.m" (text)') fout = fopen('detach.m', 'w'); %function theResult = detach(self) % %% presto/detach -- Remove "presto" object from handle. %% detach(self) removes self, a "presto" object, from %% its associated handle. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 01-Nov-1999 10:45:28. %% Updated 01-Nov-1999 10:45:28. % %if nargout > 0, theResult = presto(self); end %if nargin < 1, help(mfilename), return, end % %set(handle(self), 'UserData', self.UserData) fclose(fout); disp(' ## Installing: "disp.m" (text)') fout = fopen('disp.m', 'w'); %function theResult = disp(self, verboseFlag) % %% presto/display -- Display "presto" object. %% display(self, verboseFlag) displays the contents %% of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 28-Oct-1999 02:51:45. %% Updated 28-Oct-1999 02:51:45. % %if nargin < 1, help(mfilename), return, end %if nargin < 2, verboseFlag = 0; end % %disp(struct(self)) % %if any(verboseFlag) % disp(self.itsData) %end fclose(fout); disp(' ## Installing: "display.m" (text)') fout = fopen('display.m', 'w'); %function theResult = display(self, verboseFlag) % %% presto/display -- Display "presto" object. %% display(self, verboseFlag) displays the contents %% of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 28-Oct-1999 02:51:45. %% Updated 28-Oct-1999 02:51:45. % %if nargin < 1, help(mfilename), return, end %if nargin < 2, verboseFlag = 0; end % %disp(' ') %disp([inputname(1) ' =']) %disp(' ') %disp(self, verboseFlag) fclose(fout); disp(' ## Installing: "doabout.m" (text)') fout = fopen('doabout.m', 'w'); %function doabout(self) % %% The "presto" class provides a framework for %% processing interactive graphical events. It %% features "dot" syntax for the setting/getting %% of graphical and user-defined properties. All %% events are trapped by calls to "event", whose %% sole argument is the name of Matlab callback %% (e.g. "ButtonDownFcn"). Use "menu" to add %% menu items, "control" to add controls, and %% "enable" to automatically enable the relevant %% callbacks. The file "presto_test.m" gives a %% demonstration. %% The "presto" class should be super-classed, %% and the "event" method should be overloaded. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 01-Nov-1999 13:53:56. %% Updated 04-Nov-1999 15:56:44. % %helpdlg(help(mfilename), 'About Presto') fclose(fout); disp(' ## Installing: "doclear.m" (text)') fout = fopen('doclear.m', 'w'); %function theResult = doclear(self, varargin) % %% presto/doclear -- Stub for "clear" event. %% doclear(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "docontrol.m" (text)') fout = fopen('docontrol.m', 'w'); %function theResult = docontrol(self, theEvent, varargin) % %% presto/docontrol -- Handler for "presto" controls. %% docontrol(self, 'theEvent') handles 'theEvent' on %% behalf of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 11:49:51. %% Updated 05-Nov-1999 15:00:06. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %switch theEvent %case {'bottom', 'right', 'top', 'left'} % theValue = get(gcbo, 'Value'); % theMin = get(gcbo, 'Min'); % theMax = get(gcbo, 'Max'); % disp([' ## ' theEvent ' ' mat2str([theMin theValue theMax])]) %otherwise % theValue = get(gcbo, 'Value'); % disp([' ## ' theEvent mat2str(theValue)]) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "docopy.m" (text)') fout = fopen('docopy.m', 'w'); %function theResult = docopy(self, varargin) % %% presto/docopy -- Stub for "copy" event. %% docopy(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "docut.m" (text)') fout = fopen('docut.m', 'w'); %function theResult = docut(self, varargin) % %% presto/docut -- Stub for "cut" event. %% docut(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doedit.m" (text)') fout = fopen('doedit.m', 'w'); %function theResult = doedit(self, varargin) % %% presto/doedit -- Stub for "edit" event. %% doedit(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doevent.m" (text)') fout = fopen('doevent.m', 'w'); %function theResult = doevent(self, theEvent, theMessage, varargin) % %% presto/doevent -- Call "presto" event handler. %% doevent(self, theEvent, theMessage) calls the appropriate %% event handler on behalf of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 19:28:46. %% Updated 08-Dec-1999 11:47:11. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end %if nargin < 2, theEvent = '(none)'; end %if nargin < 3, theMessage = []; end % %result = []; % %switch get(gcbo, 'Type') %case 'uimenu*' % result = domenu(self, theEvent, theMessage); %case 'uicontrol*' % result = docontrol(self, theEvent, theMessage); %otherwise % theHandler = handler(self, theEvent); % if ~isempty(theHandler) % result = builtin('feval', theHandler, self, theEvent, theMessage); % else % if isempty(theEvent), theEvent = '(none)'; end % theType = get(gcbo, 'Type'); % disp([' ## ' datestr(now, 13) ' ' theEvent ' ' theType ' ' num2str(gcbo)]) % end %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "dofile.m" (text)') fout = fopen('dofile.m', 'w'); %function theResult = dofile(self, varargin) % %% presto/dofile -- Stub for "file" event. %% dofile(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "domenu.m" (text)') fout = fopen('domenu.m', 'w'); %function theResult = domenu(self, theEvent, varargin) % %% presto/domenu -- Handler for "presto" menus. %% domenu(self, 'theEvent') handles 'theEvent' on %% behalf of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 11:49:51. %% Updated 05-Nov-1999 15:00:06. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %try % theHandler = handler(self, theEvent); % result = builtin('feval', theHandler, self, theEvent); %catch % errormsg(self) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "domenubar.m" (text)') fout = fopen('domenubar.m', 'w'); %function theResult = domenubar(self, varargin) % %% presto/domenubar -- Toggle the "presto" menubar. %% domenubar(self) toggles the menubar on behalf %% of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 04-Nov-1999 15:32:53. %% Updated 04-Nov-1999 15:32:53. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theMenu = gcbo; % %theFigure = theMenu; %while ~isequal(get(theFigure, 'Type'), 'figure') % theFigure = get(theFigure, 'Parent'); %end % %switch lower(get(theFigure, 'MenuBar')) %case 'figure' % set(theFigure, 'MenuBar', 'none') % if any(theMenu), set(theMenu, 'Checked', 'off'); end %case 'none' % set(theFigure, 'MenuBar', 'figure') % if any(theMenu), set(theMenu, 'Checked', 'on'); end %end % %if nargout > 0, theResult = self; end fclose(fout); disp(' ## Installing: "domouse.m" (text)') fout = fopen('domouse.m', 'w'); %function theResult = domouse(self, theEvent, varargin) % %% presto/domouse -- Process "presto" mouse events. %% domouse(self, 'theEvent') handles mouse events %% on behalf of self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 08:43:30. %% Updated 05-Nov-1999 08:43:30. % %persistent OLD_NAME %persistent OLD_NUMBER_TITLE %persistent OLD_POINTER %persistent SELECTION_TYPE % %switch theEvent % %% Mouse play. % %case 'windowbuttonmotionfcn' % pt = get(gca, 'CurrentPoint'); % pt = mean(pt); % NEW_NAME = ['[' num2str(pt(1)) ', ' num2str(pt(2)) ', ' num2str(pt(3)) ']']; % set(gcbf, 'Name', NEW_NAME) %case 'windowbuttondownfcn' % pt = get(gca, 'CurrentPoint'); % pt = mean(pt); % SELECTION_TYPE = get(gcbf, 'SelectionType'); % NEW_NAME = ['[' num2str(pt(1)) ', ' num2str(pt(2)) ', ' num2str(pt(3)) ']']; % NEW_NUMBER_TITLE = 'off'; % NEW_POINTER = 'circle'; % OLD_NAME = get(gcbf, 'Name'); % OLD_NUMBER_TITLE = get(gcbf, 'NumberTitle'); % OLD_POINTER = get(gcbf, 'Pointer'); % set(gcbf, ... % 'WindowButtonDownFcn', '', ... % 'WindowButtonMotionFcn', ['event WindowButtonMotionFcn'], ... % 'WindowButtonUpFcn', ['event WindowButtonUpFcn'], ... % 'Name', NEW_NAME, 'NumberTitle', NEW_NUMBER_TITLE, ... % 'Pointer', NEW_POINTER); %case 'windowbuttonupfcn' % set(gcbf, ... % 'WindowButtonMotionFcn', '', ... % 'WindowButtonUpFcn', '', ... % 'WindowButtonDownFcn', ['event WindowButtonDownFcn'], ... % 'Name', OLD_NAME, 'NumberTitle', OLD_NUMBER_TITLE, ... % 'Pointer', OLD_POINTER); % OLD_NAME = []; % OLD_POINTER = []; %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "donew.m" (text)') fout = fopen('donew.m', 'w'); %function theResult = donew(self, varargin) % %% presto/donew -- Stub for "new" event. %% donew(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doopen.m" (text)') fout = fopen('doopen.m', 'w'); %function theResult = doopen(self, varargin) % %% presto/doopen -- Open a file. %% doopen(self) opens and reads the contents of self, %% a "presto" object, from theFile. If no filename %% is given, the "uigetfile" dialog is invoked. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 01-Nov-1999 12:54:50. %% Updated 01-Nov-1999 12:54:50. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theFile = '*'; %if length(varargin) > 1 & ~isequal(varargin{1}, 'open') % theFile = varargin{1}; %else % theFile = getfile(self); %end % %try % load(theFile) % self = setps(self, 'itsSavedFile', theFile); %catch % errormsg(self) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "dopagesetup.m" (text)') fout = fopen('dopagesetup.m', 'w'); %function theResult = dopagesetup(self, varargin) % %% presto/dopagesetup -- Stub for "pagesetup" event. %% dopagesetup(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:17:00. %% Updated 02-Nov-1999 23:17:00. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %try % print -v %catch % disp(' ## ' lasterr) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "dopaste.m" (text)') fout = fopen('dopaste.m', 'w'); %function theResult = dopaste(self, varargin) % %% presto/dopaste -- Stub for "paste" event. %% dopaste(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doprint.m" (text)') fout = fopen('doprint.m', 'w'); %function theResult = doprint(self, varargin) % %% presto/doprint -- Print "presto" figure. %% doprint(self) prints the figure associated %% with self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:17:00. %% Updated 02-Nov-1999 23:17:00. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %try % eval(['print -v -noui -f' int2str(gcbf)]) %catch % disp([' ## ' lasterr]) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doquit.m" (text)') fout = fopen('doquit.m', 'w'); %function theResult = doquit(self, varargin) % %% presto/doquit -- Quit a "proxy" process. %% doquit(self) deletes the handle associated %% with self, a "presto" object, then returns %% the empty-matrix []. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %delete(gcbf) % %if nargout > 0 % theResult = []; %end fclose(fout); disp(' ## Installing: "dorevert.m" (text)') fout = fopen('dorevert.m', 'w'); %function theResult = dorevert(self, varargin) % %% presto/dorevert -- Revert to saved file. %% dorevert(self) reverts to the saved file %% to reset the contents of self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:17:00. %% Updated 02-Nov-1999 23:17:00. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theFile = ''; %if isfield(self, 'itsSavedFile') % theFile = self.itsSavedFile; %end % %if any(theFile) % self = doopen(self, theFile); %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doroll.m" (text)') fout = fopen('doroll.m', 'w'); %function theResult = doroll(self, theEvent, theMessage) % %% presto/doroll -- Handler for "presto" scrollbars. %% doroll(self, theEvent, theMessage) rotates the view %% in keeping with the active scrollbars. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 21:34:53. %% Updated 05-Nov-1999 21:34:53. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theXLim = get(gca, 'XLim'); % bottom scrollbar. %theYLim = get(gca, 'YLim'); % right scrollbar. %theZLim = get(gca, 'ZLim'); % left scrollbar. %theCLim = get(gca, 'CLim'); % top scrollbar. % %axis tight %set(gca, 'CLimMode', 'auto') % %[theAzimuth, theElevation] = view; % %switch theEvent %case 'bottom' % theXLim = get(gca, 'XLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theXLim = theXLim + (frac - 0.5)*diff(theXLim); % theAzimuth = 360*frac - 180; %case 'right' % theYLim = get(gca, 'YLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theYLim = theYLim + (frac - 0.5)*diff(theYLim); % theElevation = 180*frac - 90; %case 'left' % theZLim = get(gca, 'ZLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theZLim = theZLim + (frac - 0.5)*diff(theZLim); %case 'top' % theCLim = get(gca, 'CLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % frac = 1 - frac; % theCLim = theCLim + (frac - 0.5)*diff(theCLim); %end % %if (0) % set(gca, 'XLim', theXLim, 'YLim', theYLim, 'ZLim', theZLim, 'CLim', theCLim) %else % theAzimuth, theElevation % view(theAzimuth, theElevation) %end % %if nargout > 0 % theResult = self; %else % assignin('caller', 'ans', self) %end fclose(fout); disp(' ## Installing: "dosave.m" (text)') fout = fopen('dosave.m', 'w'); %function theResult = dosave(self, varargin) % %% presto/dosave -- Save to a file. %% dosave(self, 'theFile') saves the contents of %% self to theFile. If no filename is given, %% the "uiputfile" dialog is invoked. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 01-Nov-1999 12:54:50. %% Updated 05-Nov-1999 09:22:44. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theFile = '*'; %if length(varargin) > 0 & ~isequal(varargin{1}, 'save') % theFile = varargin{1}; %else % theData = data(self); % if isfield(theData, 'itsSavedFile') % theFile = self.itsSavedFile; % end %end % %if any(theFile == '*') % theFile = putfile(self); %end % %try % theData = data(self); % theMessageBox = msgbox(['Saving to "' theFile '"']); % save(theFile, 'theData') % pause(1) % if ishandle(theMessageBox), delete(theMessageBox), end % self = setps(self, itsSavedFile, theFile); %catch % errormsg(self) %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "dosaveas.m" (text)') fout = fopen('dosaveas.m', 'w'); %function theResult = dosaveas(self, varargin) % %% presto/dosaveas -- Save "presto" data. %% dosaveas(self) saves the data of self, %% a "presto" object, to the chosen file. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:17:00. %% Updated 02-Nov-1999 23:17:00. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %self = dosave(self, '*'); % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doscribble.m" (text)') fout = fopen('doscribble.m', 'w'); %function theResult = doscribble(self, theEvent, varargin) % %% presto/doscribble -- Process "presto" mouse events. %% doscribble(self, 'theEvent') handles mouse events %% on behalf of self, a "presto" object. The mouse %% track is temporarily scribbled in the window. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 08:43:30. %% Updated 14-Dec-1999 16:46:14. % %persistent OLD_NAME %persistent OLD_NUMBER_TITLE %persistent OLD_POINTER %persistent SELECTION_TYPE % %switch lower(theEvent) % %% Mouse play. % %case 'windowbuttonmotionfcn' % pt = get(gca, 'CurrentPoint'); % pt = mean(pt); % NEW_NAME = ['[' num2str(pt(1)) ', ' num2str(pt(2)) ', ' num2str(pt(3)) ']']; % set(gcbf, 'Name', NEW_NAME) % h = findobj(gcbf, 'Type', 'line', 'Tag', 'presto-scribble'); % if any(h) % h = h(1); % x = get(h, 'XData'); % y = get(h, 'YData'); % x(end+1) = pt(1); % y(end+1) = pt(2); % while length(x) > 10 % x(1) = []; % y(1) = []; % end % set(h, 'XData', x, 'YData', y) % end %case 'windowbuttondownfcn' % pt = get(gca, 'CurrentPoint'); % pt = mean(pt); % SELECTION_TYPE = get(gcbf, 'SelectionType'); % NEW_NAME = ['[' num2str(pt(1)) ', ' num2str(pt(2)) ', ' num2str(pt(3)) ']']; % NEW_NUMBER_TITLE = 'off'; % NEW_POINTER = 'circle'; % OLD_NAME = get(gcbf, 'Name'); % OLD_NUMBER_TITLE = get(gcbf, 'NumberTitle'); % OLD_POINTER = get(gcbf, 'Pointer'); % set(gcbf, ... % 'WindowButtonDownFcn', '', ... % 'WindowButtonMotionFcn', ['event WindowButtonMotionFcn'], ... % 'WindowButtonUpFcn', ['event WindowButtonUpFcn'], ... % 'Name', NEW_NAME, 'NumberTitle', NEW_NUMBER_TITLE, ... % 'Pointer', NEW_POINTER); % h = line(pt(1), pt(2), 'EraseMode', 'xor', ... % 'Color', [0 0 0], ... % 'LineWidth', 3.0, ... % 'LineStyle', '--', ... % 'Tag', 'presto-scribble'); %case 'windowbuttonupfcn' % set(gcbf, ... % 'WindowButtonMotionFcn', '', ... % 'WindowButtonUpFcn', '', ... % 'WindowButtonDownFcn', ['event WindowButtonDownFcn'], ... % 'Name', OLD_NAME, 'NumberTitle', OLD_NUMBER_TITLE, ... % 'Pointer', OLD_POINTER); % OLD_NAME = []; % OLD_POINTER = []; % h = findobj(gcbf, 'Type', 'line', 'Tag', 'presto-scribble'); % if ishandle(h), delete(h), end %end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doscroll.m" (text)') fout = fopen('doscroll.m', 'w'); %function theResult = doscroll(self, theEvent, theMessage) % %% presto/doscroll -- Handler for "presto" scrollbars. %% doscroll(self, theEvent, theMessage) pans the axes %% in keeping with the active scrollbars. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 21:34:53. %% Updated 05-Nov-1999 21:34:53. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %theXLim = get(gca, 'XLim'); % bottom scrollbar. %theYLim = get(gca, 'YLim'); % right scrollbar. %theZLim = get(gca, 'ZLim'); % left scrollbar. %theCLim = get(gca, 'CLim'); % top scrollbar. % %axis tight %set(gca, 'CLimMode', 'auto') % %switch theEvent %case 'bottom' % theXLim = get(gca, 'XLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theXLim = theXLim + (frac - 0.5)*diff(theXLim); %case 'right' % theYLim = get(gca, 'YLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theYLim = theYLim + (frac - 0.5)*diff(theYLim); %case 'left' % theZLim = get(gca, 'ZLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theZLim = theZLim + (frac - 0.5)*diff(theZLim); %case 'top' % theCLim = get(gca, 'CLim'); % smin = get(gcbo, 'Min'); % smax = get(gcbo, 'Max'); % value = get(gco, 'Value'); % frac = value / (smax - smin); % theCLim = theCLim + (frac - 0.5)*diff(theCLim); %end % %set(gca, 'XLim', theXLim, 'YLim', theYLim, 'ZLim', theZLim, 'CLim', theCLim) % %if nargout > 0 % theResult = self; %else % assignin('caller', 'ans', self) %end fclose(fout); disp(' ## Installing: "doundo.m" (text)') fout = fopen('doundo.m', 'w'); %function theResult = doundo(self, varargin) % %% presto/doundo -- Stub for "undo" event. %% doundo(self) returns self. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 02-Nov-1999 23:18:31. %% Updated 02-Nov-1999 23:18:31. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "doview.m" (text)') fout = fopen('doview.m', 'w'); %function theResult = doview(self, varargin) % %% presto/view -- Toggle between view(2) and view(3). %% view(self) toggles the view of axes associated %% with self, a "presto" object. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 10-Nov-1999 08:17:04. %% Updated 17-Nov-1999 09:05:37. % %if nargout > 0, theResult = []; end % %theMenu = gcbo; % %v = view; %if norm(diag(view)) > 1.9 % view(3) % if any(theMenu), set(gcbo, 'Checked', 'on'), end %else % view(2) % if any(theMenu), set(gcbo, 'Checked', 'off'), end %end % %if nargout > 0 % theResult = self; %else % assignin('caller', 'ans', self) %end fclose(fout); disp(' ## Installing: "errormsg.m" (text)') fout = fopen('errormsg.m', 'w'); %function theResult = errormsg(self, theMessage) % %% presto/errormsg -- Error message for "presto". %% errormsg(self, 'theMessage') posts a message-box %% with the given message (default = lasterr). % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 05-Nov-1999 09:45:13. %% Updated 05-Nov-1999 09:45:13. % %PAUSE_TIME = 3; % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end %if nargin < 2, theMessage = lasterr; end % %theMessageBox = msgbox(theMessage, 'warn'); %pause(PAUSE_TIME) %if ishandle(theMessageBox), delete(theMessageBox), end % %if nargout > 0 % theResult = self; %end fclose(fout); disp(' ## Installing: "getfile.m" (text)') fout = fopen('getfile.m', 'w'); %function theResult = getfile(self, theFileFilter, thePrompt) % %% presto/getfile -- Invoke "uigetfile". %% getfile(self, 'theFileFilter', 'thePrompt') invokes the %% "uigetfile" dialog for the given file-filter and prompt. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 01-Nov-1999 11:37:30. %% Updated 01-Nov-1999 11:37:30. % %if nargout > 0, theResult = []; end %if nargin < 1, help(mfilename), return, end %if nargin < 2, theFileFilter = '*'; end %if nargin < 3, thePrompt = 'Select Input File'; end % %[theFile, thePath] = uigetfile(theFileFilter, thePrompt); %if ~any(theFile), return, end % %if thePath(end) ~= filesep, thePath(end+1) = filesep; end %result = [thePath theFile]; % %if nargout > 0 % theResult = result; %else % assignin('caller', 'ans', result) % disp(result) %end fclose(fout); disp(' ## Installing: "help_controls.m copy" (binary)') fout = fopen('help_controls.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f636f6e74726f6c732873656c662c20766172617267696e29 %?0d0d2520202020546865202270726573746f2f636f6e74726f %?6c22206d6574686f64206164647320636f6e74726f6c732074 %?6f207468650d252070726573746f222077696e646f772e2020 %?5374616e64617264207363726f6c6c62617273206172652069 %?6e646963617465640d2520627920746865206e616d65733a20 %?27626f74746f6d272c20277269676874272c2027746f702c27 %?206f7220276c656674272e0d25204f7468657220636f6e7472 %?6f6c73206172652064656e6f74656420627920746865697220 %?225374796c65222070726f70657274792c0d2520617320696e %?202770757368627574746f6e272e0d25202020204561636820 %?636f6e74726f6c207265717569726573206120226c61796f75 %?74222c20636f6e73697374696e67206f6620610d25206e6f72 %?6d616c697a65642d706f736974696f6e20616e642061207069 %?78656c2d6f66667365742e202054686520226c61796f757422 %?0d2520696e666f726d6174696f6e2069732075736564206279 %?202270726573746f2f646f726573697a652220746f2061646a %?7573740d25206561636820636f6e74726f6c207768656e6576 %?6572207468652077696e646f7720697320726573697a65642e %?0d2520202020546865202270726573746f2f636f6e74726f6c %?22206d6574686f642072657475726e73207468652068616e64 %?6c65206f660d2520746865206e657720636f6e74726f6c2c20 %?736f2074686174206675727468657220656d62656c6c697368 %?6d656e74732063616e0d25206265206d6164652e0d25202020 %?20536565202268656c702070726573746f2f636f6e74726f6c %?222e0d200d2520436f70797269676874202843292031393939 %?2044722e20436861726c657320522e2044656e68616d2c205a %?594445434f2e0d252020416c6c205269676874732052657365 %?727665642e0d25202020446973636c6f737572652077697468 %?6f7574206578706c69636974207772697474656e20636f6e73 %?656e742066726f6d207468650d2520202020636f7079726967 %?6874206f776e657220646f6573206e6f7420636f6e73746974 %?757465207075626c69636174696f6e2e0d200d252056657273 %?696f6e206f662030342d4e6f762d313939392031343a34313a %?33342e0d2520557064617465642020202030342d4e6f762d31 %?3939392031343a35343a30322e0d0d68203d2068656c70286d %?66696c656e616d65293b0d68656c70646c6728682c20275072 %?6573746f20436f6e74726f6c7327290d0d6966206e6172676f %?7574203e20302c20746865526573756c74203d2073656c663b %?20656e640d fclose(fout); disp(' ## Installing: "help_events.m copy" (binary)') fout = fopen('help_events.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f6576656e74732873656c662c20766172617267696e290d0d %?25202020205768656e657665722061206d6f75736520657665 %?6e74206f6363757273206f6e2061202270726573746f22206f %?626a6563742c0d2520612063616c6c6261636b207265616469 %?6e6720226576656e74207468654576656e744e616d65222069 %?732065786563757465642c0d25207768657265207468654576 %?656e744e616d652077696c6c20626520736f6d657468696e67 %?206c696b652022427574746f6e446f776e46636e222e0d2520 %?546865202270726573746f2f6576656e7422206d6574686f64 %?20697320726573706f6e7369626c6520666f72207472616e73 %?6c6174696e670d2520746865206576656e7420696e746f2061 %?6e20616374696f6e2e20204576656e74732066726f6d20636f %?6e74726f6c7320616e64206d656e75730d252061726520636f %?6e76657274656420746f20746865206e616d65206f66207468 %?652063616c6c6261636b2d6f626a6563742e2020416c6c0d25 %?206576656e747320617265207468656e20636f6e7665727465 %?6420746f206c6f7765722d636173652c206465626c616e6b65 %?642c20616e640d25207472696d6d656420746f20636f6e7369 %?7374206f6e6c79206f6620616c7068616e756d657269632063 %?6861726163746572732e20205468650d2520726573756c7420 %?697320676976656e20746f2061202773776974636822206c61 %?6464657220666f722066696e616c206469737061746368696e %?672e0d25202020205768656e2061206e657720636c61737320 %?697320646572697665642066726f6d202270726573746f222c %?206974206d7573740d2520737570706c7920616e2022657665 %?6e7422206d6574686f64206f6620697473206f776e20746f20 %?6f76657272696465207468650d252064656661756c74202270 %?726573746f22206265686176696f722c20617320617070726f %?7072696174652e2020546f20696e766f6b650d252074686520 %?64656661756c74206265686176696f7220696e206120706172 %?746963756c617220736974756174696f6e2c2063616c6c0d25 %?2022696e68657269742873656c662c20277468654576656e74 %?4e616d652729222e0d2520202020536565202270726573746f %?2f6576656e74222e0d200d2520436f70797269676874202843 %?2920313939392044722e20436861726c657320522e2044656e %?68616d2c205a594445434f2e0d252020416c6c205269676874 %?732052657365727665642e0d25202020446973636c6f737572 %?6520776974686f7574206578706c6963697420777269747465 %?6e20636f6e73656e742066726f6d207468650d252020202063 %?6f70797269676874206f776e657220646f6573206e6f742063 %?6f6e73746974757465207075626c69636174696f6e2e0d200d %?252056657273696f6e206f662030342d4e6f762d3139393920 %?31343a34313a33342e0d252055706461746564202020203034 %?2d4e6f762d313939392031343a35343a30322e0d0d68203d20 %?68656c70286d66696c656e616d65293b0d68656c70646c6728 %?682c202750726573746f204576656e747327290d0d6966206e %?6172676f7574203e20302c20746865526573756c74203d2073 %?656c663b20656e640d fclose(fout); disp(' ## Installing: "help_handlers.m copy" (binary)') fout = fopen('help_handlers.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f68616e646c6572732873656c662c20766172617267696e29 %?0d0d25202020204576656e742d68616e646c65727320617265 %?20726567697374657265642077697468202270726573746f22 %?207573696e67207468650d25202268616e646c657222206d65 %?74686f642c2077686963682072657175697265732074686520 %?6e616d65206f6620616e206576656e742c0d25207375636820 %?617320275072696e74272c20616e6420746865206e616d6520 %?6f662074686520636f72726573706f6e64696e67206d657468 %?6f640d2520746861742077696c6c2068616e646c6520746865 %?206576656e742c20737563682061732027646f7072696e7427 %?2e2020416e79206e756d6265720d25206f66206576656e742f %?68616e646c65722070616972732063616e20626520706c6163 %?656420696e2074686520617267756d656e74206c6973742c0d %?2520617320696e202273656c66203d2068616e646c65722873 %?656c662c207468654576656e742c2074686548616e646c6572 %?2c202e2e2e29222e0d252020202048616e646c657273206172 %?6520616c776179732063616c6c656420776974682074687265 %?6520696e70757420617267756d656e74732c0d252061732069 %?6e202273656c66203d20646f7072696e742873656c662c2074 %?68654576656e742c207468654d65737361676529222e0d2520 %?202020536565202270726573746f2f68616e646c6572222e0d %?200d2520436f70797269676874202843292031393939204472 %?2e20436861726c657320522e2044656e68616d2c205a594445 %?434f2e0d252020416c6c205269676874732052657365727665 %?642e0d25202020446973636c6f7375726520776974686f7574 %?206578706c69636974207772697474656e20636f6e73656e74 %?2066726f6d207468650d2520202020636f7079726967687420 %?6f776e657220646f6573206e6f7420636f6e73746974757465 %?207075626c69636174696f6e2e0d200d252056657273696f6e %?206f662030342d4e6f762d313939392031343a34313a33342e %?0d2520557064617465642020202030352d4e6f762d31393939 %?2032303a30383a35302e0d0d68203d2068656c70286d66696c %?656e616d65293b0d68656c70646c6728682c20275072657374 %?6f2048616e646c65727327290d0d6966206e6172676f757420 %?3e20302c20746865526573756c74203d2073656c663b20656e %?640d fclose(fout); disp(' ## Installing: "help_menus.m copy" (binary)') fout = fopen('help_menus.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f6d656e75732873656c662c20766172617267696e290d0d25 %?20202020546865202270726573746f2f6d656e7522206d6574 %?686f642061646473206d656e757320746f2074686520507265 %?73746f0d25206d656e756261722c207573696e672061206365 %?6c6c2d6172726179206f66207468652064657369726564206d %?656e75206c6162656c732c0d2520617272616e67656420696e %?20746f702d646f776e2066617368696f6e2e20205072657065 %?6e64656420746f2065616368206c6162656c0d25206973206f %?6e6520223e2220666f7220656163682073746167652062656c %?6f772074686520746f702d6c6576656c206d656e752e0d2520 %?466f72206120736570617261746f722d6c696e652062657477 %?65656e206d656e75732c2075736520222d2220696e20706c61 %?63650d25206f66206f6e65206f662074686520223e22207379 %?6d626f6c732e0d25202020204d656e75732063616c6c202265 %?76656e742043616c6c6261636b22207768656e2073656c6563 %?7465642e2020496e736964650d25202270726573746f2f6576 %?656e74222c20746865206576656e74206973207472616e736c %?6174656420696e746f20746865206d656e750d25206c616265 %?6c206f662074686520696e7374696761746f722c207468656e %?2070726f63657373656420696e207468652022737769746368 %?220d25206c61646465722c2061732064657363726962656420 %?696e20746865202248656c702f4576656e747322206d656e75 %?2e0d2520202020536565202268656c702070726573746f2f6d %?656e75222e0d200d2520436f70797269676874202843292031 %?3939392044722e20436861726c657320522e2044656e68616d %?2c205a594445434f2e0d252020416c6c205269676874732052 %?657365727665642e0d25202020446973636c6f737572652077 %?6974686f7574206578706c69636974207772697474656e2063 %?6f6e73656e742066726f6d207468650d2520202020636f7079 %?7269676874206f776e657220646f6573206e6f7420636f6e73 %?746974757465207075626c69636174696f6e2e0d200d252056 %?657273696f6e206f662030342d4e6f762d313939392031343a %?34313a33342e0d2520557064617465642020202030342d4e6f %?762d313939392031343a35343a30322e0d0d68203d2068656c %?70286d66696c656e616d65293b0d68656c70646c6728682c20 %?2750726573746f204d656e757327290d0d6966206e6172676f %?7574203c20312c20746865526573756c74203d2073656c663b %?20656e640d fclose(fout); disp(' ## Installing: "help_subclassing.m copy" (binary)') fout = fopen('help_subclassing.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f737562636c617373696e672873656c662c20766172617267 %?696e290d0d25202020205573657273206f662050726573746f %?2061726520657870656374656420746f206465726976652074 %?68656972206f776e20636c6173730d252066726f6d20227072 %?6573746f222e2020204f6e65207375636820636c6173732c20 %?22707374222068617320616c7265616479206265656e0d2520 %?6275696c7420617320616e206578616d706c652e2020497420 %?63616e20626520636f7069656420616e642072656e616d6564 %?20746f2073657276650d252061732061206672616d65776f72 %?6b20666f7220746865206465726976656420636c6173732e20 %?20556e6c65737320227073742f6576656e74220d2520697320 %?6d6f6469666965642c20616c6c206576656e74732077696c6c %?2070617373656420696e7461637420746f202270726573746f %?222e0d2520202020536565202268656c7020707374222e0d20 %?0d2520436f707972696768742028432920313939392044722e %?20436861726c657320522e2044656e68616d2c205a59444543 %?4f2e0d252020416c6c20526967687473205265736572766564 %?2e0d25202020446973636c6f7375726520776974686f757420 %?6578706c69636974207772697474656e20636f6e73656e7420 %?66726f6d207468650d2520202020636f70797269676874206f %?776e657220646f6573206e6f7420636f6e7374697475746520 %?7075626c69636174696f6e2e0d200d252056657273696f6e20 %?6f662030352d4e6f762d313939392032303a34363a33352e0d %?2520557064617465642020202030352d4e6f762d3139393920 %?32303a34363a33352e0d0d68203d2068656c70286d66696c65 %?6e616d65293b0d68656c70646c6728682c202750726573746f %?20537562636c617373696e6727290d0d6966206e6172676f75 %?74203e20302c20746865526573756c74203d2073656c663b20 %?656e640d fclose(fout); disp(' ## Installing: "help_version.m copy" (binary)') fout = fopen('help_version.m copy', 'w'); %?66756e6374696f6e20746865526573756c74203d2068656c70 %?5f76657273696f6e2873656c662c20766172617267696e290d %?0d252070726573746f2f68656c705f76657273696f6e2d2d20 %?53686f77202270726573746f222076657273696f6e2e0d2520 %?2068656c705f76657273696f6e2873656c66292073686f7773 %?207468652076657273696f6e206f66202770726573746f220d %?2520202063757272656e746c79206163746976652e0d200d25 %?20436f707972696768742028432920313939392044722e2043 %?6861726c657320522e2044656e68616d2c205a594445434f2e %?0d252020416c6c205269676874732052657365727665642e0d %?25202020446973636c6f7375726520776974686f7574206578 %?706c69636974207772697474656e20636f6e73656e74206672 %?6f6d207468650d2520202020636f70797269676874206f776e %?657220646f6573206e6f7420636f6e73746974757465207075 %?626c69636174696f6e2e0d200d252056657273696f6e206f66 %?2030342d4e6f762d313939392031353a31373a32392e0d2520 %?557064617465642020202030342d4e6f762d31393939203135 %?3a31373a32392e0d0d68203d2068656c70282770726573746f %?2f76657273696f6e27293b0d68656c70646c6728682c202750 %?726573746f2056657273696f6e27290d0d6966206e6172676f %?7574203c20312c20746865526573756c74203d2073656c663b %?20656e640d fclose(fout); disp(' ## Installing: "presto.m" (text)') fout = fopen('presto.m', 'w'); %function theResult = presto % %% presto/presto -- Constructor for "presto" class. %% presto(theHandle) attaches a new "presto" object %% to theHandle, which defaults to a new figure. %% However, if theHandle already has a "presto" %% object, that object is simply returned and %% no new object is created. %% presto(theHandle) returns the "presto" object %% already associated with theHandle. %% presto(thePresto) updates the "presto" object %% by writing thePresto to its associated handle. %% %% Synopsis of Presto %% %% Presto is a class for managing events generated %% by graphical objects. Each "presto" object is attached %% to a Matlab handle. The properties of the object and %% of its handle are manipulated in the same manner, using %% "dot" syntax. This allows the user to define arbitrary %% properties in the object, as well as to manipulate the %% graphical properties of the associated handle easily. %% Subscripting can be nested, which makes the "presto" %% syntax more versatile than that used for the Matlab %% "set" and "get" commands. %% %% Presto preserves any existing "UserData" and allows %% it to be manipulated via self.UserData. Special handling %% takes place where "UserData" are concerned, because the %% "presto" object is stored there. Any existing "UserData" %% is preserved and can even be manipulated as "self.UserData". %% When the "presto" object is disconnected via its "detach" %% method, the "UserData" are copied back into the handle. %% %% Graphical events are expected to call "event" with %% the name of the particular callback. The "presto/enable" %% method is useful for automatically enabling all possible %% callbacks associated with the handle. In the case of a %% figure, for example, this would include menus, uicontrols, %% axes, and all other interactive graphical types. %% %% The users "event" method is responsible for performing %% all processing associated with a particular event. The %% "presto" base-class pays attention only to a "quit" event, %% due to a "Quit" menu-item, or to clicking in the go-away box. %% Other events that are passed to the base-class are simply %% displayed without further action. %% %% Uses can invoke the "inherit" command to pass events %% to the base-class; its syntax is similar to "feval". %% %% Most activities can be handled by a single "presto" %% object attached to a figure. Some situations may warrant %% other arrangements, however. For example, the resizing %% of a window can generate disarray amongst the controls, %% for which an automated "layout" scheme may be needed. %% It would make sense to create a "layout" object for %% each control, whose sole method would be "resize", %% to be called by the figure whenever it noticed a %% "ResizeFcn" event. %% %% Presto reacts to the following events, %% which the derived class should trap as needed: %% %% new, open, close, save, saveas, %% revert, pagesetup, print, quit, %% undo, cut, copy, paste, clear %% windowbuttondownfcn, windowbuttonmotionfcn, windowbuttonupfcn, %% resizefcn, buttondownfcn, callback %% closerequestfcn, deletefcn % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure without explicit written consent from the %% copyright owner does not constitute publication. % %% Version of 27-Oct-1999 23:08:50. %% Updated 05-Nov-1999 20:52:48. % %theFigure = figure('Name', 'Presto Demo', 'MenuBar', 'none'); %theStruct.ignore = []; %self = class(theStruct, 'presto', ps(theFigure)); %psbind(self) % %theMenus = { ... % '<Presto Demo>', ... % '>File', '>>MenuBar', '->Quit', ... % '>Help', '>>Controls', '>>Events', ... % '>>Handlers', '>>Menus', '>>Subclassing', ... % '->Version', ... %}; % %menu(self, theMenus) % %h = control(self, 'bottom'); %set(h, 'Min', 0, 'Max', 1, 'Value', 0.5); %h = control(self, 'right'); %set(h, 'Min', 0, 'Max', 1, 'Value', 0.5); %h = control(self, 'left'); %set(h, 'Min', 0, 'Max', 1, 'Value', 0.5); %h = control(self, 'top'); %set(h, 'Min', 0, 'Max', 1, 'Value', 0.5); % %enable(self); % %theEventHandlers = { ... % 'WindowButtonMotionFcn', 'doscribble', ... % 'WindowButtonDownFcn', 'doscribble', ... % 'WindowButtonUpFcn', 'doscribble', ... % 'ResizeFcn', 'doresize', ... % 'bottom', 'doroll', ... % 'right', 'doroll', ... % 'left', 'doroll', ... % 'top', 'doroll', ... % 'menubar', 'domenubar', ... % 'controls', 'help_controls', ... % 'events', 'help_events', ... % 'handlers', 'help_handlers', ... % 'menus', 'help_menus', ... % 'subclassing', 'help_subclassing', ... % 'version', 'help_version', ... % 'quit', 'doquit', ... % 'CloseRequestFcn', 'doquit', ... %}; % %handler(self, theEventHandlers{:}); % %n = 36; %n = n + rem(n, 4); %[x, y, z] = sphere(n); %x([1 end], :) = []; y([1 end], :) = []; z([1 end], :) = []; %c = 1 + 0.1*rand(size(x)); %c = zeros(size(x)); %c(:, 1:n/4) = 1; %c(:, n/2+1:n/2+n/4) = 1; %c(:, end) = c(:, 1); %surface(x, y, z, c) %xlabel x, ylabel y, zlabel z %set(gca, 'Color', get(gcf, 'Color')) %set(gca, 'Visible', 'off') %view(0, 0) %axis equal %disp(' ## Click and move mouse in "presto" window.') %if nargout > 0 % theResult = self; %else % assignin('caller', 'ans', self) %end % %% Get the "presto" object from an existing handle. % %if nargin > 0 % if ishandle(theHandle) % self = ps(theHandle); % if isps % if nargout > 0 % theResult = self; % else % assignin('caller', 'ans', self) % disp(self) % end % return % end % elseif isps(theHandle, 'ps') % self = theHandle; % if nargout > 0 % theResult = self; % else % assignin('caller', 'ans', self) % disp(self) % end % return % end %end % %if nargout > 0 % theResult = self; %else % assignin('caller', 'ans', self) %end fclose(fout); disp(' ## Installing: "putfile.m" (text)') fout = fopen('putfile.m', 'w'); %function theResult = putfile(self, theFileFilter, thePrompt) % %% presto/putfile -- Invoke "uiputfile". %% putfile(self, 'theSuggested', thePrompt) invokes the %% "uiputfile" dialog for the given suggested filename %% and prompt. % %% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO. %% All Rights Reserved. %% Disclosure

Large files files are truncated, but you can click here to view the full file