Mercurial > octave-nkf
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 |
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 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
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. | |
9 ## | |
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. | |
14 ## | |
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/>. | |
18 | |
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 | 21 ## Undocumented internal function. |
22 ## @end deftypefn | |
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 | 25 |
26 function retval = __fltk_file_filter__ (file_filter) | |
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 | 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 | 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 | 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 | 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 | 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 | 64 endfunction |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
16724
diff
changeset
|
65 |