File: do_icon_edit.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (54 lines) | stat: -rw-r--r-- 943 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function scs_m=do_icon_edit(scs_m) 
// do_block - edit a block icon
// Copyright INRIA
while %t
  [btn,xc,yc,win,Cmenu]=getclick()
  if Cmenu<>[] then
    Cmenu=resume(Cmenu)
  end
  K=getblock(scs_m,[xc;yc])
  if K<>[] then break,end
end

gr_i=scs_m(K)(2)(9)

if type(gr_i)<>15 then
  gr_i=list(gr_i,[],list('sd',[0 0 1 1]))
end
oldwin=xget('window')
win=winsid()
if win==[] then
  win=0
else
  win=max(win)+1
end
xset('window',win)
xselect()
coli=gr_i(2)
sd=gr_i(3)

sd=gr_menu(sd);xdel(win)
txt=sd2sci(sd,['sz(1)','sz(2)'],['orig(1)','orig(2)'])
txt(1)=[]
gr_i=['thick=xget(''thickness'')';
     'pat=xget(''pattern'')';
     'fnt=xget(''font'')';
     txt
     'xset(''thickness'',thick)'
     'xset(''pattern'',pat)'
     'xset(''font'',fnt(1),fnt(2))']

xset('window',oldwin)

mac=null();deff('[]=mac()',gr_i,'n')
if check_mac(mac) then
  o=scs_m(K)
  drawblock(o)
  o(2)(9)=list(gr_i,coli,sd)
  drawblock(o)
  scs_m(K)=o
  break
end