comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Keeping objects fixed in function graphics
items: Re: Keeping objects fixed in function graphics

Keeping objects fixed in function graphics
type: item
description: Hi, since I spent the last half an hour trying to figure this out, I thought I might as well share this. The reason and idea behind this, was to draw in a window where I have an image some sort of markers that stay where they are. For example a grid or an aiming target or crosshair. One should be able to pan and zoom the image below it, but not these objects on top. Well, this is how I did it. Let me know if you know of a better/cleaner way, otherwise I'll stick to this. What I did was basically turn off the event handlers for mouse movements and any other sort. Here is the code: ;################################# FUNCTION AvoidMovingObj::MouseDown, oWin, x, y, iButton, KeyMods, nClicks RETURN, 1 END FUNCTION AvoidMovingObj::MouseMotion, oWin, x, y, KeyMods RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') END FUNCTION AvoidMovingObj::MouseUp, oWin, x, y, iButton RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') END FUNCTION AvoidMovingObj::MouseWheel, oWin, x, y, Delta, KeyMods RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') END PRO AvoidMovingObj__define void = {AvoidMovingObj, inherits GraphicsEventAdapter} END PRO AvoidMovingObjTest p = PLOT(/test) e = ellipse(0.5,0.5, '-r2', FILL_BACKGROUND=0, /norm) e.window.EVENT_HANDLER=Obj_New('AvoidMovingObj') END ;################################# There are two clear drawbacks in this way of working: 1) if there are ellipses that one would like to move, than I should make sure that the correct ellipse (or object) is not moved and the rest is moved. I think this is solvable, but I didn't spend time on it yet 2) this seems to be an intrinsic drawback of this method: when clicking on the "unmovable" object, the mouse cursor will stay as it is until another object has been clicked. Not terrible, but not elegant. I hope I'm not the only one in need for this and if you have suggestion on how to improve this... very welcome! Cheers, Helder
creator: Helder Marchetto
date: 2013-12-19T12:40:06-00:00

Re: Keeping objects fixed in function graphics
type: item
description: On Thursday, December 19, 2013 1:40:06 PM UTC+1, Helder wrote: > Hi, > > since I spent the last half an hour trying to figure this out, I thought I might as well share this. > > The reason and idea behind this, was to draw in a window where I have an image some sort of markers that stay where they are. For example a grid or an aiming target or crosshair. > > One should be able to pan and zoom the image below it, but not these objects on top. > > Well, this is how I did it. Let me know if you know of a better/cleaner way, otherwise I'll stick to this. > > What I did was basically turn off the event handlers for mouse movements and any other sort. Here is the code: > > > > ;################################# > > FUNCTION AvoidMovingObj::MouseDown, oWin, x, y, iButton, KeyMods, nClicks > > RETURN, 1 > > END > > > > FUNCTION AvoidMovingObj::MouseMotion, oWin, x, y, KeyMods > > RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > > END > > > > FUNCTION AvoidMovingObj::MouseUp, oWin, x, y, iButton > > RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > > END > > > > FUNCTION AvoidMovingObj::MouseWheel, oWin, x, y, Delta, KeyMods > > RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > > END > > > > PRO AvoidMovingObj__define > > void = {AvoidMovingObj, inherits GraphicsEventAdapter} > > END > > > > PRO AvoidMovingObjTest > > p = PLOT(/test) > > e = ellipse(0.5,0.5, '-r2', FILL_BACKGROUND=0, /norm) > > e.window.EVENT_HANDLER=Obj_New('AvoidMovingObj') > > END > > ;################################# > > > > There are two clear drawbacks in this way of working: > > 1) if there are ellipses that one would like to move, than I should make sure that the correct ellipse (or object) is not moved and the rest is moved. I think this is solvable, but I didn't spend time on it yet > > 2) this seems to be an intrinsic drawback of this method: when clicking on the "unmovable" object, the mouse cursor will stay as it is until another object has been clicked. Not terrible, but not elegant. > > > > I hope I'm not the…
creator: Helder Marchetto
date: 2013-12-19T13:10:03-00:00

