File: draw.input

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (95 lines) | stat: -rw-r--r-- 2,326 bytes parent folder | download | duplicates (3)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
!set anstype=yes
!set anstyle=dprompt

!if $wims_read_parm=def
  !exit
!endif
!if $printing=yes
  !set i=$wims_read_parm
  !set id=$(iii)_$i
!else
  !set id=$i
!endif
!set color=!getopt color in $(replyoption$i)
!default color=blue
!set input_rg=$(replygood$i)
!set type=!text remove 0123456789. in $(input_rg[2;1])
!default type=points
!set input_img=$(input_rg[1;1])
!set inputsize=!replace internal $	$ by $\
$  in $inputsize
!set input_rg=!lines2rows $(input_rg)
!set inputsize=!nonempty lines $inputsize
!if ?analyze isin $input_img
  !set type=!line 2 of $inputsize
  !set parm3=!line 3 to -1 of $inputsize
!else
  !set type=$(input_rg[2;1])
  !set parm3=$(input_rg[1;])
!endif
!set Inputsize=!line 1 of $inputsize
!set testinput=!text remove 0123456789x in $Inputsize

!if $testinput issametext $empty
  !set Inputsize=!replace internal x by , in $Inputsize
  !distribute items $Inputsize into xsize,ysize
!endif
!default xsize=400
!default ysize=400

!set parm3=!trim $parm3
!set parm3=!declosing $parm3
!set parm3=!replace internal $	$ by $\
$ in $parm3
!set parm3=!rows2lines $parm3
!set arrow_head=!getopt arrow_head in $(replyoption$i)
!default arrow_head=10

!if $type iswordof arrows
  !set option=$arrow_head,
!endif
!set type=!trim $type
!set oef_answer_option$i=$xsize,$ysize\
$parm3\
$type $color,$option

!! premire ligne : le code
!! deuxime ligne : segments, liste des segments etc

!! mettre couleur en option

!if $type iswordof circles
  !set replyformat=28
!endif
!if $type iswordof polyline
  !set replyformat=23
!endif
!!!if $type iswordof arrows segments
!!  !set replyformat=11
!!!endif
!default replyformat=22

!set parm3=$parm3\
replyformat $replyformat\
userdraw $type,$color
!read oef/canvasdraw.phtml $xsize,$ysize\
$parm3\
inputstyle color:black;background-color:white;font-size:1.3em;\
clearbutton $wims_name_erase
!set canvasid=!text select 0123456789 in $canvasdraw_idclass
!if $printing!=yes
  <script>
  /*<![CDATA[*/
  function my_canvasdraw$id() {
    fun = eval('read_canvas$canvasid');
    if (fun != undefined){
      p = fun();
      if( p != undefined) { document.getElementById('oefvar' + $i).value=p; }
    }
  }
  /*]]>*/
  </script>
  <input type="hidden" id="oefvar$i" name="reply$i" value="">
!endif
!reset inputsize
!set oef_js_submit=$oef_js_submit my_canvasdraw$id();