Android Question inconvertible types for own Class

Tayfur

Well-Known Member
Licensed User
Longtime User
hello guys..

I recived this error.
My class run with "activit.laout()"...
So it s broke like under below. (manuel loading)

adsız.JPG


B4X:
Public Sub DesignerCreateView(Base As Panel, Lbl As Label, Props As Map)
'Public Sub DesignerCreateView(Base As Panel, Lbl As Label, Props As Map)
'****** we use the Base panel as the background panel
'*****************DESINGER MODU İÇİN GEREKLİ*************************************************

Log("desinger create-1")

    Ana_Panel = Base
'   
'    ' initialize the foreground panel and add it onto the background panel
    'ltbPanelFront.Initialize("ltbPanelFront")   
    pnl.Initialize("pnl")
    'Ana_Panel.AddView(ltbPanelFront, 0, 0, Ana_Panel.Width, Ana_Panel.Height)
    Ana_Panel.AddView(pnl, 0, 0, Ana_Panel.Width, Ana_Panel.Height)
'    ' initialize the foreground panel rectangle used to erase ltbPanelFront
'    rectPanelFront.Initialize(0, 0, ltbPanelFront.Width, ltbPanelFront.Height)
    'ltbPanelFront.BringToFront   
    pnl.BringToFront   
    'ltbPanelFront.Color=Colors.Blue
'   
'    Init
    Log("******desinger create******")
    def_image_loader
   
    If SubExists(Callback, EventName & "_Intelized") Then
        CallSubDelayed(Callback, EventName & "_Intelized")
    End If
   
'****** limitbar demnodan alındı.
'****** costumview direkt eklemek için
End Sub

'**** Manuel yükleme yöntemi
'<code>Gazete.Initialize(Me, "Gazete")
'Gazete.Intilaze_Manuel_Loader(Activity, 10dip, 100dip, 100%x - 20dip, 30dip, Colors.Green,5dip)</code>
Public Sub Initialize(CallbackModule As Object, cEventName As String)
    Log("Initialize-1")
    Callback = CallbackModule
    EventName = cEventName
    'Msgbox("intaliza","")
    Timer_Autohide.Initialize("Timer_Autohide",10000)
    Timer_Autohide.Enabled=False
    Log("intakizeeeeeeeeeeeeee")
   
End Sub
 

Tayfur

Well-Known Member
Licensed User
Longtime User
I added your code in my class

So Error is same.

My class declarations... (it is correct?)

Sub Class_Globals
Private Callback As Object ' calling module
Private EventName As String ' event name
Private cLimitLeft As Int ' value of the left limit
Private cLimitRight As Int
Private Ana_Panel As Panel
 
Upvote 0

Tayfur

Well-Known Member
Licensed User
Longtime User
I checked againg your user guide and limitbar demo.
For mauled loading I must the own "AddView" sub.
itis corrocet??? @Erel
Bucause, your sample has same error with "Activity.Addview...."

B4X:
ltbTest.Initialize(Me,"ltbTest")
    ltbTest.AddView(Activity,10,10,100,100,5,5)
    'Activity.AddView(ltbTest,10,10,100,100)


B4X:
Public Sub AddView(Parent As Activity, cLeft As Int, cTop As Int, cWidth As Int, cHeight As Int, cColor As Int, cRadius As Int)
    Log("add view")
    cHeight = Max(cHeight, 30dip)                ' limits the height to min 30dip
    cRadius = Min(cRadius, cHeight / 2)    ' limits the max radius to half the height
   
    ' initialize the background panel ltbPanelBack and add it onto the parent view
    ltbPanelBack.Initialize("")
    Parent.AddView(ltbPanelBack, cLeft, cTop, cWidth, cHeight)
    ' initialize and set the ColorDrawable for the background panel
    Dim cdw As ColorDrawable
    cdw.Initialize(cColor, cRadius)
    ltbPanelBack.Background = cdw
   
    ' initialize the foreground panel ltbPanelFront and add it onto the parent view
    ltbPanelFront.Initialize("ltbPanelFront")
    Parent.AddView(ltbPanelFront, cLeft, cTop, cWidth, cHeight)
    ' initialize the foreground panel rectangle used to erase ltbPanelFront
    rectPanelFront.Initialize(0, 0, ltbPanelFront.Width, ltbPanelFront.Height)
    ltbPanelFront.BringToFront   
   
    Init
End Sub
 
Upvote 0
Top