Re: Keeping objects fixed in function graphics
type: item
description: Le jeudi 19 décembre 2013 14:10:03 UTC+1, Helder a écrit : > On Thursday, December 19, 2013 1:40:06 PM UTC+1, Helder wrote: > >> Hi, > >> > >> since I spent the last half an hour trying to figure this out, I thought I might as well share this. > >> > >> The reason and idea behind this, was to draw in a window where I have an image some sort of markers that stay where they are. For example a grid or an aiming target or crosshair. > >> > >> One should be able to pan and zoom the image below it, but not these objects on top. > >> > >> Well, this is how I did it. Let me know if you know of a better/cleaner way, otherwise I'll stick to this. > >> > >> What I did was basically turn off the event handlers for mouse movements and any other sort. Here is the code: > >> > >> > >> > >> ;################################# > >> > >> FUNCTION AvoidMovingObj::MouseDown, oWin, x, y, iButton, KeyMods, nClicks > >> > >> RETURN, 1 > >> > >> END > >> > >> > >> > >> FUNCTION AvoidMovingObj::MouseMotion, oWin, x, y, KeyMods > >> > >> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >> END > >> > >> > >> > >> FUNCTION AvoidMovingObj::MouseUp, oWin, x, y, iButton > >> > >> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >> END > >> > >> > >> > >> FUNCTION AvoidMovingObj::MouseWheel, oWin, x, y, Delta, KeyMods > >> > >> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >> END > >> > >> > >> > >> PRO AvoidMovingObj__define > >> > >> void = {AvoidMovingObj, inherits GraphicsEventAdapter} > >> > >> END > >> > >> > >> > >> PRO AvoidMovingObjTest > >> > >> p = PLOT(/test) > >> > >> e = ellipse(0.5,0.5, '-r2', FILL_BACKGROUND=0, /norm) > >> > >> e.window.EVENT_HANDLER=Obj_New('AvoidMovingObj') > >> > >> END > >> > >> ;################################# > >> > >> > >> > >> There are two clear drawbacks in this way of working: > >> > >> 1) if there are ellipses that one would like to move, than I should make sure that the correct ellipse (or object) is not moved and the rest is moved. I think this is…
creator: lecacheux.alain
date: 2013-12-19T13:56:51-00:00

Re: Keeping objects fixed in function graphics
type: item
description: On Thursday, December 19, 2013 2:56:51 PM UTC+1, alx wrote: > Le jeudi 19 décembre 2013 14:10:03 UTC+1, Helder a écrit : > >> On Thursday, December 19, 2013 1:40:06 PM UTC+1, Helder wrote: > >> > >>> Hi, > >> > >>> > >> > >>> since I spent the last half an hour trying to figure this out, I thought I might as well share this. > >> > >>> > >> > >>> The reason and idea behind this, was to draw in a window where I have an image some sort of markers that stay where they are. For example a grid or an aiming target or crosshair. > >> > >>> > >> > >>> One should be able to pan and zoom the image below it, but not these objects on top. > >> > >>> > >> > >>> Well, this is how I did it. Let me know if you know of a better/cleaner way, otherwise I'll stick to this. > >> > >>> > >> > >>> What I did was basically turn off the event handlers for mouse movements and any other sort. Here is the code: > >> > >>> > >> > >>> > >> > >>> > >> > >>> ;################################# > >> > >>> > >> > >>> FUNCTION AvoidMovingObj::MouseDown, oWin, x, y, iButton, KeyMods, nClicks > >> > >>> > >> > >>> RETURN, 1 > >> > >>> > >> > >>> END > >> > >>> > >> > >>> > >> > >>> > >> > >>> FUNCTION AvoidMovingObj::MouseMotion, oWin, x, y, KeyMods > >> > >>> > >> > >>> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >>> > >> > >>> END > >> > >>> > >> > >>> > >> > >>> > >> > >>> FUNCTION AvoidMovingObj::MouseUp, oWin, x, y, iButton > >> > >>> > >> > >>> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >>> > >> > >>> END > >> > >>> > >> > >>> > >> > >>> > >> > >>> FUNCTION AvoidMovingObj::MouseWheel, oWin, x, y, Delta, KeyMods > >> > >>> > >> > >>> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >>> > >> > >>> END > >> > >>> > >> > >>> > >> > >>> > >> > >>> PRO AvoidMovingObj__define > >> > >>> > >> > >>> void = {AvoidMovingObj, inherits GraphicsEventAdapter} > >> > >>> > >> > >>> END > >> > >>> > >> > >>> > >> > >>> > >> > >>> PRO AvoidMovingObjTest > >> > >>> > >> > >>> p = PLOT(/test) > >> > >>> > …
creator: Helder Marchetto
date: 2013-12-19T14:14:53-00:00

Re: Keeping objects fixed in function graphics
type: item
description: Le jeudi 19 décembre 2013 15:14:53 UTC+1, Helder a écrit : > On Thursday, December 19, 2013 2:56:51 PM UTC+1, alx wrote: > >> Le jeudi 19 décembre 2013 14:10:03 UTC+1, Helder a écrit : > >> > >>> On Thursday, December 19, 2013 1:40:06 PM UTC+1, Helder wrote: > >> > >>> > >> > >>>> Hi, > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> since I spent the last half an hour trying to figure this out, I thought I might as well share this. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> The reason and idea behind this, was to draw in a window where I have an image some sort of markers that stay where they are. For example a grid or an aiming target or crosshair. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> One should be able to pan and zoom the image below it, but not these objects on top. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> Well, this is how I did it. Let me know if you know of a better/cleaner way, otherwise I'll stick to this. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> What I did was basically turn off the event handlers for mouse movements and any other sort. Here is the code: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> ;################################# > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> FUNCTION AvoidMovingObj::MouseDown, oWin, x, y, iButton, KeyMods, nClicks > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> RETURN, 1 > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> END > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> FUNCTION AvoidMovingObj::MouseMotion, oWin, x, y, KeyMods > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> END > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> FUNCTION AvoidMovingObj::MouseUp, oWin, x, y, iButton > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> RETURN, ~ISA(oWin.GetSelect(), 'ELLIPSE') > >> > >>> > >> > >>>> > >…
creator: lecacheux.alain
date: 2013-12-19T14:25:44-00:00