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

Home » Public Forums » archive » Combining function graphics pan and zoom changes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Combining function graphics pan and zoom changes [message #86988] Thu, 19 December 2013 05:14 Go to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
is there a way to combine function graphics pan/zoom changes.
If you have two images in two windows and with the mouse wheel change the first image by zooming in, is there an easy way to do the same to the other image?
I'm considering using the event_handler object again, but if there is a more straight forward way... please let me know.

Cheers,
Helder
Re: Combining function graphics pan and zoom changes [message #86991 is a reply to message #86988] Thu, 19 December 2013 06:01 Go to previous messageGo to next message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le jeudi 19 décembre 2013 14:14:09 UTC+1, Helder a écrit :
> Hi,
>
> is there a way to combine function graphics pan/zoom changes.
>
> If you have two images in two windows and with the mouse wheel change the first image by zooming in, is there an easy way to do the same to the other image?
>
> I'm considering using the event_handler object again, but if there is a more straight forward way... please let me know.
>
>
>
> Cheers,
>
> Helder

Please look at the various WINDOW handler functions in the documentation.
alx.
Re: Combining function graphics pan and zoom changes [message #86993 is a reply to message #86991] Thu, 19 December 2013 06:13 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, December 19, 2013 3:01:19 PM UTC+1, alx wrote:
> Le jeudi 19 décembre 2013 14:14:09 UTC+1, Helder a écrit :
>
>> Hi,
>
>>
>
>> is there a way to combine function graphics pan/zoom changes.
>
>>
>
>> If you have two images in two windows and with the mouse wheel change the first image by zooming in, is there an easy way to do the same to the other image?
>
>>
>
>> I'm considering using the event_handler object again, but if there is a more straight forward way... please let me know.
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>> Helder
>
>
>
> Please look at the various WINDOW handler functions in the documentation.
>
> alx.

Yeah, I'm just doing that. Not that easy, but I'm getting around it. Here is what I put in the method handling wheel changes:

FUNCTION AvoidMovingObj::MouseWheel, Win, x, y, Delta, KeyMods
o = Win.GetSelect()
IF ISA(Win.GetSelect(), 'POLYLINE') && (o.NAME EQ self.Name) THEN RETURN, 0 $
ELSE BEGIN
xy = (*self.oWin).ConvertCoord(x, y, 0, /DEVICE, /TO_NORMAL)
*self.oWin->Refresh, /DISABLE
ShiftVal = [xy[0]-0.5, xy[1]-0.5]
zoomFactor = (Delta LT 0) ? 1/1.25d : 1.25d
*self.oWin->Translate, ShiftVal[0], ShiftVal[1], /NORM
*self.oWin->Scale, zoomFactor, zoomFactor
*self.oWin->Translate, -ShiftVal[0], -ShiftVal[1], /NORM
*self.oWin->Refresh
RETURN, 1
ENDELSE
END

The property self.oWin is the other object (image in my case) that is changed.
To get the zoom factor right I had to do some digging in IDL function graphic procedures... a bit tricky, but I use the same line that function graphic is using...

Cheers,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL code for finding solar zenith angle, solar azimuth angle and sun-earth distance basing on lat, lon, julian day number, utc_hours, utc_minutes and utc_seconds information
Next Topic: Trapped Error. CGPLOT:CGDEFAULTCOLOR

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

Current Time: Wed Oct 08 13:57:06 PDT 2025

Total time taken to generate the page: 0.00418 seconds