1 |
% |
---|
2 |
% PRMENU set up selection menus at top of current figure (window) |
---|
3 |
% |
---|
4 |
% Parts of PRMENU employ routines written by Keith Rogers for |
---|
5 |
% his MATLAB suite MATDRAW; 'Text', and 'Draw' Menus and SubMenus, |
---|
6 |
% as well as his PageSetup, which has been renamed PrintSetup. |
---|
7 |
% |
---|
8 |
% Call as: Prmenu |
---|
9 |
% |
---|
10 |
% Brian O. Blanton |
---|
11 |
% Curriculum in Marine Science |
---|
12 |
% Ocean Processes Numerical Modeling Laboratory |
---|
13 |
% 15-1A Venable Hall |
---|
14 |
% CB# 3300 |
---|
15 |
% Uni. of North Carolina |
---|
16 |
% Chapel Hill, NC |
---|
17 |
% 27599-3300 |
---|
18 |
% |
---|
19 |
% 919-962-4466 |
---|
20 |
% blanton@marine.unc.edu |
---|
21 |
% |
---|
22 |
% Winter 1994 |
---|
23 |
% |
---|
24 |
|
---|
25 |
% 'BackGr' is an abbreviation for 'BackGroundColor' |
---|
26 |
% 'ForeGr' is an abbreviation for 'ForeGroundColor' |
---|
27 |
function Prmenu(opt,subopt) |
---|
28 |
|
---|
29 |
global LASTOBJECT LASTTYPE |
---|
30 |
|
---|
31 |
if nargin==0 % Set up menu bar |
---|
32 |
% See if another Prmenu exists in Current figure; return if so |
---|
33 |
Prmenu=findobj(gcf,'Type','uimenu','Tag','Prmenu'); |
---|
34 |
if ~isempty(Prmenu),return,end |
---|
35 |
|
---|
36 |
% initialize globals used to keep to track of last touched object |
---|
37 |
lastouch |
---|
38 |
|
---|
39 |
set(gcf, 'WindowButtonDownFcn', 'lastouch', ... |
---|
40 |
'WindowButtonUpFcn', '', ... |
---|
41 |
'WindowButtonMotionFcn', ''); |
---|
42 |
|
---|
43 |
% always set paper position to full page size |
---|
44 |
% set(gcf, 'PaperPosition', [0 0 get(gcf, 'PaperSize')]); |
---|
45 |
|
---|
46 |
al=uimenu('Label','Axis','BackGr','g','ForeGr','k','Tag','Prmenu'); |
---|
47 |
|
---|
48 |
al1=uimenu(al,'Label','Axis',... |
---|
49 |
'BackGr','g',... |
---|
50 |
'ForeGr','k',... |
---|
51 |
'Tag','PrAxis'); |
---|
52 |
|
---|
53 |
uimenu(al1,'Label','Equal',... |
---|
54 |
'Callback','EditAxis(''axis'',''equal'')',... |
---|
55 |
'BackGr','g','ForeGr','k','Tag','PrAxisEq'); |
---|
56 |
uimenu(al1,'Label','Square',... |
---|
57 |
'Callback','EditAxis(''axis'',''square'')',... |
---|
58 |
'BackGr','g','ForeGr','k','Tag','PrAxisSq'); |
---|
59 |
uimenu(al1,'Label','Normal',... |
---|
60 |
'Callback','EditAxis(''axis'',''normal'')',... |
---|
61 |
'BackGr','g','ForeGr','k','Tag','PrAxisNo'); |
---|
62 |
uimenu(al1,'Label','Auto',... |
---|
63 |
'Callback','EditAxis(''axis'',''auto'')',... |
---|
64 |
'BackGr','g','ForeGr','k','Tag','PrAxisAu'); |
---|
65 |
uimenu(al1,'Label','Image',... |
---|
66 |
'Callback','EditAxis(''axis'',''image'')',... |
---|
67 |
'BackGr','g','ForeGr','k','Tag','PrAxisIm'); |
---|
68 |
% uimenu(al1,'Label','Axis (on/off)',... |
---|
69 |
% 'Callback','EditAxis(''axis'',''on'')',... |
---|
70 |
% 'BackGr','g','ForeGr','k','Tag','PrAxisOnOff'); |
---|
71 |
|
---|
72 |
al2=uimenu(al,'Label','Scale',... |
---|
73 |
'BackGr','g',... |
---|
74 |
'ForeGr','k',... |
---|
75 |
'Tag','PrScale'); |
---|
76 |
|
---|
77 |
uimenu(al2,'Label','Linear',... |
---|
78 |
'Callback','EditAxis(''scale'',''linear'')',... |
---|
79 |
'BackGr','g','ForeGr','k','Tag','PrScaleLin'); |
---|
80 |
uimenu(al2,'Label','Semi-Log X',... |
---|
81 |
'Callback','EditAxis(''scale'',''semilogx'')',... |
---|
82 |
'BackGr','g','ForeGr','k','Tag','PrScaleLogx'); |
---|
83 |
uimenu(al2,'Label','Semi-Log Y',... |
---|
84 |
'Callback','EditAxis(''scale'',''semilogy'')',... |
---|
85 |
'BackGr','g','ForeGr','k','Tag','PrScaleLogy'); |
---|
86 |
uimenu(al2,'Label','Log-Log',... |
---|
87 |
'Callback','EditAxis(''scale'',''loglog'')',... |
---|
88 |
'BackGr','g','ForeGr','k','Tag','PrScaleLogLog'); |
---|
89 |
|
---|
90 |
uimenu(al,'Label', 'Box (on/off)', .... |
---|
91 |
'Callback', 'EditAxis(''box'')',... |
---|
92 |
'BackGr','g','ForeGr','k','Tag','PrAxisBox'); |
---|
93 |
|
---|
94 |
uimenu(al,'Label','Edit Limits','Callback','EditAxis',... |
---|
95 |
'BackGr','g','ForeGr','k','Tag','ChAxis'); |
---|
96 |
uimenu(al,'Label','Edit Labels','Callback','EditLabel',... |
---|
97 |
'BackGr','g','ForeGr','k','Tag','ChLabel'); |
---|
98 |
|
---|
99 |
gl=uimenu('Label','Grid',... |
---|
100 |
'BackGr','b', 'ForeGr','w','Tag','PrGrid'); |
---|
101 |
gl1=uimenu(gl,'Label','Major',... |
---|
102 |
'BackGr','b', 'ForeGr','w','Tag','PrMajor'); |
---|
103 |
gl2=uimenu(gl,'Label','Minor',... |
---|
104 |
'BackGr','b','ForeGr','w','Tag','PrMinor'); |
---|
105 |
|
---|
106 |
uimenu(gl1, 'Label', 'Grid (on/off)', ... |
---|
107 |
'Callback', 'EditAxis(''grid'',''majgrid'')', ... |
---|
108 |
'BackGr','b', 'ForeGr','w', 'Tag', 'PrMajGrid'); |
---|
109 |
gl1s=uimenu(gl1, 'Label', 'Line Style', ... |
---|
110 |
'BackGr','b', 'ForeGr','w'); |
---|
111 |
|
---|
112 |
uimenu(gl1s,'Label','_____','Callback','gca;EditLine(1,''-'',''Grid'')',... |
---|
113 |
'BackGr','k','ForeGr','w'); |
---|
114 |
uimenu(gl1s,'Label','.....','Callback','gca;EditLine(1,'':'',''Grid'')',... |
---|
115 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
116 |
uimenu(gl1s,'Label','_ _ _','Callback','gca;EditLine(1,''--'',''Grid'')',... |
---|
117 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
118 |
uimenu(gl1s,'Label','_._._','Callback','gca;EditLine(1,''-.'',''Grid'')',... |
---|
119 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
120 |
|
---|
121 |
uimenu(gl2, 'Label', 'Grid (on/off)', ... |
---|
122 |
'Callback', 'EditAxis(''grid'',''minorgrid'')', ... |
---|
123 |
'BackGr','b', 'ForeGr','w', 'Tag', 'PrMinGrid'); |
---|
124 |
uimenu(gl2, 'Label', 'Tick (on/off)', ... |
---|
125 |
'Callback', 'EditAxis(''grid'',''minortick'')', ... |
---|
126 |
'BackGr','b', 'ForeGr','w'); |
---|
127 |
gl2s=uimenu(gl2, 'Label', 'Line Style', ... |
---|
128 |
'BackGr','b', 'ForeGr','w'); |
---|
129 |
|
---|
130 |
uimenu(gl2s,'Label','_____',... |
---|
131 |
'Callback','gca;EditLine(1,''-'',''MinorGrid'')',... |
---|
132 |
'BackGr','k','ForeGr','w'); |
---|
133 |
uimenu(gl2s,'Label','.....',... |
---|
134 |
'Callback','gca;EditLine(1,'':'',''MinorGrid'')',... |
---|
135 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
136 |
uimenu(gl2s,'Label','_ _ _',... |
---|
137 |
'Callback','gca;EditLine(1,''--'',''MinorGrid'')',... |
---|
138 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
139 |
uimenu(gl2s,'Label','_._._',... |
---|
140 |
'Callback','gca;EditLine(1,''-.'',''MinorGrid'')',... |
---|
141 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
142 |
|
---|
143 |
zl=uimenu('Label','Zoom','BackGr','g','ForeGr','k','Tag','PrZoom'); |
---|
144 |
uimenu(zl,'Label','Zoom In','Callback','Prmenu(1,1)','BackGr','g',... |
---|
145 |
'ForeGr','k','Tag','PrZoomIn'); |
---|
146 |
uimenu(zl,'Label','Zoom Out','Callback','Prmenu(1,2)','BackGr','g',... |
---|
147 |
'ForeGr','k','Tag','PrZoomOut','Enable','off'); |
---|
148 |
uimenu(zl,'Label','Zoom Off','Callback','Prmenu(1,3)','BackGr','g',... |
---|
149 |
'ForeGr','k','Tag','PrZoomOff','Enable','off'); |
---|
150 |
|
---|
151 |
pl=uimenu(zl,'Label','Pan','Callback','pan',... |
---|
152 |
'BackGr','g','ForeGr','k',... |
---|
153 |
'interruptible','no','Tag','PrPan'); |
---|
154 |
|
---|
155 |
% FONT MAIN MENU |
---|
156 |
fm = uimenu('BackGr','b',... |
---|
157 |
'Enable','on',... |
---|
158 |
'ForeGr','w',... |
---|
159 |
'Label','Text',... |
---|
160 |
'Tag','PrTextMenu',... |
---|
161 |
'Position',5); |
---|
162 |
fms1 = uimenu(fm,... |
---|
163 |
'BackGr','b',... |
---|
164 |
'Enable','on',... |
---|
165 |
'ForeGr','w',... |
---|
166 |
'Tag','PrTextFontMenu',... |
---|
167 |
'Label','Font'); |
---|
168 |
fms2 = uimenu(fm,... |
---|
169 |
'BackGr','b',... |
---|
170 |
'Enable','on',... |
---|
171 |
'ForeGr','w',... |
---|
172 |
'Tag','PrTextStyleMenu',... |
---|
173 |
'Label','Style'); |
---|
174 |
fms3 = uimenu(fm,... |
---|
175 |
'BackGr','b',... |
---|
176 |
'Enable','on',... |
---|
177 |
'ForeGr','w',... |
---|
178 |
'Tag','PrTextSizeMenu',... |
---|
179 |
'Label','Size'); |
---|
180 |
fms4 = uimenu(fm,... |
---|
181 |
'BackGr','b',... |
---|
182 |
'Enable','on',... |
---|
183 |
'ForeGr','w',... |
---|
184 |
'Tag','PrTextJustifyMenu',... |
---|
185 |
'Label','Justify'); |
---|
186 |
|
---|
187 |
fms5 = uimenu(fm,... |
---|
188 |
'BackGr','b',... |
---|
189 |
'CallBack','Prmenu(2,1)',... |
---|
190 |
'Separator', 'on', ... |
---|
191 |
'Enable','on',... |
---|
192 |
'ForeGr','w',... |
---|
193 |
'Tag','PrTextMoveMBON',... |
---|
194 |
'Label','MoveText ON'); |
---|
195 |
fms6 = uimenu(fm,... |
---|
196 |
'BackGr','b',... |
---|
197 |
'CallBack','Prmenu(2,2)',... |
---|
198 |
'Enable','off',... |
---|
199 |
'ForeGr','w',... |
---|
200 |
'Tag','PrTextMoveMBOFF',... |
---|
201 |
'Label','MoveText OFF'); |
---|
202 |
fms7 = uimenu(fm,... |
---|
203 |
'BackGr','b',... |
---|
204 |
'CallBack','EditText(8)',... |
---|
205 |
'Separator', 'on', ... |
---|
206 |
'Enable','on',... |
---|
207 |
'ForeGr','w',... |
---|
208 |
'interruptible', 'yes', ... |
---|
209 |
'Tag','PrTextEditText',... |
---|
210 |
'Label','Edit Text'); |
---|
211 |
fms8 = uimenu(fm,... |
---|
212 |
'BackGr','b',... |
---|
213 |
'CallBack','EditText(9)',... |
---|
214 |
'Enable','on',... |
---|
215 |
'ForeGr','w',... |
---|
216 |
'interruptible', 'yes', ... |
---|
217 |
'Tag','PrTextAddText',... |
---|
218 |
'Label','Add Text'); |
---|
219 |
% Font Sub Menu |
---|
220 |
fontlist=str2mat('Avant Garde','Bookman','Courier','Geneva',... |
---|
221 |
'Helvetica','Kyoto','Osaka','Palatino','Symbol',... |
---|
222 |
'Times'); |
---|
223 |
fontlist=str2mat(fontlist,'Zapf Chancery','Zapf Dingbats'); |
---|
224 |
[m,n]=size(fontlist); |
---|
225 |
for i=1:m |
---|
226 |
fontname = fontlist(i,1:n); |
---|
227 |
uimenu(fms1,'Label',fontname,'BackGr','b','ForeGr','w', ... |
---|
228 |
'Callback',['gca;EditText(1,''' deblank(fontname) ''')']); |
---|
229 |
end |
---|
230 |
|
---|
231 |
% Text Style Sub Menu |
---|
232 |
|
---|
233 |
uimenu(fms2,'Label','Plain', 'Callback','gca;EditText(4,''plain'')',... |
---|
234 |
'BackGr','b','ForeGr','w'); |
---|
235 |
uimenu(fms2,'Label','Italic', 'Callback','gca;EditText(2,''italic'')',... |
---|
236 |
'BackGr','b','ForeGr','w'); |
---|
237 |
uimenu(fms2,'Label','Oblique','Callback','gca;EditText(2,''oblique'')',... |
---|
238 |
'BackGr','b','ForeGr','w'); |
---|
239 |
uimenu(fms2,'Label','Light', 'Callback','gca;EditText(3,''light'')',... |
---|
240 |
'BackGr','b','ForeGr','w'); |
---|
241 |
uimenu(fms2,'Label','Demi', 'Callback','gca;EditText(3,''demi'')',... |
---|
242 |
'BackGr','b','ForeGr','w'); |
---|
243 |
uimenu(fms2,'Label','Bold', 'Callback','gca;EditText(3,''bold'')',... |
---|
244 |
'BackGr','b','ForeGr','w'); |
---|
245 |
|
---|
246 |
% Text Size Sub Menu |
---|
247 |
|
---|
248 |
uimenu(fms3,'Label','6','Callback','gca;EditText(5,6)',... |
---|
249 |
'BackGr','b','ForeGr','w'); |
---|
250 |
uimenu(fms3,'Label','9','Callback','gca;EditText(5,9)',... |
---|
251 |
'BackGr','b','ForeGr','w'); |
---|
252 |
uimenu(fms3,'Label','12','Callback','gca;EditText(5,12)',... |
---|
253 |
'BackGr','b','ForeGr','w'); |
---|
254 |
uimenu(fms3,'Label','14','Callback','gca;EditText(5,14)',... |
---|
255 |
'BackGr','b','ForeGr','w'); |
---|
256 |
uimenu(fms3,'Label','18','Callback','gca;EditText(5,18)',... |
---|
257 |
'BackGr','b','ForeGr','w'); |
---|
258 |
uimenu(fms3,'Label','24','Callback','gca;EditText(5,24)',... |
---|
259 |
'BackGr','b','ForeGr','w'); |
---|
260 |
uimenu(fms3,'Label','Other','Callback','gca;EditText(5,0)',... |
---|
261 |
'BackGr','b','ForeGr','w', 'interruptible', 'yes'); |
---|
262 |
|
---|
263 |
% Text Justify Sub Menu |
---|
264 |
|
---|
265 |
fms4v = uimenu(fms4,'Label','Vert', 'BackGr','b','ForeGr','w'); |
---|
266 |
fms4h = uimenu(fms4,'Label','Horiz', 'BackGr','b','ForeGr','w'); |
---|
267 |
|
---|
268 |
uimenu(fms4v,'Label','top', 'Callback','gca;EditText(6,''top'')',... |
---|
269 |
'BackGr','b','ForeGr','w'); |
---|
270 |
uimenu(fms4v,'Label','center', 'Callback','gca;EditText(6,''middle'')',... |
---|
271 |
'BackGr','b','ForeGr','w'); |
---|
272 |
uimenu(fms4v,'Label','bottom', 'Callback','gca;EditText(6,''bottom'')',... |
---|
273 |
'BackGr','b','ForeGr','w'); |
---|
274 |
|
---|
275 |
uimenu(fms4h,'Label','left', 'Callback','gca;EditText(7,''left'')',... |
---|
276 |
'BackGr','b','ForeGr','w'); |
---|
277 |
uimenu(fms4h,'Label','center', 'Callback','gca;EditText(7,''center'')',... |
---|
278 |
'BackGr','b','ForeGr','w'); |
---|
279 |
uimenu(fms4h,'Label','right', 'Callback','gca;EditText(7,''right'')',... |
---|
280 |
'BackGr','b','ForeGr','w'); |
---|
281 |
|
---|
282 |
% Line Obj Main Menu |
---|
283 |
lm = uimenu('BackGr','g',... |
---|
284 |
'CallBack','',... |
---|
285 |
'Enable','on',... |
---|
286 |
'ForeGr','k',... |
---|
287 |
'Label','Line',... |
---|
288 |
'Tag','PrLine'); |
---|
289 |
lms1 = uimenu(lm,'Label','Line Style','BackGr','g','ForeGr','k'); |
---|
290 |
lms2 = uimenu(lm,'Label','Line Width','BackGr','g','ForeGr','k'); |
---|
291 |
lms5 = uimenu(lm,'Label','Marker Size','BackGr','g','ForeGr','k'); |
---|
292 |
|
---|
293 |
uimenu(lms1,'Label','_______','Callback','gca;EditLine(1,''-'')',... |
---|
294 |
'BackGr','k','ForeGr','w'); |
---|
295 |
uimenu(lms1,'Label','.......','Callback','gca;EditLine(1,'':'')',... |
---|
296 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
297 |
uimenu(lms1,'Label','_ _ _ _','Callback','gca;EditLine(1,''--'')',... |
---|
298 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
299 |
uimenu(lms1,'Label','_._._._','Callback','gca;EditLine(1,''-.'')',... |
---|
300 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
301 |
uimenu(lms1,'Label','*','Callback','gca;EditLine(1,''*'')',... |
---|
302 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
303 |
uimenu(lms1,'Label','+','Callback','gca;EditLine(1,''+'')',... |
---|
304 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
305 |
uimenu(lms1,'Label','o','Callback','gca;EditLine(1,''o'')',... |
---|
306 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
307 |
uimenu(lms1,'Label','.','Callback','gca;EditLine(1,''.'')',... |
---|
308 |
'BackGr','k','ForeGr','w','Separator','on'); |
---|
309 |
|
---|
310 |
uimenu(lms2,'Label','0.5 point','Callback','gca;EditLine(2,.5)',... |
---|
311 |
'BackGr','k','ForeGr','w'); |
---|
312 |
uimenu(lms2,'Label','1.0 point','Callback','gca;EditLine(2,1)',.... |
---|
313 |
'BackGr','k','ForeGr','w'); |
---|
314 |
uimenu(lms2,'Label','2.0 point','Callback','gca;EditLine(2,2)',... |
---|
315 |
'BackGr','k','ForeGr','w'); |
---|
316 |
uimenu(lms2,'Label','4.0 point','Callback','gca;EditLine(2,4)',... |
---|
317 |
'BackGr','k','ForeGr','w'); |
---|
318 |
uimenu(lms2,'Label','Other','Callback','gca;EditLine(2,0)',... |
---|
319 |
'Enable','on','BackGr','g','ForeGr','k', 'interruptible', 'yes'); |
---|
320 |
|
---|
321 |
uimenu(lms5,'Label','1 point','Callback','gca;EditLine(5,1)',... |
---|
322 |
'BackGr','k','ForeGr','w'); |
---|
323 |
uimenu(lms5,'Label','3 point','Callback','gca;EditLine(5,3)',... |
---|
324 |
'BackGr','k','ForeGr','w'); |
---|
325 |
uimenu(lms5,'Label','6 point','Callback','gca;EditLine(5,6)',... |
---|
326 |
'BackGr','k','ForeGr','w'); |
---|
327 |
uimenu(lms5,'Label','10 point','Callback','gca;EditLine(5,10)',... |
---|
328 |
'BackGr','k','ForeGr','w'); |
---|
329 |
uimenu(lms5,'Label','Other','Callback','gca;EditLine(5,0)',... |
---|
330 |
'Enable','on','BackGr','g','ForeGr','k', 'interruptible', 'yes'); |
---|
331 |
|
---|
332 |
|
---|
333 |
% Color Obj Main Menu |
---|
334 |
|
---|
335 |
cm = uimenu('BackGr','b',... |
---|
336 |
'CallBack','',... |
---|
337 |
'Enable','on',... |
---|
338 |
'ForeGr','w',... |
---|
339 |
'Label','Color',... |
---|
340 |
'Tag','PrColor'); |
---|
341 |
cms1 = uimenu(cm,'Label','Pen','BackGr','b','ForeGr','w'); |
---|
342 |
cms2 = uimenu(cm,'Label','Fill','BackGr','b','ForeGr','w'); |
---|
343 |
cms3 = uimenu(cm,'Label','Edit Color','BackGr','b','ForeGr','w', ... |
---|
344 |
'Enable', 'on', 'Callback', 'gca; EditColor'); |
---|
345 |
|
---|
346 |
uimenu(cms1,'Label','Yellow','Callback','gca;EditColor(0,3,''y'')',... |
---|
347 |
'BackGr','k','ForeGr','y'); |
---|
348 |
uimenu(cms1,'Label','Violet','Callback','gca;EditColor(0,3,''m'')',... |
---|
349 |
'BackGr','k','ForeGr','m'); |
---|
350 |
uimenu(cms1,'Label','Cyan','Callback','gca;EditColor(0,3,''c'')',... |
---|
351 |
'BackGr','k','ForeGr','c'); |
---|
352 |
uimenu(cms1,'Label','Red','Callback','gca;EditColor(0,3,''r'')',... |
---|
353 |
'BackGr','k','ForeGr','r'); |
---|
354 |
uimenu(cms1,'Label','Green','Callback','gca;EditColor(0,3,''g'')',... |
---|
355 |
'BackGr','k','ForeGr','g'); |
---|
356 |
uimenu(cms1,'Label','Blue','Callback','gca;EditColor(0,3,''b'')',... |
---|
357 |
'BackGr','k','ForeGr','b'); |
---|
358 |
uimenu(cms1,'Label','White','Callback','gca;EditColor(0,3,''w'')',... |
---|
359 |
'BackGr','k','ForeGr','w'); |
---|
360 |
uimenu(cms1,'Label','Black','Callback','gca;EditColor(0,3,''k'')',... |
---|
361 |
'BackGr','w','ForeGr','k'); |
---|
362 |
uimenu(cms1,'Label','70% Grey',... |
---|
363 |
'Callback','gca;EditColor(0,3,[.7 .7 .7])',... |
---|
364 |
'BackGr','k','ForeGr',[.7 .7 .7],... |
---|
365 |
'Separator','on'); |
---|
366 |
|
---|
367 |
uimenu(cms2,'Label','Yellow','Callback','gca;EditLine(4,[1 1 0])',... |
---|
368 |
'BackGr','y','ForeGr','k'); |
---|
369 |
uimenu(cms2,'Label','Violet','Callback','gca;EditLine(4,[1 0 1])',... |
---|
370 |
'BackGr','m','ForeGr','k'); |
---|
371 |
uimenu(cms2,'Label','Cyan','Callback','gca;EditLine(4,[0 1 1])',... |
---|
372 |
'BackGr','c','ForeGr','k'); |
---|
373 |
uimenu(cms2,'Label','Red','Callback','gca;EditLine(4,[1 0 0])',... |
---|
374 |
'BackGr','r','ForeGr','k'); |
---|
375 |
uimenu(cms2,'Label','Green','Callback','gca;EditLine(4,[0 1 0])',... |
---|
376 |
'BackGr','g','ForeGr','k'); |
---|
377 |
uimenu(cms2,'Label','Blue','Callback','gca;EditLine(4,[0 0 1])',... |
---|
378 |
'BackGr','b','ForeGr','w'); |
---|
379 |
uimenu(cms2,'Label','White','Callback','gca;EditLine(4,[1 1 1])',... |
---|
380 |
'BackGr','w','ForeGr','k'); |
---|
381 |
uimenu(cms2,'Label','Black','Callback','gca;EditLine(4,[0 0 0])',... |
---|
382 |
'BackGr','k','ForeGr','w'); |
---|
383 |
uimenu(cms2,'Label','70% Grey','Callback','gca;EditLine(4,[.7 .7 .7])',... |
---|
384 |
'BackGr','k','ForeGr','w'); |
---|
385 |
uimenu(cms2,'Label','None','Callback','gca;EditLine(4,''none'')',... |
---|
386 |
'BackGr',[.7 .7 .7],'ForeGr','k'); |
---|
387 |
|
---|
388 |
% Insert Blank menus |
---|
389 |
uimenu('Label',' ','Position',7,'BackGr',[.7 .7 .7],'Enable','off'); |
---|
390 |
|
---|
391 |
prmenu=uimenu('Label','Print','BackGr','b','ForeGr','w','Tag','PrPrint'); |
---|
392 |
uimenu(prmenu,'Label','Page Setup','Callback','PrintSetup',... |
---|
393 |
'Enable','on','BackgroundColor','b','ForegroundColor','w'); |
---|
394 |
|
---|
395 |
uimenu(prmenu,'Label','To lphp','Callback','print',... |
---|
396 |
'BackGr','b','ForeGr','w'); |
---|
397 |
uimenu(prmenu,'Label','To lptom','Callback','print -Plptom',... |
---|
398 |
'Enable','off','BackGr','b','ForeGr','w'); |
---|
399 |
uimenu(prmenu,'Label','To file','Callback','printfile(1)',... |
---|
400 |
'Separator','on','BackGr','b','ForeGr','w'); |
---|
401 |
|
---|
402 |
wsmenu=uimenu('Label','Workspace','BackGr','g','Tag','PrWorkS'); |
---|
403 |
uimenu(wsmenu,'Label', 'WYSIWYG', ... |
---|
404 |
'Callback', 'wysiwyg', ... |
---|
405 |
'BackGr','g'); |
---|
406 |
uimenu(wsmenu,'Label', 'Reduce View', ... |
---|
407 |
'Callback', 'ChangeView(''reduce'')', ... |
---|
408 |
'BackGr','g'); |
---|
409 |
uimenu(wsmenu,'Label', 'Enlarge View', ... |
---|
410 |
'Callback', 'ChangeView(''enlarge'')', ... |
---|
411 |
'BackGr','g'); |
---|
412 |
uimenu(wsmenu,'Label', 'Layout', ... |
---|
413 |
'Callback', 'layout(''initialize'')', ... |
---|
414 |
'separator', 'on', 'BackGr','g'); |
---|
415 |
uimenu(wsmenu,'Label', 'Refresh Screen', ... |
---|
416 |
'Callback', 'refresh(gcf)', ... |
---|
417 |
'separator', 'on', 'BackGr','g'); |
---|
418 |
uimenu(wsmenu,'Label','Remove Prmenu','Callback','Prmenu(3)',... |
---|
419 |
'BackGr','g') |
---|
420 |
uimenu(wsmenu,'Label','Clear Plot','Callback','cla;reset(gca)',... |
---|
421 |
'BackGr','g'); |
---|
422 |
uimenu(wsmenu,'Label','Close Figure','Callback','close(gcf)',... |
---|
423 |
'BackGr','g'); |
---|
424 |
|
---|
425 |
mtmenu=uimenu('Label','Template', ... |
---|
426 |
'BackGr','b','ForeGr','w', ... |
---|
427 |
'Tag','PrTemplate'); |
---|
428 |
uimenu(mtmenu,'Label','Save As','Callback','SaveAs',... |
---|
429 |
'BackGr','b','ForeGr','w'); |
---|
430 |
uimenu(mtmenu,'Label','Open','Callback','OpenAs',... |
---|
431 |
'BackGr','b','ForeGr','w'); |
---|
432 |
|
---|
433 |
% Insert some more Blank menus |
---|
434 |
uimenu('Label',' ','Position',11,'BackGr',[.7 .7 .7],'Enable','off'); |
---|
435 |
%uimenu('Label',' ','Position',12,'BackGr',[.7 .7 .7],'Enable','off'); |
---|
436 |
%uimenu('Label',' ','Position',13,'BackGr',[.7 .7 .7],'Enable','off'); |
---|
437 |
|
---|
438 |
% menu items that show lasttype and lastobject touched |
---|
439 |
uimenu('Label', LASTTYPE, ... |
---|
440 |
'BackGr',[.7 .7 .7], 'ForeGr', 'k', ... |
---|
441 |
'Enable','on', 'Tag', 'PrType'); |
---|
442 |
uimenu('Label', num2str(LASTOBJECT,6), ... |
---|
443 |
'BackGr',[.7 .7 .7], 'ForeGr', 'k', ... |
---|
444 |
'Enable','on', 'Tag', 'PrObject'); |
---|
445 |
|
---|
446 |
|
---|
447 |
elseif opt==1 |
---|
448 |
PrZoomIn=findobj(gcf,'Type','uimenu','Tag','PrZoomIn'); |
---|
449 |
PrZoomOut=findobj(gcf,'Type','uimenu','Tag','PrZoomOut'); |
---|
450 |
PrZoomOff=findobj(gcf,'Type','uimenu','Tag','PrZoomOff'); |
---|
451 |
if subopt==1 |
---|
452 |
set(PrZoomIn,'Enable','off'); |
---|
453 |
set(PrZoomOut,'Enable','on'); |
---|
454 |
set(PrZoomOff,'Enable','on'); |
---|
455 |
zoom on |
---|
456 |
elseif subopt==2 |
---|
457 |
zoom out |
---|
458 |
else |
---|
459 |
set(PrZoomIn,'Enable','on'); |
---|
460 |
set(PrZoomOut,'Enable','off'); |
---|
461 |
set(PrZoomOff,'Enable','off'); |
---|
462 |
zoom off |
---|
463 |
set(gcf, 'WindowButtonDownFcn', 'lastouch', ... |
---|
464 |
'WindowButtonUpFcn', '', ... |
---|
465 |
'WindowButtonMotionFcn', ''); |
---|
466 |
end |
---|
467 |
elseif opt==2 |
---|
468 |
MTON=findobj(gcf,'Type','uimenu','Tag','PrTextMoveMBON'); |
---|
469 |
MTOFF=findobj(gcf,'Type','uimenu','Tag','PrTextMoveMBOFF'); |
---|
470 |
if subopt==1 |
---|
471 |
figure(gcf); |
---|
472 |
axes(gca); |
---|
473 |
movetext('on'); |
---|
474 |
set(MTON,'Enable','off') |
---|
475 |
set(MTOFF,'Enable','on') |
---|
476 |
else |
---|
477 |
movetext('off'); |
---|
478 |
set(MTON,'Enable','on') |
---|
479 |
set(MTOFF,'Enable','off') |
---|
480 |
end |
---|
481 |
elseif opt==3 |
---|
482 |
fig_ch=get(gcf,'Children'); |
---|
483 |
menus=findobj(fig_ch,'flat','Type','uimenu'); |
---|
484 |
delete(menus); |
---|
485 |
refresh(gcf); |
---|
486 |
end |
---|
487 |
|
---|