# HG changeset patch # User Kai Habel # Date 1295551890 -3600 # Node ID c4c2cd67c4400fc1ba71968e07b40e4a22211981 # Parent 21dec063e89fcf712c3ceb7c8af7d872f9db8311 Fixes for ui file functions, bug#32190 diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2010-01-20 Petr Mikulik + + * plot/uigetdir.m: Use correct variable name for argument check. + Remove unneeded white spaces. + * plot/uigetfile.m, plot/uiputfile.m: Remove unneeded white spaces. + Bug #32190. + 2011-01-20 John W. Eaton * plot/ginput.m, plot/gnuplot_drawnow.m, plot/uiputfile.m, diff --git a/scripts/plot/uigetdir.m b/scripts/plot/uigetdir.m --- a/scripts/plot/uigetdir.m +++ b/scripts/plot/uigetdir.m @@ -33,11 +33,10 @@ print_usage (); endif - if (!ischar(init_path) || !ischar(name)) + if (!ischar(init_path) || !ischar(dialog_name)) error ("uigetdir: INIT_PATH and DIALOG_NAME must be string arguments"); endif - if (any (strcmp (available_graphics_toolkits (), "fltk"))) if (!isdir (init_path)) init_path = fileparts (init_path); @@ -49,6 +48,5 @@ endfunction - -%!demo +%!demo %! uigetdir(pwd, "Select Directory") diff --git a/scripts/plot/uigetfile.m b/scripts/plot/uigetfile.m --- a/scripts/plot/uigetfile.m +++ b/scripts/plot/uigetfile.m @@ -43,7 +43,7 @@ ## in the second column. ## Example: @code{uigetfile (@{"*.ext", "My Description";"*.xyz", ## "XYZ-Format"@})} -## +## ## The filter string can also contain a semicolon separated list of filter ## extensions. ## Example: @code{uigetfile (@{"*.gif;*.png;*.jpg", "Supported Picture @@ -57,7 +57,7 @@ ## The screen position of the GUI dialog can be set using the "Position" key ## and a 2-element vector containing the pixel coordinates. ## Two or more files can be selected when setting the "Multiselect" key to "on". -## In that case @var{fname} is a cell array containing the files. +## In that case @var{fname} is a cell array containing the files. ## @end deftypefn ## Author: Kai Habel @@ -129,7 +129,7 @@ for i = stridx : 2 : nargin prop = varargin{i}; val = varargin{i + 1}; - if (strncmp (tolower (prop), "position", 8)) + if (strncmp (tolower (prop), "position", 8)) if (ismatrix (val) && length(val) == 2) outargs{4} = val; else @@ -151,12 +151,11 @@ endif if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ()))) - [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); + [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); else error ("uigetfile: fltk graphics toolkit required."); endif - endfunction %!demo diff --git a/scripts/plot/uiputfile.m b/scripts/plot/uiputfile.m --- a/scripts/plot/uiputfile.m +++ b/scripts/plot/uiputfile.m @@ -55,7 +55,6 @@ function [retfile, retpath, retindex] = uiputfile (varargin) - if (nargin <= 3) defaultvals = {"All Files(*)", #FLTK File Filter @@ -76,7 +75,7 @@ outargs{3} = file_filter; endif endif - + if (nargin > 1) outargs{2} = varargin{2}; endif @@ -90,12 +89,12 @@ endif if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ()))) - [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); + [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); else error ("uiputfile: fltk graphics toolkit required"); endif endfunction -%!demo +%!demo %! uiputfile({"*.gif;*.png;*.jpg", "Supported Picture Formats"}) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-01-20 Kai Habel + + * DLD-FUNCTIONS/__init_fltk__.cc (__fltk_uigetfile__): Append file + seperator to 2nd return value (file path). + Bug #32190. + 2011-01-20 John W. Eaton * oct-obj.h (octave_value_list::octave_value_list): Initialize diff --git a/src/DLD-FUNCTIONS/__init_fltk__.cc b/src/DLD-FUNCTIONS/__init_fltk__.cc --- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -2113,7 +2113,7 @@ retval(0) = std::string(fc->value ()); else { - retval(1) = std::string(fc->directory ()); + retval(1) = std::string(fc->directory ()) + sep; retval(2) = fc->filter_value(); } }