Using B4J 10.0 64-bit on Windows 11.
I seem to have run into a parameter that is in the internal designer, but not accessible, built-in, programmatically.
In this case it is the color of a text box. I thought this would be trivial.
In the Internal designer, you can just select the color from a handy RGB palette, or from a drop-down of named colors. Great!
Is there a txtbox.color= or txtbox.setcolor() or txtbox.backgroundcolor or similar available in the code? From what I can find, no.
I did some searching in the forums. Near as I can tell, I need to load an additional Java library to do this? That can't be right, can it?
In my searching I came across B4XXUIViews and its "B4XFloatTextField", which is an enhanced version of the text field, which has:
B4XFloatTextField1.mBase.Color=nn (this one's popup help says it "Gets or sets the background color")
and
B4XFloatTextField1.mBase.SetColorAndBorder(a,b,c,d) (this one's popup help says it "sets the background and border color")
(The help doesn't say what the range of valid values is for either. Where is that info?)
Anyway, I created a new project with the defaults, added that library, added a plain B4XFloatTextField to my project, but no matter what number I use, nothing changes. The B4XFloatText field doesn't change, the border doesn't change, it doesn't matter what numbers I use, not for the background or the border.
That's when I stopped. I must just be approaching this fundamentally wrong. I'm on some kind of wild goose chase. Any help? TIA!
I've attached an image if it isn't clear what I'm trying to do, a GIF of what the test app output is, and the .zip of the test app.
I seem to have run into a parameter that is in the internal designer, but not accessible, built-in, programmatically.
In this case it is the color of a text box. I thought this would be trivial.
In the Internal designer, you can just select the color from a handy RGB palette, or from a drop-down of named colors. Great!
Is there a txtbox.color= or txtbox.setcolor() or txtbox.backgroundcolor or similar available in the code? From what I can find, no.
I did some searching in the forums. Near as I can tell, I need to load an additional Java library to do this? That can't be right, can it?
In my searching I came across B4XXUIViews and its "B4XFloatTextField", which is an enhanced version of the text field, which has:
B4XFloatTextField1.mBase.Color=nn (this one's popup help says it "Gets or sets the background color")
and
B4XFloatTextField1.mBase.SetColorAndBorder(a,b,c,d) (this one's popup help says it "sets the background and border color")
(The help doesn't say what the range of valid values is for either. Where is that info?)
Anyway, I created a new project with the defaults, added that library, added a plain B4XFloatTextField to my project, but no matter what number I use, nothing changes. The B4XFloatText field doesn't change, the border doesn't change, it doesn't matter what numbers I use, not for the background or the border.
sample:
Private Sub Button1_Click
'xui.MsgboxAsync("Hello world!", "B4X")
Private bgcolor,borderwidth,bordercolor,borderradius As Int
bgcolor=Rnd(0,1024)
borderwidth=Rnd(0,20)
bordercolor=Rnd(1024,32768)
borderradius=Rnd(0,45)
B4XFloatTextField1.mBase.Color=bgcolor
B4XFloatTextField1.mBase.SetColorAndBorder(bgcolor,borderwidth,bordercolor,borderradius)
B4XFloatTextField1.TextField.Color=bgcolor
B4XFloatTextField1.Text=bgcolor & ", " & borderwidth & ", " & bordercolor & ", " & borderradius
End Sub
That's when I stopped. I must just be approaching this fundamentally wrong. I'm on some kind of wild goose chase. Any help? TIA!
I've attached an image if it isn't clear what I'm trying to do, a GIF of what the test app output is, and the .zip of the test app.