Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Passing Focus to a Button Gadget in BlueGUI v2

Author
Message
Dassa
19
Years of Service
User Offline
Joined: 15th Oct 2004
Location: Melbourne, Australia
Posted: 11th Jun 2005 11:20
I am trying to pass the focus to a button gadget so it can be activated from the keyboard. I am entering text into an Edit gadget then looking for the KeyDown event and Enter key(13) which sets the focus to a Button gadget using:

activategadget cmdUpdate

however, the Button gadget never seems to recieve the focus.

Is there an issue with activategadget and a Button gadget ?
Is there another way to do this ?

Thanks
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Jun 2005 08:18
Maybe you could use returnkey(), the DB command, to detect the key press.

I see what you are trying to do, but I don't think a text box will record an ASCII character 13, because it's not capable of multi-line input.

BatVink
Dassa
19
Years of Service
User Offline
Joined: 15th Oct 2004
Location: Melbourne, Australia
Posted: 12th Jun 2005 17:36
Batvink:

The problem is not in picking up the Return key as shown in the attached code - this works fine. If I use activategadget with an edit box it works fine placing a blinking carat in the editbox, however the same code with a button gadget goes nowhere.

I have devised a workaround in some cases by using the edit box and the LOSEFOCUS eventtype() to do the same action as the button gadget would (and remove the button gadget) but this will not work in all cases.

Thanks anyway.
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 13th Jun 2005 09:04
I cannot see the source, but did you remember to check for a keypress on the button as well as a mouseclick?




BlueGUI Windows Plugin
Dassa
19
Years of Service
User Offline
Joined: 15th Oct 2004
Location: Melbourne, Australia
Posted: 14th Jun 2005 07:29
Thanks for your sample Rob. I was not checking for a keypress however I guess my initial problem was the fact that the button was not showing it had the focus.

Should it visibly show it has the focus ?

When using a dialog (questionmessage) it shows the button focus and responds to TAB but I guess this is a Windows thing.

Login to post a reply

Server time is: 2024-03-29 12:46:52
Your offset time is: 2024-03-29 12:46:52