B4J Question trouble color background with custom view class

Gianni M

Well-Known Member
Licensed User
Longtime User
into layout/form there are two PANE
Pane on the left hold 3 TextField
Pane on the right hold 3 new_text_field (custom view)
when disable Pane (left and right) the color background on left do not change, on the right they change (gray);
I do not like Pane disabled right (background color!)
is it possible to avoid?
 

Attachments

  • newTEXTFIELD.zip
    3.6 KB · Views: 142

William Lancee

Well-Known Member
Licensed User
Longtime User
Hi
I played around with this.

1. move newtext to Class_Globals
2. Add a setStyle method
B4X:
Public Sub setStyle(st As String)
    newtext.Style = st
End Sub

3. After pane is disabled, do the following
B4X:
    UsualPane1.Enabled = Not(Selected)
    UsualPane2.Enabled = Not(Selected)
    mytext1.setStyle("-fx-opacity:1")
    mytext2.setStyle("-fx-opacity:1")
    mytext3.setStyle("-fx-opacity:1")
 
Upvote 0

Gianni M

Well-Known Member
Licensed User
Longtime User
I played around with this
1) no class_global
2) no mytext1.setStyle("-fx-opacity:1")
but only add setStyle ("-fx-opacity:1") in Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map)

I was wrong?
can i add CSSUtils only one in Sub DesignerCreateView?
any suggest?
 
Upvote 0

Gianni M

Well-Known Member
Licensed User
Longtime User
another question
can i know name of View (mytext1, mytext2, mytext3) in DesignerCreateView or custom class
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
A Class is not an object, just a specification for an instance. You can refer to that instance within that specification with the keyword Me.
If you want to have different logic for different instances, add a public property (variable) to the class that you can set in the parent module.
 
Upvote 0
Top