#Event: MePica (txt as String)
'#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.
'#DesignerProperty: Key: XXX, DisplayName: XXX, FieldType: XXX, DefaultValue: XXX, Description: XXX
Sub Class_Globals
Private mEventName As String
Private mCallBack As Object
Private mBase As B4XView
'Private xui As XUI
Private Const DefaultColorConstant As Int = -984833 'ignore
Private Button2 As B4XView
Private Label1 As B4XView
Private EditText1 As B4XView
Private CheckBox11 As B4XView
End Sub
Public Sub Initialize (CallBack As Object, EventName As String)
mEventName = EventName
mCallBack = CallBack
Dim df As EditText
df.Initialize("EditText1")
df.SingleLine = True
df.TextColor=Colors.Green
Dim b As Button
b.Initialize("Button2")
b.Typeface = Typeface.FONTAWESOME
b.TextColor=Colors.Blue
b.Text="BT"
Dim l As Label
l.Initialize("Label1")
l.Gravity=Gravity.CENTER_VERTICAL
l.TextColor=0xFFC55663
Dim t As CheckBox
t.Initialize("CheckBox11")
t.Checked=True
t.Text=""
EditText1=df
Button2=b
Label1=l
CheckBox11=t
End Sub
Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
mBase = Base
mBase.AddView(Label1, 0%x, 0%y, mBase.Width*.8, mBase.Height/2)
mBase.AddView(Button2, mBase.Width*.8, 0%y, mBase.Width*.2, mBase.Height/2)
mBase.AddView(EditText1, 0%x, mBase.Height/2, mBase.Width*.6, mBase.Height/2)
mBase.AddView(CheckBox11, mBase.Width*.6, mBase.Height/2, mBase.Width*.4, mBase.Height/2)
Label1.Text=""
EditText1.Text=""
mBase.Color= Props.Get("ColorExample")
Label1.TextColor = Props.Get("DefaultColorExample")
End Sub
Public Sub GetBase As Panel
Return mBase
End Sub
private Sub EditText1_TextChanged (Old As String, New As String)
Label1.Text=New
If IsNumber(New) Then
Label1.Text=New*2
Else
Label1.Text="N/A"
End If
End Sub
private Sub Button2_Click
CallSub2(mCallBack, mEventName & "_MePica", Label1.Text)
Log(mCallBack)
Log(mEventName)
End Sub
private Sub EditText1_EnterPressed
Log("Enter")
End Sub
private Sub EditText1_FocusChanged (HasFocus As Boolean)
Log("Focus"&HasFocus)
End Sub
private Sub Label1_Click
Log("LC")
End Sub
private Sub Label1_LongClick
Log("LLC")
End Sub
private Sub Button2_LongClick
EditText1.Text="0"
End Sub
Sub CheckBox11_CheckedChange(Checked As Boolean)
End Sub