comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » middle mouse button emulation in widget_draw
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
middle mouse button emulation in widget_draw [message #45979] Fri, 21 October 2005 11:35 Go to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Hi all,

I was wondering if anybody has dealt with the following: In the IDL help
for widget_draw, "Note on Middle Mouse Button Emulation", it sais:

When a user holds down the Control key and presses the left mouse button
within a draw widget, IDL emulates a middle mouse button press. This
means that the event structure generated will have the PRESS field set
to 2 (middle button) and the MODIFIERS field set to 0 (no modifier). IDL
will never generate an event with PRESS set to 1 (left button) and
MODIFIERS set to 2 (control).

But (see test_draw.pro at the end of the message):

IDL Version 6.2, Microsoft Windows (Win32 x86 m32). (c) 2005, Research
Systems, Inc.
IDL> .compile test_draw
IDL> test_draw
;; Ctrl + Left-Click in draw widget
** Structure WIDGET_DRAW, 12 tags, length=44, data length=37:
ID LONG 564
TOP LONG 563
HANDLER LONG 564
TYPE INT 0
X LONG 59
Y LONG 20
PRESS BYTE 1
RELEASE BYTE 0
CLICKS LONG 1
MODIFIERS LONG 2
CH BYTE 0
KEY LONG 0
** Structure WIDGET_DRAW, 12 tags, length=44, data length=37:
ID LONG 564
TOP LONG 563
HANDLER LONG 564
TYPE INT 1
X LONG 59
Y LONG 20
PRESS BYTE 0
RELEASE BYTE 1
CLICKS LONG 1
MODIFIERS LONG 2
CH BYTE 0
KEY LONG 0



Same on IDL Version 6.2 (linux x86 m32), by the way.

So I guess it's safe to check for PRESS = 1 and MODIFIERS = 2, or does
anybody have other experiences? Any comments?

Thanks,
Benjamin


;;---------------------------------------------------------- ----
PRO test_draw_event, event

help, event, /str

END

PRO test_draw

tlb = widget_base()
draw = widget_draw(tlb, xs=100, ys=100, /button_events, $
event_PRO='test_draw_event')

widget_control, tlb, /realize

xmanager, 'draw', tlb, /no_block

END
[Message index]
 
Read Message
Read Message
Previous Topic: Re: problem:symbol not be showed in IdlgrPlot object etc.
Next Topic: rebinning histogram

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:58:00 PDT 2025

Total time taken to generate the page: 1.20384 seconds