currently focused gadget
BlitzPlus Forums/BlitzPlus Programming/currently focused gadget
| ||
Alright! Does anybody know if their is a way to get the currently focused gadget?? or even better does any body know if their is a way to test for either an 'ongadgetfocus' or a 'ongadgetblur' event (my own event names)?? If their isn't and one of the blitz development team are reading, are you planning to add the above events as they would be incredibly useful (espeically for the text field and text area).....go on, you know you wanna!!!! Ta Brine |
| ||
See, Mark? Told ya we needed ActiveGadget! :) |
| ||
I second that^^ |
| ||
Yeah, how can we implement dialog-style tabbing otherwise? (Is there a way?) |
| ||
I want too. soja - you would have to use the mouse down event to keep track of the last gadget selected and work out where to go from that. Would be easier if we had the ability to set the tab order of gadget the way you can in VB |
| ||
...you would have to use the mouse down event to keep track of the last gadget selected ... But MouseDown only works on canvases, so that wouldn't be feasible. Similarly, I thought you might be able to wait for a GadgetAction event and then find out what gadget it came from, but apparently a change of focus does not qualify as a GadgetAction. |
| ||
But MouseDown only works on canvases, so that wouldn't be feasible. Doh :( That makes the project I intended to work on next about a hundred times harder. |
| ||
Getting the currently focused gadget: Declaration: .lib "user32.dll" GetFocus%():"GetFocus" Then in your .bb code, just call GetFocus(), which will return either 0 (if your window isn't up front) or the gadget handle that has focus. NOTE: the Windows gadget handle won't equal the Blitz gadget handle. You must compare it to QueryObject(gadget, 1). Example: If GetFocus() = QueryObject(mygadget, 1) Then Notify "MyGadget is selected" |
| ||
Nice on man, that bit of info should come in v.helpful! |
| ||
Yes. Good one Soja. Thanks. |