9aab93c9709d2ee417d35f361275a010812fdd2e
[scilab.git] / scilab / modules / gui / etc / graphics_menubar.xml
1 <?xml version="1.0"?>
2 <!-- [SCILAB_FIGURE_ID] pattern is replaced at generation of Java menu by the ID of the figure -->
3 <!-- The accelerator can be "control shift A" or "control A" or "meta A" or "OSSCKEY A" where oskey means "OS ShortCut key"
4      and is replaced by the good key (control for Unix/Windows OS and meta for Mac) -->
5
6 <menubar>
7   <menu label="&amp;File">
8     <submenu label="&amp;New figure..." accelerator="OSSCKEY N">
9       <callback instruction="scf();" type="0"/>
10     </submenu>
11     <separator/>
12     <submenu label="&amp;Load..." icon="document-open">
13       <callback
14           instruction='
15                        %fileToLoad = uigetfile("*.scg", pwd(), gettext("Select a file to load"));
16                        if ~isempty(%fileToLoad) then
17                        xload(%fileToLoad,[SCILAB_FIGURE_ID]);
18                        disp(msprintf(gettext("Figure loaded.\n")));
19                        end
20                        clear %fileToLoad'
21           type="0"/>
22     </submenu>
23     <submenu label="&amp;Save..." accelerator="OSSCKEY S" icon="document-save">
24       <callback
25           instruction='
26                        %fileToSave = uiputfile("*.scg", pwd(), gettext("Select a file to write"));
27                        if ~isempty(%fileToSave) then
28                        if isempty(fileparts(%fileToSave, "extension")) then
29                        %fileToSave = %fileToSave + ".scg";
30                        end
31                        xsave(%fileToSave, get_figure_handle([SCILAB_FIGURE_ID]));
32                        disp(msprintf(gettext("Figure saved.\n")));
33                        end
34                        clear %fileToSave isempty'
35           type="0"/>
36     </submenu>
37     <separator/>
38     <submenu label="&amp;Export to..." accelerator="OSSCKEY E">
39       <callback instruction='exportUI([SCILAB_FIGURE_ID])' type="0"/>
40       <submenu label="P&amp;NG">
41         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
42         <callback
43             instruction='
44                          %fileToWrite = uiputfile("*.png", pwd(), gettext("Select a file name"));
45                          if ~isempty(%fileToWrite) then
46                          xs2png([SCILAB_FIGURE_ID], %fileToWrite);
47                          end
48                          clear %fileToWrite isempty'
49             type="0"/>
50       </submenu>
51       <submenu label="&amp;JPG">
52         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
53         <callback
54             instruction='
55                          %fileToWrite = uiputfile("*.jpg", pwd(), gettext("Select a file name"));
56                          if ~isempty(%fileToWrite) then
57                          xs2jpg([SCILAB_FIGURE_ID], %fileToWrite);
58                          end
59                          clear %fileToWrite isempty'
60             type="0"/>
61       </submenu>
62       <submenu label="&amp;GIF">
63         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
64         <callback
65             instruction='
66                          %fileToWrite = uiputfile("*.gif", pwd(), gettext("Select a file name"));
67                          if ~isempty(%fileToWrite) then
68                          xs2gif([SCILAB_FIGURE_ID], %fileToWrite);
69                          end
70                          clear %fileToWrite isempty'
71             type="0"/>
72       </submenu>
73       <submenu label="&amp;PPM">
74         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
75         <callback
76             instruction='
77                          %fileToWrite = uiputfile("*.ppm", pwd(), gettext("Select a file name"));
78                          if ~isempty(%fileToWrite) then
79                          xs2ppm([SCILAB_FIGURE_ID], %fileToWrite);
80                          end
81                          clear %fileToWrite isempty'
82             type="0"/>
83       </submenu>
84       <submenu label="&amp;BMP">
85         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
86         <callback
87             instruction='
88                          %fileToWrite = uiputfile("*.bmp", pwd(), gettext("Select a file name"));
89                          if ~isempty(%fileToWrite) then
90                          xs2bmp([SCILAB_FIGURE_ID], %fileToWrite);
91                          end
92                          clear %fileToWrite isempty'
93             type="0"/>
94       </submenu>
95     </submenu>
96     <submenu label="&amp;Vectorial export to...">
97       <submenu label="&amp;PDF">
98         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
99         <callback
100                 instruction='
101                          %fileToWrite = uiputfile("*.pdf", pwd(), gettext("Select a file name"));
102                          if ~isempty(%fileToWrite) then
103                          xs2pdf([SCILAB_FIGURE_ID], %fileToWrite);
104                          end
105                          clear %fileToWrite isempty'
106                 type="0"/>
107       </submenu>
108       <submenu label="&amp;PS">
109         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
110         <callback
111                 instruction='
112                          %fileToWrite = uiputfile("*.ps", pwd(), gettext("Select a file name"));
113                          if ~isempty(%fileToWrite) then
114                          xs2ps([SCILAB_FIGURE_ID], %fileToWrite);
115                          end
116                          clear %fileToWrite isempty'
117                 type="0"/>
118       </submenu>
119       <submenu label="&amp;SVG">
120         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
121         <callback
122             instruction='
123                          %fileToWrite = uiputfile("*.svg", pwd(), gettext("Select a file name"));
124                          if ~isempty(%fileToWrite) then
125                          xs2svg([SCILAB_FIGURE_ID], %fileToWrite);
126                          end
127                          clear %fileToWrite isempty'
128             type="0"/>
129       </submenu>
130       <submenu label="&amp;EMF">
131         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
132         <callback
133             instruction='
134                          %fileToWrite = uiputfile("*.emf", pwd(), gettext("Select a file name"));
135                          if ~isempty(%fileToWrite) then
136                          xs2emf([SCILAB_FIGURE_ID], %fileToWrite);
137                          end
138                          clear %fileToWrite isempty'
139             type="0"/>
140       </submenu>
141       <submenu label="&amp;EPS">
142         <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.exportCustomFileChooser' type="3"/>
143         <callback
144             instruction='
145                          %fileToWrite = uiputfile("*.eps", pwd(), gettext("Select a file name"));
146                          if ~isempty(%fileToWrite) then
147                          xs2eps([SCILAB_FIGURE_ID], %fileToWrite);
148                          end
149                          clear %fileToWrite isempty'
150             type="0"/>
151       </submenu>
152     </submenu>
153     <submenu label="&amp;Copy to clipboard" accelerator="OSSCKEY C" icon="edit-copy">
154       <callback instruction='clipboard([SCILAB_FIGURE_ID], "EMF");' type="0"/>
155     </submenu>
156     <separator/>
157     <submenu label="P&amp;age setup...">
158       <callback instruction='org.scilab.modules.gui.bridge.CallScilabBridge.pageSetup' type="3"/>
159     </submenu>
160     <submenu label="&amp;Print..." accelerator="OSSCKEY P" icon="document-print">
161       <callback instruction='printfigure([SCILAB_FIGURE_ID]);' type="0"/>
162     </submenu>
163     <separator/>
164     <submenu label="C&amp;lose" accelerator="OSSCKEY W">
165       <callback instruction='
166                 if (get(get_figure_handle([SCILAB_FIGURE_ID]), "event_handler_enable") == "on" );
167                     execstr(get(get_figure_handle([SCILAB_FIGURE_ID]), "event_handler")+"([SCILAB_FIGURE_ID], -1, -1, -1000)", "errcatch", "m");
168                 end;
169                 delete(get_figure_handle([SCILAB_FIGURE_ID]));'
170                 type="0"/>
171     </submenu>
172   </menu>
173
174   <menu label="&amp;Tools">
175     <submenu label="Show/Hide &amp;Toolbar">
176       <callback
177              instruction='
178                if toolbar([SCILAB_FIGURE_ID])=="on" then
179                  toolbar([SCILAB_FIGURE_ID], "off");
180                else
181                  toolbar([SCILAB_FIGURE_ID], "on");
182                end'
183              type="0"/>
184     </submenu>
185     <separator/>
186     <submenu label="&amp;Zoom" icon="zoom-fit-selection">
187       <callback instruction='zoom_rect(get_figure_handle([SCILAB_FIGURE_ID]))' type="0"/>
188     </submenu>
189     <submenu label="&amp;Original View" icon="zoom-original">
190       <callback instruction='unzoom(get_figure_handle([SCILAB_FIGURE_ID]))' type="0"/>
191     </submenu>
192     <separator/>
193     <submenu label="2D/3D &amp;Rotation" icon="transform-rotate">
194       <callback instruction="set(get_figure_handle([SCILAB_FIGURE_ID]), 'info_message', 'Right click and drag to rotate.')" type="-2"/>
195     </submenu>
196   </menu>
197
198   <menu label="&amp;Edit">
199     <submenu label="&amp;Select as current figure">
200       <callback instruction='scf([SCILAB_FIGURE_ID]);' type="0"/>
201     </submenu>
202     <submenu label="&amp;Clear figure">
203       <callback instruction='clf(get_figure_handle([SCILAB_FIGURE_ID]));' type="0"/>
204     </submenu>
205     <separator/>
206     <submenu label="&amp;Figure properties">
207       <callback instruction='ged(8,[SCILAB_FIGURE_ID]);' type="0"/>
208     </submenu>
209     <submenu label="&amp;Axes properties">
210       <callback instruction='ged(9,[SCILAB_FIGURE_ID]);' type="0"/>
211     </submenu>
212     <separator/>
213     <submenu label="&amp;Start entity picker">
214       <callback instruction='ged(10,[SCILAB_FIGURE_ID]);' type="0"/>
215     </submenu>
216     <submenu label="S&amp;top entity picker">
217       <callback instruction='ged(11,[SCILAB_FIGURE_ID]);' type="0"/>
218     </submenu>
219     <separator/>
220     <submenu label="&amp;Start datatip manager" icon="datatips">
221       <callback instruction='datatipManagerMode([SCILAB_FIGURE_ID],"on");' type="0"/>
222     </submenu>
223     <submenu label="Stop datatip manager">
224       <callback instruction='datatipManagerMode([SCILAB_FIGURE_ID],"off");' type="0"/>
225     </submenu>
226   </menu>
227
228   <!--
229   <menu label="&amp;MVC">
230     <submenu label="&amp;Log View (Trace all View notifications)">
231       <callback instruction='org.scilab.modules.graphic_objects.MVCDebugView.showLogView' type="3"/>
232     </submenu>
233     <separator/>
234     <submenu label="&amp;All Objects View (All objects with properties)">
235       <callback instruction='org.scilab.modules.graphic_objects.MVCDebugView.showAllObjectsView' type="3"/>
236     </submenu>
237     <separator/>
238     <submenu label="&amp;Ged-like View (Future ged)">
239       <callback instruction='org.scilab.modules.graphic_objects.MVCDebugView.showGedView' type="3"/>
240     </submenu>
241     <separator/>
242   </menu>
243   -->
244
245   <menu label="&amp;?">
246     <submenu label="&amp;Scilab Help" accelerator="F1" icon="help-browser">
247       <callback instruction='help();' type="0"/>
248     </submenu>
249     <separator/>
250     <submenu label="&amp;About Scilab..." accelerator="shift F1">
251       <callback instruction='about()' type="0"/>
252     </submenu>
253   </menu>
254 </menubar>