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

Home » Public Forums » archive » Putting the cursor in a field
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Putting the cursor in a field [message #5624 is a reply to message #5520] Fri, 19 January 1996 00:00 Go to previous messageGo to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <4dldpd$39g@n.ruf.uni-freiburg.de>, ps@kis.uni-freiburg.de (Peter Suetterlin) writes:
|>
|> In article <4dif86$t7q@ratatosk.uio.no>,
|> steinhh@amon.uio.no (Stein Vidar Hagfors Haugan) writes:
|> >
|> >In article <19960116.172716.831183.NETNEWS@WVNVM.WVNET.EDU>,
|> mbrown@olie.wvitcoe.wvnet.edu (Myron Brown) writes:
|> >|>
|> >|> Hi. I'm looking for a way to display the cursor inside
|> >|> a field when the field is displayed. I'm using CW_FIELD
|> >|> to create the field. The user has to place the cursor
|> >|> inside the field by clicking the mouse button inside the
|> >|> field. It would be nice if he didn't have to. This seems
|> >|> like an easy thing to do; I just can't find out how. Could
|> >|> someone help me?
|> >|>
|> >
|> >Using WIDGET_CONTROL,TEXT_WIDGET_ID,/INPUT_FOCUS sets the
|> >keyboard input focus to the specified text widget (same
|> >effect as clicking inside the field).
|>
|> I'm afraid that is only half the truth. The question - as I
|> understood - was to place the mouse-cursor at a specified position.
|> It is possible (as can be seen e.g. in widget_message) But I never
|> found out how it is done :-( So I'd also like to know.
|>

Yes, that's possible too! I just discovered it myself a couple of
days ago.

The TVCRS procedure can be used to move the mouse cursor anywhere,
even outside the (possibly unmapped) currently selected draw window.

The following example should demonstrate this:

base = widget_base(/row)
text = widget_text(base,xsize=100)
dummy= widget_base(base,map=0)
draw = widget_draw(dummy,xsize=1,ysize=1)
widget_control,base,/realize
widget_control,draw,get_value=window
wset,window
tvcrs,-200,-20,/device
widget_control,text,/input_focus

You just have to match the X,Y device coordinates to where you want the
mouse cursor to appear.

Regards,

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Routine to read files in pdb-format?
Next Topic: Postscript for different paper sizes

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

Current Time: Fri Oct 10 04:11:36 PDT 2025

Total time taken to generate the page: 0.88130 seconds