B4A Library [B4X] BR_B4XFloatTextField

Hello everyone!
With the example of Erel library and with the help of Biswajit, we made some modifications to the original B4XFloatTextField library, recreating it with some modifications in the visual transforming into BR_B4XFloatTextField.

See how the example looked:
Note: I have no iphone to be able to test. so I only tested it on B4A and B4J.

The first two fields are the original ones (B4XFloatTextField), all the others are the modified ones (BR_B4XFloatTextField).

See how the example looked:

MainPage 2020-09-03 21-51-19.gif



1.03
  • Add Mask
    Use Description: Mask format use X or 0 to indicate the characters that will be replaced.

    1726661547157.png
 

Attachments

  • [B4XPAGES] BR_B4XFloatTextField.zip
    62.5 KB · Views: 660
  • BR_B4XFloatTextField.B4xLib
    7.3 KB · Views: 49
Last edited:

Unobtainius

Active Member
Licensed User
Longtime User
Looks great. I like it a lot
 

Glen Ponder

Member
Licensed User
Longtime User
fantastic, I have been looking for this for months. only problem is that the Horizontal/Vertical alignment does not seem to be applied.

In your example provided I am trying to center on the Horizontal alignment in the designer but at runtime the text is still left aligned.

In code if I add:
B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")
    BRB4XFloatTextField11.TextField.SetTextAlignment("CENTER", "CENTER")
End Sub

Then the text is center aligned at runtime.

many thanks
 

Lucas Siqueira

Active Member
Licensed User
Longtime User
fantastic, I have been looking for this for months. only problem is that the Horizontal/Vertical alignment does not seem to be applied.

In your example provided I am trying to center on the Horizontal alignment in the designer but at runtime the text is still left aligned.

In code if I add:
B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")
    BRB4XFloatTextField11.TextField.SetTextAlignment("CENTER", "CENTER")
End Sub

Then the text is center aligned at runtime.

many thanks

I will check to correct
 

Lucas Siqueira

Active Member
Licensed User
Longtime User
fantastic, I have been looking for this for months. only problem is that the Horizontal/Vertical alignment does not seem to be applied.

In your example provided I am trying to center on the Horizontal alignment in the designer but at runtime the text is still left aligned.

In code if I add:
B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")
    BRB4XFloatTextField11.TextField.SetTextAlignment("CENTER", "CENTER")
End Sub

Then the text is center aligned at runtime.

many thanks



the SetTextAlignment function was added to adjust the alignment, in the tbm designer two fields were added for vertical and horizontal alignment.
the library is public, feel free to change, and post the improvements :)


BRB4XFloatTextField11.SetTextAlignment("CENTER", "CENTER")


'The possible values are:
'Vertical--> TOP, CENTER, BOTTOM.
'Horizontal--> LEFT, CENTER, RIGHT.
Public Sub SetTextAlignment(vertical As String, horizontal As String)

#if B4J
Dim TextAlignment As String = vertical
If Not(vertical=horizontal) Then TextAlignment=TextAlignment&"_"&horizontal
Dim jo1 = mTextField As JavaObject
Log("TextAlignment:"&TextAlignment)
jo1.RunMethod("setAlignment", Array As Object(TextAlignment))
#Else
mTextField.SetTextAlignment( vertical , horizontal )
#End If

End Sub

1599579814011.png
 

Attachments

  • BR_B4XFloatTextField.B4xLib
    6.1 KB · Views: 422
  • BR_B4XFloatTextField.B4xLib
    6.1 KB · Views: 446

rraswisak

Active Member
Licensed User
Longtime User
Just want to report that anchor does not work when layout was loaded in SplitPane (B4J). Both use same anchor

1601046228792.png


Upper is BR_B4XFloatTextField
Below is B4XFloatTextField (XUI Views)
 
Top