I am trying to wrap my head around custom views with designer support.
I read several times
https://www.b4x.com/android/forum/threads/b4x-custom-views-with-enhanced-designer-support.62488/
And tried to apply the description, but am getting nowhere. I know how to add a DesignerCreateView such as below, but after that, how do I create the actual custom view ?
There are several examples posted in the thread, but they are all B4J so I cannot look at them.
I read several times
https://www.b4x.com/android/forum/threads/b4x-custom-views-with-enhanced-designer-support.62488/
And tried to apply the description, but am getting nowhere. I know how to add a DesignerCreateView such as below, but after that, how do I create the actual custom view ?
There are several examples posted in the thread, but they are all B4J so I cannot look at them.
B4X:
#Event: ExampleEvent (Value As Int)
#DesignerProperty: Key: BooleanExample, DisplayName: Boolean Example, FieldType: Boolean, DefaultValue: True, Description: Example of a boolean property.
#DesignerProperty: Key: IntExample, DisplayName: Int Example, FieldType: Int, DefaultValue: 10, MinRange: 0, MaxRange: 100, Description: Note that MinRange and MaxRange are optional.
#DesignerProperty: Key: StringWithListExample, DisplayName: String With List, FieldType: String, DefaultValue: Sunday, List: Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
#DesignerProperty: Key: StringExample, DisplayName: String Example, FieldType: String, DefaultValue: Text
#DesignerProperty: Key: ColorExample, DisplayName: Color Example, FieldType: Color, DefaultValue: 0xFFCFDCDC, Description: You can use the built-in color picker to find the color values.
#DesignerProperty: Key: DefaultColorExample, DisplayName: Default Color Example, FieldType: Color, DefaultValue: Null, Description: Setting the default value to Null means that a nullable field will be displayed.
Sub Class_Globals
Private EventName As String 'ignore
Private CallBack As Object 'ignore
Private mBase As Panel
Private Const DefaultColorConstant As Int = -984833 'ignore
End Sub
Public Sub Initialize (vCallback As Object, vEventName As String)
EventName = vEventName
CallBack = vCallback
End Sub
Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
mBase = Base
End Sub
Public Sub GetBase As Panel
Return mBase
End Sub
Last edited: