annotate scripts/gui/private/__fltk_file_filter__.m @ 19903:781adfc2958c draft nkf

Build qt graphics toolkit menus with uimenu * libgui/graphics/Figure.cc, libgui/graphics/Figure.h: Revert cset 7335cc071ab0 and remove all menu items. * scripts/gui/private/__get_funcname__.m: Fix typo * scripts/plot/util/private/__add_default_menu__.m: Enable uimenu for qt graphics toolkit and fix setting pan/rotate/zoom for qt and fltk
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 18:36:05 +0100
parents 4197fc428c7d
children 64f817945783
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
1 ## Copyright (C) 2012-2015 Michael Goffioul
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
2 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
3 ## This file is part of Octave.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
4 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
8 ## your option) any later version.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
9 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
13 ## General Public License for more details.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
14 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
18
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
19 ## -*- texinfo -*-
13929
9cae456085c2 Grammarcheck of documentation before 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents: 13697
diff changeset
20 ## @deftypefn {Function File} {@var{filterspec} =} __fltk_file_filter__ (@var{filter})
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
21 ## Undocumented internal function.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
22 ## @end deftypefn
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
23
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
24 ## Author: Michael Goffioul
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
25
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
26 function retval = __fltk_file_filter__ (file_filter)
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
27
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
28 retval = "";
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
29 [r, c] = size (file_filter);
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
30 if ((c == 0) || (c > 2))
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
31 error ("expecting 1 or to 2 columns for file filter cell");
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
32 endif
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
33 fltk_str = "";
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
34 for idx = 1 : r
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
35
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
36 curr_ext = file_filter{idx, 1};
16724
b7667fcb9fbc Substitute ostrsplit() for strsplit().
Ben Abbott <bpabbott@mac.com>
parents: 16403
diff changeset
37 curr_ext = ostrsplit (curr_ext, ";");
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
38
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
39 if (length (curr_ext) > 1)
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
40 curr_ext = regexprep (curr_ext, '\*\.', ',');
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
41 curr_ext = strcat (curr_ext{:})(2 : end);
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
42 curr_ext = strcat ("*.{", curr_ext, "}");
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
43 else
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
44 curr_ext = curr_ext{:};
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
45 endif
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
46
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
47 curr_desc = strcat (curr_ext(3:end), "-Files");
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
48
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
49 if (c == 2)
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
50 curr_desc = file_filter{idx, 2};
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
51 curr_desc = regexprep (curr_desc, '\(', '<');
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
52 curr_desc = regexprep (curr_desc, '\)', '>');
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
53 endif
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
54
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
55 if (length (fltk_str) > 0)
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
56 fltk_str = strcat (fltk_str, "\t", curr_desc, " (", curr_ext, ")");
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
57 else
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
58 fltk_str = strcat (curr_desc, " (", curr_ext, ")");
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
59 endif
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
60
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
61 endfor
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
62 retval = fltk_str;
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11588
diff changeset
63
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
64 endfunction
17338
1c89599167a6 maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents: 16724
diff changeset
65