Android Question DesignerProperty FieldType as Double instead of Int?

zed

Well-Known Member
Licensed User
Is it possible to define a DesignerProperty FieldType as Double instead of Int?
If I define the type as Double, this property is no longer used in the designer.
I could work around the problem by adding a property that defines Int or Decimal, but I'm not sure if that's the right way to do it.

#DesignerProperty:
#DesignerProperty: Key: Step, DisplayName: Step Increment, FieldType: int, Value: 1, Description: Step, DefaultValue: 1
#DesignerProperty: Key: StepMode, DisplayName: Step Mode, FieldType: string, Value: "int", Description: "int or decimal", DefaultValue: "int"

B4X:
Dim stepMode As String = Props.Get("StepMode")
Dim stepInt As Int = Props.Get("Step")

If stepMode = "decimal" Then
    StepIncremental = stepInt / 10.0   ' 1 becomes 0.1
Else
    StepIncremental = stepInt          ' 1 stay 1
End If
 

LucaMs

Expert
Licensed User
Longtime User
Is it possible to define a DesignerProperty FieldType as Double instead of Int?
1763200244153.png
 
Upvote 1
Top