comparison scripts/plot/uiputfile.m @ 11583:c4c2cd67c440

Fixes for ui file functions, bug#32190
author Kai Habel <kai.habel@gmx.de>
date Thu, 20 Jan 2011 20:31:30 +0100
parents 8ac9687dbe9f
children c792872f8942
comparison
equal deleted inserted replaced
11582:21dec063e89f 11583:c4c2cd67c440
53 53
54 ## Author: Kai Habel 54 ## Author: Kai Habel
55 55
56 function [retfile, retpath, retindex] = uiputfile (varargin) 56 function [retfile, retpath, retindex] = uiputfile (varargin)
57 57
58
59 if (nargin <= 3) 58 if (nargin <= 3)
60 59
61 defaultvals = {"All Files(*)", #FLTK File Filter 60 defaultvals = {"All Files(*)", #FLTK File Filter
62 "Save File?", #Dialog Title 61 "Save File?", #Dialog Title
63 pwd, #FLTK default file name 62 pwd, #FLTK default file name
74 outargs{1} = __fltk_file_filter__ (file_filter); 73 outargs{1} = __fltk_file_filter__ (file_filter);
75 if (ischar (file_filter)) 74 if (ischar (file_filter))
76 outargs{3} = file_filter; 75 outargs{3} = file_filter;
77 endif 76 endif
78 endif 77 endif
79 78
80 if (nargin > 1) 79 if (nargin > 1)
81 outargs{2} = varargin{2}; 80 outargs{2} = varargin{2};
82 endif 81 endif
83 82
84 if (nargin > 2) 83 if (nargin > 2)
88 else 87 else
89 error ("uiputfile: number of input arguments must be less than four."); 88 error ("uiputfile: number of input arguments must be less than four.");
90 endif 89 endif
91 90
92 if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ()))) 91 if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ())))
93 [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); 92 [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:});
94 else 93 else
95 error ("uiputfile: fltk graphics toolkit required"); 94 error ("uiputfile: fltk graphics toolkit required");
96 endif 95 endif
97 96
98 endfunction 97 endfunction
99 98
100 %!demo 99 %!demo
101 %! uiputfile({"*.gif;*.png;*.jpg", "Supported Picture Formats"}) 100 %! uiputfile({"*.gif;*.png;*.jpg", "Supported Picture Formats"})