Gianni M Well-Known Member Licensed User Longtime User Apr 16, 2020 #1 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 newTEXTFIELD.zip 3.6 KB · Views: 269
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?
William Lancee Well-Known Member Licensed User Longtime User Apr 16, 2020 #2 Hi I played around with this. 1. move newtext to Class_Globals 2. Add a setStyle method B4X: Copy Public Sub setStyle(st As String) newtext.Style = st End Sub 3. After pane is disabled, do the following B4X: Copy 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
Hi I played around with this. 1. move newtext to Class_Globals 2. Add a setStyle method B4X: Copy Public Sub setStyle(st As String) newtext.Style = st End Sub 3. After pane is disabled, do the following B4X: Copy UsualPane1.Enabled = Not(Selected) UsualPane2.Enabled = Not(Selected) mytext1.setStyle("-fx-opacity:1") mytext2.setStyle("-fx-opacity:1") mytext3.setStyle("-fx-opacity:1")
Gianni M Well-Known Member Licensed User Longtime User Apr 16, 2020 #3 perfect! @William Lancee Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 17, 2020 #4 This is a mistake to set the style like this. You should use CSSUtils. Otherwise you will override other CSS attributes. Upvote 0
This is a mistake to set the style like this. You should use CSSUtils. Otherwise you will override other CSS attributes.
Gianni M Well-Known Member Licensed User Longtime User Apr 17, 2020 #5 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
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?
Erel B4X founder Staff member Licensed User Longtime User Apr 17, 2020 #6 You can use CSSUtils anywhere you like. Upvote 0
Gianni M Well-Known Member Licensed User Longtime User Apr 17, 2020 #7 Erel said: You can use CSSUtils anywhere you like. Click to expand... ok! now i have add in DesignerCreateView Code: Copy CSSUtils.SetStyleProperty(tfField, "-fx-opacity", "1") perfect! Upvote 0
Erel said: You can use CSSUtils anywhere you like. Click to expand... ok! now i have add in DesignerCreateView Code: Copy CSSUtils.SetStyleProperty(tfField, "-fx-opacity", "1") perfect!
Gianni M Well-Known Member Licensed User Longtime User Apr 17, 2020 #8 another question can i know name of View (mytext1, mytext2, mytext3) in DesignerCreateView or custom class Upvote 0
another question can i know name of View (mytext1, mytext2, mytext3) in DesignerCreateView or custom class
William Lancee Well-Known Member Licensed User Longtime User Apr 17, 2020 #9 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
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.
William Lancee Well-Known Member Licensed User Longtime User Apr 17, 2020 #10 It is preferable to keep that logic in the parent. A common way is to add a Tag property that the parent set and gets as needed. Upvote 0
It is preferable to keep that logic in the parent. A common way is to add a Tag property that the parent set and gets as needed.