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

« back to all changes in this revision

Viewing changes to macros/metanet/ge_do_paste.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_paste(GraphList,xc,yc)
 
2
//Copyright INRIA
 
3
//Author : Serge Steer 2002
 
4
 
 
5
  global GClipBoard
 
6
  if GClipBoard==[] then return,end
 
7
  ge_disablemenus()
 
8
  reg=GClipBoard(1)
 
9
  if size(reg)==0 then return,end
 
10
  rect=matrix(GClipBoard(2),-1,1);
 
11
  xo=rect(1);yo=rect(2),rect(1)=xc;rect(2)=yc;
 
12
  [rect,btn]=dragrect(rect)
 
13
 
 
14
  if btn==2 then ge_enablemenus();edited=%f,return,end
 
15
  
 
16
  reg.node_x=reg.node_x-xo+rect(1)
 
17
  reg.node_y=reg.node_y-yo+rect(2)-rect(4)
 
18
 
 
19
  nn=size(GraphList.node_x,'*')
 
20
  for f=ge_node_fields(),
 
21
     GraphList(f)=[GraphList(f),reg(f)];
 
22
  end
 
23
  ge_drawnodes(nn+1:$)
 
24
  if reg.head<>[] then 
 
25
    reg.head=reg.head+nn;
 
26
    reg.tail=reg.tail+nn;
 
27
  end
 
28
  na=size(GraphList.head,'*')
 
29
  for f=ge_arc_fields()
 
30
    GraphList(f)=[GraphList(f),reg(f)];
 
31
  end
 
32
  ge_drawarcs(na+1:$)
 
33
  ge_add_history(list("paste",nn,na))
 
34
  ge_enablemenus();
 
35
  edited=return(%t)
 
36
endfunction