NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/basics/context_menus.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 %% SCRIPT TO CREATE CONTEXT MENUS
2 %% DEFINE CONTEXT MENUS
3 %% LINE OBJECT CONTEXT ITEMS
4 lineobjcontextmenu=uicontextmenu('Tag','Line_Obj_Context_Menu');
5    cb8 = ['set(gco,''Color'',''r'')'];
6    cb9 = ['set(gco,''Color'',''g'')'];
7    cb10 = ['set(gco,''Color'',''b'')'];
8    cb11 = ['set(gco,''Color'',''k'')'];
9    item1 = uimenu(lineobjcontextmenu, 'Label', 'LineStyle');
10       cb = ['set(gco,''LineStyle'',''--'')'];
11            uimenu(item1, 'Label', 'dash', 'Callback', cb);
12       cb = ['set(gco,''LineStyle'','':'')'];
13            uimenu(item1, 'Label', 'dot', 'Callback', cb);
14       cb = ['set(gco,''LineStyle'',''-.'')'];
15            uimenu(item1, 'Label', 'dot-dash', 'Callback', cb);
16       cb = ['set(gco,''LineStyle'',''-'')'];
17           uimenu(item1, 'Label', 'solid', 'Callback', cb);
18       cb = ['set(gco,''LineStyle'',''none'')'];
19           uimenu(item1, 'Label', 'none', 'Callback', cb);
20    item2 = uimenu(lineobjcontextmenu, 'Label', 'LineWidth');
21       cb = ['set(gco,''LineWidth'',.25)'];
22            uimenu(item2, 'Label', '.25', 'Callback', cb);
23       cb = ['set(gco,''LineWidth'',.5)'];
24            uimenu(item2, 'Label', '.5', 'Callback', cb);
25       cb = ['set(gco,''LineWidth'',1)'];
26            uimenu(item2, 'Label', '1', 'Callback', cb);
27       cb = ['set(gco,''LineWidth'',2)'];
28            uimenu(item2, 'Label', '2', 'Callback', cb);
29    item3 = uimenu(lineobjcontextmenu, 'Label', 'LineColor','ForeGroundColor','r');
30       cb = ['set(gco,''Color'',''r'')'];
31            uimenu(item3, 'Label', 'red', 'Callback', cb,'ForeGroundColor','r');
32       cb = ['set(gco,''Color'',''g'')'];
33            uimenu(item3, 'Label', 'green','Callback', cb,'ForeGroundColor','g');
34       cb = ['set(gco,''Color'',''b'')'];
35            uimenu(item3, 'Label', 'blue', 'Callback', cb,'ForeGroundColor','b');
36       cb = ['set(gco,''Color'',''k'')'];
37            uimenu(item3, 'Label', 'black', 'Callback', cb,'ForeGroundColor','k');
38       cb = ['set(gco,''Color'',[.8 .8 .8])'];
39            uimenu(item3, 'Label', 'grey', 'Callback', cb,'ForeGroundColor',[.8 .8 .8]);
40    item4 = uimenu(lineobjcontextmenu, 'Label', 'Marker','Separator','on');
41       cb = ['set(gco,''Marker'',''*'')'];
42            uimenu(item4, 'Label', '*', 'Callback', cb,'ForeGroundColor','r');
43       cb = ['set(gco,''Marker'',''.'')'];
44            uimenu(item4, 'Label', '.','Callback', cb,'ForeGroundColor','g');
45       cb = ['set(gco,''Marker'',''x'')'];
46            uimenu(item4, 'Label', 'x', 'Callback', cb,'ForeGroundColor','b');
47       cb = ['set(gco,''Marker'',''o'')'];
48            uimenu(item4, 'Label', 'o', 'Callback', cb,'ForeGroundColor','k');
49       cb = ['set(gco,''Marker'',''d'')'];
50            uimenu(item4, 'Label', 'diamond', 'Callback', cb,'ForeGroundColor',[.8 .8 .8]);
51    item5 = uimenu(lineobjcontextmenu, 'Label', 'MarkerSize');
52       cb = ['set(gco,''MarkerSize'',4)'];
53            uimenu(item5, 'Label', '4', 'Callback', cb);
54       cb = ['set(gco,''MarkerSize'',8)'];
55            uimenu(item5, 'Label', '8','Callback', cb);
56       cb = ['set(gco,''MarkerSize'',12)'];
57            uimenu(item5, 'Label', '12', 'Callback', cb);
58       cb = ['set(gco,''MarkerSize'',16)'];
59            uimenu(item5, 'Label', '16', 'Callback', cb);
60       cb = ['set(gco,''MarkerSize'',20)'];
61            uimenu(item5, 'Label', '20', 'Callback', cb);
62    
63 %% TEXT OBJECT CONTEXT ITEMS
64 textobjcontextmenu=uicontextmenu('Tag','Text_Obj_Context_Menu');
65    item1 = uimenu(textobjcontextmenu, 'Label', 'FontSize');
66       cb = ['set(gco,''FontSize'',6)'];
67            uimenu(item1, 'Label', '6', 'Callback', cb);
68       cb = ['set(gco,''FontSize'',10)'];
69            uimenu(item1, 'Label', '10', 'Callback', cb);
70       cb = ['set(gco,''FontSize'',14)'];
71            uimenu(item1, 'Label', '14', 'Callback', cb);
72       cb = ['set(gco,''FontSize'',18)'];
73            uimenu(item1, 'Label', '18', 'Callback', cb);
74       cb = ['set(gco,''FontSize'',22)'];
75            uimenu(item1, 'Label', '22', 'Callback', cb);
76    item2= uimenu(textobjcontextmenu, 'Label', 'FontWeight');
77       cb = ['set(gco,''FontWeight'',''light'')'];
78            uimenu(item2, 'Label', 'light', 'Callback', cb);
79       cb = ['set(gco,''FontWeight'',''normal'')'];
80            uimenu(item2, 'Label', 'normal', 'Callback', cb);
81       cb = ['set(gco,''FontWeight'',''demi'')'];
82            uimenu(item2, 'Label', 'demi', 'Callback', cb);
83       cb = ['set(gco,''FontWeight'',''bold'')'];
84            uimenu(item2, 'Label', 'bold', 'Callback', cb);
85    item3= uimenu(textobjcontextmenu, 'Label', 'FontAngle');
86       cb = ['set(gco,''FontAngle'',''normal'')'];
87            uimenu(item3, 'Label', 'normal', 'Callback', cb);
88       cb = ['set(gco,''FontAngle'',''italic'')'];
89           uimenu(item3, 'Label', 'italic', 'Callback', cb);
90       cb = ['set(gco,''FontAngle'',''oblique'')'];
91           uimenu(item3, 'Label', 'oblique', 'Callback', cb);
92    item4= uimenu(textobjcontextmenu, 'Label', 'Color');
93       cb = ['set(gco,''Color'',''r'')'];
94           uimenu(item4, 'Label', 'red', 'Callback', cb);
95       cb = ['set(gco,''Color'',''italic'')'];
96           uimenu(item4, 'Label', 'blue', 'Callback', cb);
97       cb = ['set(gco,''Color'',''g'')'];
98           uimenu(item4, 'Label', 'green', 'Callback', cb);
99       cb = ['set(gco,''Color'',''k'')'];
100           uimenu(item4, 'Label', 'black', 'Callback', cb);
101  
Note: See TracBrowser for help on using the browser.