2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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 2, or (at your option) |
|
8 ## 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, write to the Free |
|
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, USA. |
1540
|
19 |
3368
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} plot_border (...) |
2311
|
22 ## Multiple arguments allowed to specify the sides on which the border |
3368
|
23 ## is shown. Allowed arguments include: |
3426
|
24 ## |
3368
|
25 ## @table @code |
|
26 ## @item "blank" |
|
27 ## No borders displayed. |
3426
|
28 ## |
3368
|
29 ## @item "all" |
|
30 ## All borders displayed |
3426
|
31 ## |
3368
|
32 ## @item "north" |
|
33 ## North Border |
3426
|
34 ## |
3368
|
35 ## @item "south" |
|
36 ## South Border |
3426
|
37 ## |
3368
|
38 ## @item "east" |
|
39 ## East Border |
3426
|
40 ## |
3368
|
41 ## @item "west" |
|
42 ## West Border |
|
43 ## @end table |
3426
|
44 ## |
3368
|
45 ## @noindent |
|
46 ## The arguments may be abbreviated to single characters. Without any |
|
47 ## arguments, @code{plot_border} turns borders off. |
|
48 ## @end deftypefn |
1540
|
49 |
2312
|
50 ## Author: Vinayak Dutt <Dutt.Vinayak@mayo.EDU> |
|
51 ## Created: 3 July 95 |
|
52 ## Adapted-By: jwe |
1540
|
53 |
3979
|
54 function plot_border (varargin) |
1540
|
55 |
|
56 south = 0; |
|
57 west = 0; |
|
58 north = 0; |
|
59 east = 0; |
|
60 all = 0; |
|
61 none = 1; |
|
62 |
3979
|
63 k = 1; |
1540
|
64 |
|
65 while (nargin--) |
|
66 |
3979
|
67 arg = varargin{k++}; |
1540
|
68 |
|
69 if (! isstr (arg)) |
|
70 error ("plot_border: input not a string"); |
|
71 endif |
|
72 |
2303
|
73 ## The effect of the arguments in cumulative. If something is found |
|
74 ## after "b", do that and ignore "b". |
1540
|
75 |
|
76 if (strcmp (arg, "blank") || strcmp (arg, "BLANK") |
|
77 || strcmp (arg, "b") || strcmp (arg, "B")) |
|
78 none = 1; |
|
79 else |
|
80 none = 0; |
|
81 if (strcmp (arg, "south") || strcmp (arg, "SOUTH") |
3426
|
82 || strcmp (arg, "s") || strcmp (arg, "S")) |
|
83 south = 1; |
1540
|
84 elseif (strcmp (arg, "west") || strcmp (arg, "WEST") |
3426
|
85 || strcmp (arg, "w") || strcmp (arg, "W")) |
|
86 west = 2; |
1540
|
87 elseif (strcmp (arg, "north") || strcmp (arg, "NORTH") |
3426
|
88 || strcmp (arg, "n") || strcmp (arg, "N")) |
|
89 north = 4; |
1540
|
90 elseif (strcmp (arg, "east") || strcmp (arg, "EAST") |
3426
|
91 || strcmp (arg, "e") || strcmp (arg, "E")) |
|
92 east = 8; |
1540
|
93 elseif (strcmp (arg, "all") || strcmp (arg, "ALL") |
3426
|
94 || strcmp (arg, "a") || strcmp (arg, "A")) |
|
95 all = 1; |
1540
|
96 endif |
|
97 endif |
|
98 endwhile |
|
99 |
|
100 if (none) |
2520
|
101 gset noborder; |
1540
|
102 else |
|
103 if (all) |
|
104 border = 15; |
|
105 else |
|
106 border = south + west + north + east; |
|
107 endif |
2520
|
108 eval (sprintf ("gset border %d", border)); |
1540
|
109 endif |
|
110 |
|
111 endfunction |