Page 1 of 1

Posted: Mon Jun 24, 2002 2:50 pm
by BackupUser
Restored from previous forum. Originally posted by naw.


Hi All,

Anyone know how to determine which Gadget has *Focus*...

I have a small applet with about 20 Text boxes - I'm using drag 'n' dropped files from
Explorer to fill in individual boxes. I'd like to be able to drop the file into the
current text box that has focus...

Alternately, I might try using Mouse X / Y co-ordinates (mmm! nasty) - maybe not.

Ta - N

Posted: Mon Jun 24, 2002 5:33 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.

There is GetFocus_() from the WinAPI.


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Tue Jun 25, 2002 3:17 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> There is GetFocus_() from the WinAPI.

Yes, this will do it; but bear in mind it returns the HANDLE, and not GADGET
NUMBER, of the gadget with the focus. So make sure you create all gadgets
with a handle (eg. sg1_hWnd=StringGadget[...]) or use the GadgetID command
to get the handle of your gadgets.

(PS. Just adding to your tip, Franco -- not implying you didn't know this).


PB - Registered PureBasic Coder

Posted: Tue Jun 25, 2002 4:50 am
by BackupUser
Restored from previous forum. Originally posted by Franco.
(PS. Just adding to your tip, Franco -- not implying you didn't know this).

PB - Registered PureBasic Coder



Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Thu Jun 27, 2002 5:47 pm
by BackupUser
Restored from previous forum. Originally posted by naw.
(PS. Just adding to your tip, Franco -- not implying you didn't know this).

PB - Registered PureBasic Coder



Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Hey thanks fellas - I appreciate your response - I didn't know about the GetFocus_() and probably wouldnt have made the connection to using the GadgetID() command to determine the gadget handle without coming across it by accident in the manual.

I'm surprised that GetFocus_() isn't implemented in the standard PB commandset (It would have been documented / X-Platform etc...)

Anyway - thanks again...