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

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

modification of some headers (+some corrections) to prepare usage of the new idldoc

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