Hi,
I some of you could shed some light on this:
In short Line 57 fires an error (java.lang.class exeption)
I know its me. I am just returning to coding and seem to have forgotten everything.
The code below is a customview (XIU) module.
Everything works without the line 57 : mBase.SetBitmap(xui.LoadBitmap(File.DirAssets, "chickenknob black.png"))
I some of you could shed some light on this:
In short Line 57 fires an error (java.lang.class exeption)
I know its me. I am just returning to coding and seem to have forgotten everything.
The code below is a customview (XIU) module.
Everything works without the line 57 : mBase.SetBitmap(xui.LoadBitmap(File.DirAssets, "chickenknob black.png"))
xRotateKnob:
'Events declarations
#Event: Click
#Event: LongClick
#Event: CheckedChange(Checked As Boolean)
#RaisesSynchronousEvents: Click
#RaisesSynchronousEvents: LongClick
#RaisesSynchronousEvents: CheckedChange
#DesignerProperty: Key: BooleanExample, DisplayName: Show Seconds, FieldType: Boolean, DefaultValue: True
#DesignerProperty: Key: TextColor, DisplayName: Text Color, FieldType: Color, DefaultValue: 0xFFFFFFFF, Description: Text color
Sub Class_Globals
Private mEventName As String 'ignore
Private mCallBack As Object 'ignore
Public mBase As B4XView
Private xui As XUI 'ignore
Public Tag As Object
Private mLeft, mTop, mWidth, mHeight As Int
Private mParent As B4XView
End Sub
Public Sub Initialize (Callback As Object, EventName As String)
mEventName = EventName
mCallBack = Callback
Log ("Initialize")
End Sub
'Base type must be Object
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
'we use a Dummy obkect to get the Tag property and the Parent.
Private mDummy As B4XView
mDummy = Base
mLeft = mDummy.Left
mTop = mDummy.Top
mWidth = mDummy.Width
mHeight = mDummy.Height
Tag = mDummy.Tag
' mBackgroundColor = xui.PaintOrColorToColor(Props.Get("BackgroundColor"))
'we create a new mBase object to get the Touch event
mBase = xui.CreatePanel("mBase")
mParent = mDummy.Parent
mParent.AddView(mBase, mLeft, mTop, mWidth, mHeight)
mBase.Tag = Me
mBase.SetBitmap(xui.LoadBitmap(File.DirAssets, "chickenknob black.png"))
'mBase.Visible=True
'we remove the mDumm / Base object, no more needed
mDummy.RemoveViewFromParent
Log ("DesignerCreateView")
InitClass
End Sub
Private Sub InitClass
End Sub
Private Sub mBase_Touch (Action As Int, X As Float, Y As Float)
Select Action
Case mBase.TOUCH_ACTION_DOWN
Log("Action DOWN")
Case mBase.TOUCH_ACTION_UP
Log ("Action UP")
Case mBase.TOUCH_ACTION_MOVE
Log ("Action MOVE: X,Y =" & X & "," & Y )
End Select
End Sub
Private Sub Base_Resize (Width As Double, Height As Double)
End Sub