File: getclick.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (40 lines) | stat: -rw-r--r-- 741 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
function [btn,xc,yc,win,Cmenu]=getclick(flag)
// Copyright INRIA
[lhs,rhs]=argn(0)
Cmenu=[]

if ~or(winsid()==curwin) then  Cmenu='Quit',return,end    
if rhs==1 then
  [btn,xc,yc,win,str]=xclick(flag)
else
  [btn,xc,yc,win,str]=xclick()
end

if btn==-100 then  
  if win==curwin then
    Cmenu='Quit',
  else
    Cmenu='Open/Set'
  end
  return
end    
if btn==-2 then
  // click in a dynamic menu
  xc=0;yc=0
  execstr('Cmenu='+part(str,9:length(str)-1))
  execstr('Cmenu='+Cmenu)
  return
end
if btn==0&(Cmenu==[]|Cmenu=='Open/Set')&(win<>curwin) then
jj=find(windows(:,2)==win)
  if jj <> [] then
    btn=99  //mode copy
    if or(windows(jj,1)==100000) then
      btn=111  //mode open-set (cliquer dans navigator)
    end
  end
end