Android Question How to use FocusChanged event of B4XFloatTextField in B4XPreferencesDialog?

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Trying to trigger a custom keyboard when a B4XFloatTextField is clicked in the B4XPreferencesDialog and having trouble doing this.
Have tried via the FocusChanged event and also via the EnterPressed event.
Any suggestions how this should be done?

RBS
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
You will need to modify the code for this.
I have been trying to make it work by modifying the code of the PreferencesDialog module of the B4XPreferencesDialog b4xlib, but sofar with no success.
Using the eventname B4XFloatTextField1 as in the textitem layout doesn't work.
Any hint how this should be done?

RBS
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
You will need to modify the code for this.
This post:


Suggests I need to alter the code of the B4XFloatTextField module in the XUIView b4xlib to make use of the FocusChanged event.
Is that so?
I was thinking I could do it by just altering the code of B4XPreferencesDialog.

RBS
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I think I got this sorted now:
The event name of the B4XFloatTextField in the layout file of the B4XPreferencesDialog is: B4XFloatTextField1
I added a log to the XUI View.b4xlib file and the expected event name is in fact: b4xfloattextfield1, so all in lower case.
Changing the event sub in the B4XPreferencesDialog.b4xlib:

B4X:
Sub b4xfloattextfield1_FocusChanged(bHasFocus As Boolean)    
    Log("b4xfloattextfield1_FocusChanged, bHasFocus: " & bHasFocus)
End Sub

Made it so that the event was picked up.

RBS
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…