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

Home » Public Forums » archive » Re: change mouse cursor in draw widget
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
Re: change mouse cursor in draw widget [message #64893] Thu, 29 January 2009 06:01
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
On Jan 29, 8:53 am, "AndiBif...@googlemail.com"
<AndiBif...@googlemail.com> wrote:

> problem with the device keyword is that in this case my cursor will
> look like the new cursor in my whole widget and not only in the draw
> widget. but i guess this is the better tradeoff.

Hi Andi,

If you enable tracking events for your draw widget, you can change the
cursor when the pointer enters or leaves the widget. This will let
you set the cursor for an individual widget rather than the whole
hierarchy. For example, in your event handler, deal with tracking
events something like this:

case tag_names(event, /structure_name) of
'WIDGET_TRACKING': begin
if event.enter then begin
;; switch to the cursor for this widget:
device, cursor_standard=40
endif else begin
;; switch to my default cursor:
device, /cursor_crosshair
endelse
end
'WIDGET_DRAW': begin
;; deal with draw events...
end
else: ;; deal with other event types...
endcase


Mike
Re: change mouse cursor in draw widget [message #64894 is a reply to message #64893] Thu, 29 January 2009 05:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AndiBiffar@googlemail.com writes:

> i am pretty sure i don't understand all the consequences :)
>
> problem with the device keyword is that in this case my cursor will
> look like the new cursor in my whole widget and not only in the draw
> widget. but i guess this is the better tradeoff.

Change your cursor when you enter the draw widget. (You
will have to turn TRACKING_EVENTS on for your draw widget.)
Then switch it back to the original cursor when you leave
the draw widget. Just be sure to move your cursor S-L-O-W-L-Y
as you cross the threshold. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: change mouse cursor in draw widget [message #64895 is a reply to message #64894] Thu, 29 January 2009 05:53 Go to previous message
AndiBiffar is currently offline  AndiBiffar
Messages: 7
Registered: October 2008
Junior Member
On 29 Jan., 14:49, David Fanning <n...@dfanning.com> wrote:
> AndiBif...@googlemail.com writes:
>> i have an interface including a button to be able to move objects in a
>> draw widget. In order to inform the user the user that he or she is
>> currently in the mode to move objects i would like to change the
>> cursor icon.
>
>> As far as i understand thsi is only possible if i have defined the
>> draw widget as an object using graphics_level=2 in the definition of
>> the widget? However if i add this to the definition of my draw widget
>> it will be treated like an object and the rest of my programm using
>> commands like wset wont work anymore.
>
>> Is there an alternative to change the cursor icon? What would be the
>> alternative to wset?
>
> Uh, I'm not sure you are understanding all the possible
> implications of switching to an object graphics draw widget.
> In particular, *everything* about your current program will
> change. :-)
>
> But, you can change the cursor shape in direct graphics windows, too.
> Check out the CURSOR_IMAGE, CURSOR_STANDARD, and CURSOR_ORIGINAL
> keywords to the DEVICE command. You are limited only by your
> imagination.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thx David,

i am pretty sure i don't understand all the consequences :)

problem with the device keyword is that in this case my cursor will
look like the new cursor in my whole widget and not only in the draw
widget. but i guess this is the better tradeoff.

Cheers,
Andi
Re: change mouse cursor in draw widget [message #64896 is a reply to message #64895] Thu, 29 January 2009 05:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AndiBiffar@googlemail.com writes:

> i have an interface including a button to be able to move objects in a
> draw widget. In order to inform the user the user that he or she is
> currently in the mode to move objects i would like to change the
> cursor icon.
>
> As far as i understand thsi is only possible if i have defined the
> draw widget as an object using graphics_level=2 in the definition of
> the widget? However if i add this to the definition of my draw widget
> it will be treated like an object and the rest of my programm using
> commands like wset wont work anymore.
>
> Is there an alternative to change the cursor icon? What would be the
> alternative to wset?

Uh, I'm not sure you are understanding all the possible
implications of switching to an object graphics draw widget.
In particular, *everything* about your current program will
change. :-)

But, you can change the cursor shape in direct graphics windows, too.
Check out the CURSOR_IMAGE, CURSOR_STANDARD, and CURSOR_ORIGINAL
keywords to the DEVICE command. You are limited only by your
imagination.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: change mouse cursor in draw widget
Next Topic: ERRPLOT using object Graphics .... ?

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

Current Time: Wed Oct 08 18:13:48 PDT 2025

Total time taken to generate the page: 0.00741 seconds