As an example, if you take the "Gadget" example program and add a check for lost focus and a debug message under "Case 0" (the stringgadget), you'll see a "lost focus" message pop up in the debug window each time you type a character.
Stringgadget and lost focus
Stringgadget and lost focus
Just curious why I get a "lost focus" event for a stringgadget each time I type in a character (although the focus actually stays on the stringgadget). I get the lost focus event using either #PB_EventType_LostFocus or #EN_KILLFOCUS.
As an example, if you take the "Gadget" example program and add a check for lost focus and a debug message under "Case 0" (the stringgadget), you'll see a "lost focus" message pop up in the debug window each time you type a character.
As an example, if you take the "Gadget" example program and add a check for lost focus and a debug message under "Case 0" (the stringgadget), you'll see a "lost focus" message pop up in the debug window each time you type a character.
-
Sub-Routine
- User

- Posts: 82
- Joined: Tue May 03, 2005 2:51 am
- Location: Wheeling, Illinois, USA
- Contact:
Sorry, I didn't make this clear - I've got a "lost focus" routine in my program and everything works OK -- it's just that the "lost focus" routine gets executed every time a character is entered. It seems to be getting both a "Change" and "Lost focus" event with each character, although the focus isn't actually "lost" -- it stays on the stringgadget until you actually tab or click to another gadget.
-
Sub-Routine
- User

- Posts: 82
- Joined: Tue May 03, 2005 2:51 am
- Location: Wheeling, Illinois, USA
- Contact:
Here is how I use it:
The Final_Drive_Whole_Input is a string gadget which I interpret into a Float value in Final_Drive which updates only one gadget, and updates for every keypress.
After the user moves to another gadget (LostFocus) GearRatios (as many as 35 gadgets) and Speed_Per_Mile (a ListIcon, often containing 200 or more entries) are updated.
I don't understand why it isn't functioning for you.
Rand
Code: Select all
ElseIf GadgetID = #Final_Drive_Whole_Input
Gosub Final_Drive
If EventType() = #PB_EventType_LostFocus
Gosub GearRatios
Gosub Speed_Per_Mile
EndIfAfter the user moves to another gadget (LostFocus) GearRatios (as many as 35 gadgets) and Speed_Per_Mile (a ListIcon, often containing 200 or more entries) are updated.
I don't understand why it isn't functioning for you.
Rand
