### Hints

Various Hints.
Packagename change
When chaning the name of the Library Package, then for all apps using the package with the custom views, the layout must be reworked.
This means all by the package used custom views must be replaced by the new ones from the package with the new name.
Important Set vs set
Using SetLabelText is a routine, the S in upper case.
Using setLabelText is a property, the s in lower case.
The standards to use are like:
' Routine: Set the width of the base
`Public Sub SetWidth(Width As Double)
If Width < 100 Then Width = 100
mBase.PrefWidth = Width
End Sub`
`Public Sub GetWidth As Double
Return mBase.PrefWidth
End Sub`
' Routine: Set the height of the base
`Public Sub SetHeight(Height As Double)
If Height < 50 Then Height = 50
mBase.PrefHeight = Height
End Sub`
' Property: Get or set the top position of the base
`Public Sub setTop(Top As Double)
If Top < 0 Then Top = 0
mBase.Top = Top
End Sub`
`Public Sub getTop As Double
Return mBase.Top
End Sub`
Change Code > Refresh Custom View
If the CustomView has been added via the B4J Visual Designer, then it is adviced to remove and add the Custom View again in the B4J Visual Designer.
This is esp. the case, if properties have been changed.
List the Properties
`Public Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map)
For i = 0 To Props.Size - 1
Log(Props.GetKeyAt(i) & " = " & Props.GetValueAt(i))
Next
...
Example DesignerProperties:
'Custom View Properties
#DesignerProperty: Key:FieldValue, Displayname: Field Value, Fieldtype: String, Defaultvalue: , Description: Enter numeric value
#DesignerProperty: Key:FieldPrompt, DisplayName: Field Prompt, FieldType: String, DefaultValue: Enter numeric value, Description: Enter prompt text
#DesignerProperty: Key:FieldTooltip, DisplayName: Field Tooltip, FieldType: String, DefaultValue: , Description: Enter Tooltip for field
#DesignerProperty: Key:ButtonTooltip, DisplayName: Button Tooltip, FieldType: String, DefaultValue: Clear field, Description: Enter Tooltip for button clear
Example Output:
customType = com.rwblinn.numbertextfield
ButtonTooltip = Clear field
csType = Dbasic.Designer.MetaCustomView+CustomDataGrid
shortType = NumberTextField
FieldPrompt = Enter numeric value
FieldTooltip =
FieldValue =
type =
Form = anywheresoftware.b4j.objects.Form@10dc71
`

Changed: , Category: Custom Views, File: T6C179M1298.htm, ID: 1298