~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/metanet/ge_do_copy.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function GraphList=ge_do_copy(GraphList,xc,yc)
 
2
//Copyright INRIA
 
3
//Author : Serge Steer 2002
 
4
 
 
5
// Copyright INRIA
 
6
 
 
7
  k=ge_getnode(GraphList,[xc;yc])
 
8
  if k==[] then return,end
 
9
  
 
10
  rep(3)=-1
 
11
  dr=driver()
 
12
  x_save=GraphList.node_x(k)
 
13
  y_save=GraphList.node_y(k)
 
14
  if dr=='Rec' then driver('X11'),end
 
15
  ge_drawnodes(k) //erase
 
16
  if xget('pixmap') then xset('wshow'),end
 
17
  while rep(3)==-1 then //move loop
 
18
                        // get new position
 
19
                        rep=xgetmouse(0)
 
20
                        ge_drawnodes(k) //redraw
 
21
                        if xget('pixmap') then xset('wshow'),end
 
22
 
 
23
                        GraphList.node_x(k)=rep(1);
 
24
                        GraphList.node_y(k)=rep(2);
 
25
                        ge_drawnodes(k) //redraw
 
26
                        if xget('pixmap') then xset('wshow'),end
 
27
  end
 
28
 
 
29
  if rep(3)==2 then //cancel
 
30
    ge_drawnodes(k) //erase
 
31
    GraphList.node_x(k)=x_save
 
32
    GraphList.node_y(k)=y_save
 
33
    ge_drawnodes(k) 
 
34
    if xget('pixmap') then xset('wshow'),end
 
35
    driver(dr)
 
36
    return
 
37
  end
 
38
  //add
 
39
  ge_drawnodes(k) //erase
 
40
  GraphList=ge_add_node_copy(GraphList,k)
 
41
  driver(dr);ge_drawnodes(size(GraphList.node_x,'*')) //redraw and record
 
42
  edited=return(%t)
 
43
 
 
44
endfunction
 
45