1 |
% |
---|
2 |
% EditLine Edit figure lines |
---|
3 |
% |
---|
4 |
% This is a callback function, used by OPNML-FEDAR MenuBar and |
---|
5 |
% OPNML Prmenu. This function should not be called directly! |
---|
6 |
% |
---|
7 |
% Original code from Keith Rogers 11/94 |
---|
8 |
% |
---|
9 |
% Mods: |
---|
10 |
% 12/02/94 Shortened name to appease DOS users |
---|
11 |
% 12/5/94 Adapted to deal with single palette for all |
---|
12 |
% figures,changed name to lower case to |
---|
13 |
% appease VMS users. |
---|
14 |
% 12/14/94 Add Delete item callback |
---|
15 |
% 12/15/94 Fixed bugs. |
---|
16 |
% 12/20/94 When deleting an object, delete its |
---|
17 |
% SelectLine as well. |
---|
18 |
% |
---|
19 |
% Mar 95 - Minor Mods by Brian Blanton for OPNML, including name |
---|
20 |
% change from 'dmencback' |
---|
21 |
% Apr 95 - Mods by Sara Haines |
---|
22 |
% o Know about globals LASTOBJECT and LASTTYPE |
---|
23 |
% o change name again |
---|
24 |
% o more object type checking, ii.e. for gridlinestyles |
---|
25 |
% |
---|
26 |
% Aug 95 - Mods by Sara Haines |
---|
27 |
% o removed color commands and options from this function |
---|
28 |
% o edit value for 'other' option on line width and marker size. |
---|
29 |
% |
---|
30 |
function EditLine(command,option,subopt) |
---|
31 |
|
---|
32 |
global LASTOBJECT LASTTYPE |
---|
33 |
|
---|
34 |
selectedObj = LASTOBJECT; |
---|
35 |
if isempty(selectedObj),return,end % exit if no selected object |
---|
36 |
type = LASTTYPE; |
---|
37 |
|
---|
38 |
if (strcmp(type, 'line') | strcmp(type, 'patch')) |
---|
39 |
style = get(selectedObj,'LineStyle'); |
---|
40 |
end |
---|
41 |
|
---|
42 |
if(command == 1) |
---|
43 |
if(strcmp(type,'line')) |
---|
44 |
set(selectedObj,'LineStyle',option); |
---|
45 |
end |
---|
46 |
|
---|
47 |
if exist('subopt') |
---|
48 |
if ( strcmp(subopt, 'Grid') | strcmp(subopt, 'MinorGrid') ) |
---|
49 |
set(selectedObj, [subopt 'LineStyle'], option) |
---|
50 |
end |
---|
51 |
end |
---|
52 |
elseif(command == 2) |
---|
53 |
if(strcmp(type,'line') | strcmp(type,'patch')) |
---|
54 |
if(option==0) |
---|
55 |
value = get(selectedObj, 'LineWidth'); |
---|
56 |
option=EditValue('EditValue', 'Line Width:', value); |
---|
57 |
end |
---|
58 |
set(selectedObj,'LineWidth',option); |
---|
59 |
end |
---|
60 |
elseif(command == 3) |
---|
61 |
set(selectedObj,'Color',option); |
---|
62 |
elseif(command == 4) |
---|
63 |
if(strcmp(type,'patch')) |
---|
64 |
set(selectedObj,'FaceColor',option); |
---|
65 |
elseif(strcmp(type,'axes')) |
---|
66 |
set(selectedObj,'Color',option); |
---|
67 |
elseif (strcmp(type, 'figure')) |
---|
68 |
set(selectedObj, 'Color', option); |
---|
69 |
end |
---|
70 |
elseif(command == 5) |
---|
71 |
if(strcmp(type,'line')) |
---|
72 |
if strcmp(style,'*') | ... |
---|
73 |
strcmp(style,'+') | ... |
---|
74 |
strcmp(style,'.') | ... |
---|
75 |
strcmp(style,'o') |
---|
76 |
if(option==0) |
---|
77 |
value = get(selectedObj, 'MarkerSize'); |
---|
78 |
option=EditValue('EditValue', 'Marker Size:', value); |
---|
79 |
% if ~isint(option),option=floor(option);,end |
---|
80 |
end |
---|
81 |
set(selectedObj,'MarkerSize',option); |
---|
82 |
end |
---|
83 |
end |
---|
84 |
end |
---|
85 |
|
---|