7
xinfo('Select an item in a menu to set shortcut')
8
[btn,xc,yc,cwin,Cmenu]=cosclick()
12
%koko=find(%scicos_short(:,2)==Cmenu)
14
txt=x_mdialog(['Edit the short cut (a-z)';'only lower case letters allowed'],..
15
%scicos_short(%koko,2),%scicos_short(%koko,1))
17
if txt<>emptystr() then txt=part(txt(1),1);end
18
if find(txt==%scicos_short(:,1))<>[] then
19
message(txt+' already in use for '+..
20
%scicos_short( find(txt==%scicos_short(:,1)),2))
21
elseif txt==emptystr() then
22
%scicos_short=[%scicos_short(1:%koko-1,:);
23
%scicos_short(%koko+1:$,:)];%okay=%t;
24
elseif ascii(txt)>122|ascii(txt)<97 then
25
message(txt+' is not in a-z')
27
%scicos_short(%koko,1)=txt;%okay=%t;
31
%koko=find(%cor_item_exec(:,1)==Cmenu)
33
txt=x_mdialog(['Add new short cut (a-z)';'only lower case letters allowed'],..
34
%cor_item_exec(%koko,1),emptystr())
37
if find(txt==%scicos_short(:,1))<>[] then
38
message(txt+' already in use for '+..
39
%scicos_short( find(txt==%scicos_short(:,1)),2))
40
elseif ascii(txt)>122|ascii(txt)<97 then
41
message(txt+' is not in a-z')
43
%scicos_short=[%scicos_short;..
44
[part(txt(1),1),%cor_item_exec(%koko,1)]];
51
errcatch(-1,'continue')
52
save('.scicos_short',%scicos_short)
56
message('Cannot save .scicos_short in current directory')
58
%tableau=emptystr([1:100]);
59
for %Y=1:size(%scicos_short,1)
60
%tableau(-31+ascii(%scicos_short(%Y,1)))=%scicos_short(%Y,2);