1 ## Copyright (C) 2012 Michael Goffioul
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {@var{filterspec} =} __fltk_file_filter__ (@var{filter})
21 ## Undocumented internal function.
24 ## Author: Michael Goffioul
26 function retval = __fltk_file_filter__ (file_filter)
29 [r, c] = size (file_filter);
30 if ((c == 0) || (c > 2))
31 error ("expecting 1 or to 2 columns for file filter cell");
36 curr_ext = file_filter{idx, 1};
37 curr_ext = strsplit (curr_ext, ";");
39 if (length (curr_ext) > 1)
40 curr_ext = regexprep (curr_ext, '\*\.', ',');
41 curr_ext = strcat (curr_ext{:})(2 : end);
42 curr_ext = strcat ("*.{", curr_ext, "}");
44 curr_ext = curr_ext{:};
47 curr_desc = strcat (curr_ext(3:end), "-Files");
50 curr_desc = file_filter{idx, 2};
51 curr_desc = regexprep (curr_desc, '\(', '<');
52 curr_desc = regexprep (curr_desc, '\)', '>');
55 if (length (fltk_str) > 0)
56 fltk_str = strcat (fltk_str, "\t", curr_desc, " (", curr_ext, ")");
58 fltk_str = strcat (curr_desc, " (", curr_ext, ")");