Mercurial > hg > octave-nkf
annotate scripts/gui/private/__get_funcname__.m @ 20076:781adfc2958c draft obsolete 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 | 9fc020886ae9 |
children | 777f26aa8e3e |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19163
diff
changeset
|
1 ## Copyright (C) 2014-2015 Andreas Weber |
19163
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
2 ## |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
4 ## |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
8 ## your option) any later version. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
9 ## |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
13 ## General Public License for more details. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
14 ## |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
18 |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
20 ## @deftypefn {Function File} {@var{funcname} =} __get_funcname__ (@var{basename}) |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
21 ## Internal function. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
22 ## |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
23 ## Build function name for the current graphics toolkit according to schema |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
24 ## __[basename]_[graphics_toolkit]__, use fltk as default. |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
25 ## @end deftypefn |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
26 |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
27 ## Author: Andreas Weber |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
28 |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
29 function funcname = __get_funcname__ (basename) |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
30 |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
31 if (! __octave_link_enabled__ ()) |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
32 tk = graphics_toolkit (); |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
33 funcname = strcat ("__", basename, "_", tk, "__"); |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
34 if (numel (tk) > 0 && ! strcmp (tk, "fltk") |
20076
781adfc2958c
Build qt graphics toolkit menus with uimenu
Stefan Mahr <dac922@gmx.de>
parents:
20038
diff
changeset
|
35 && ! __is_function__ (funcname)) |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
36 warning ("%s: no implementation for toolkit '%s', using 'fltk' instead", |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
37 basename, tk); |
19163
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
38 endif |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
39 funcname = strcat ("__", basename, "_fltk__"); |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
40 else |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
41 funcname = ""; |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
42 endif |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
43 |
f084aab05cd9
Move checks for graphics_toolkit GUI functions to own script.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff
changeset
|
44 endfunction |