source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.pro @ 297

Last change on this file since 297 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @param EVENT
8;
9; @returns
10;
11; @uses
12;
13; @restrictions
14;
15; @examples
16;
17; @history
18;
19; @version
20; $Id$
21;
22; @todo
23; seb
24;
25;-
26;
27FUNCTION identifyclick, event
28;
29  compile_opt idl2, strictarrsubs
30;
31   widget_control, event.id, get_uvalue=uval, /no_copy
32   thisEvent = TAG_NAMES(event, /Structure)
33   if thisEvent EQ 'WIDGET_TIMER' then press = 0 ELSE press = event.press
34;
35;  d/0/>1 -------->t/1/0--------->**d/2/0**    long click
36;         -------->d/1/0--------->**t/2/0**  normal click
37;                       --------->**d/2/>1**-------->d/3/0----->t/0/0  double click
38;                                           -------->t/3/0----->d/0/0  double click
39   type = 'inutile'
40   case 1 OF
41; d/0/0 1er reascending
42      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 0 AND press EQ 0:
43; d/0/>1 1er click of the series
44      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 0 AND press ge 1:BEGIN
45         uval.x = [event.x, 0]
46         uval.y = [event.y, 0]
47         uval.press = press
48         uval.click = 1
49         widget_control, event.id, timer = .3
50      END
51; d/1/0 1er reascending
52      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 1 AND press EQ 0:uval.click = 2
53; d/2/0 End of the long click
54      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 2 AND press EQ 0:BEGIN
55         type = 'long'
56         uval.x = [uval.x[0],event.x] & uval.x = uval.x[sort(uval.x)]
57         uval.y = [uval.y[0],event.y] & uval.y = uval.y[sort(uval.y)]
58         uval.click = 0
59         uval.press = event.release
60      END
61; d/2/>1
62      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 2 AND press ge 1:BEGIN
63         type = 'double'
64         uval.press = press
65         uval.click = 3
66      END
67; d/3/0 reascending and end of the double click
68      thisEvent EQ 'WIDGET_DRAW' AND uval.click EQ 3 AND press EQ 0:uval.click = 0
69; t/0/0 End of the double click
70      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 0 AND press EQ 0:
71; t/1/0 long click
72      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 1 AND press EQ 0:uval.click = 2
73; t/2/0 normal click
74      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 2 AND press EQ 0:BEGIN
75         type = 'single'
76         press = uval.press
77         uval.click = 0
78      END
79; t/3/0 End of the double click
80      thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 3 AND press EQ 0:uval.click = 0
81; Impossible case in theory:
82      ELSE:BEGIN
83         print, thisEvent, uval.click, press
84         print, 'Probleme, cas normalement impossible!'
85      END
86   endcase
87
88   widget_control, event.id, set_uvalue=uval, /no_copy
89   return, {type:type}
90end
Note: See TracBrowser for help on using the repository browser.