B4J Question BCTextengine/BBCodeView Initialize

Guenter Becker

Active Member
Licensed User
Longtime User
Hello,
I've an B4J and B4A customview and like to use BBCodeView like:
Code inside custom view class:
'#create pane
        Dim p As Pane: p.initialize("ItemBBlbl")
        p.PrefWidth=Width: p.prefheight = height
        '# create label
        BCT.Initialize(mBase)
        Dim BBlbl As BBCodeView:
        BBlbl.Initialize(mBase, "ItemBBLbl")
        BBlbl.Text=Text '<-------- !
        '# add BBlbl to pane
        p.AddNode(BBlbl.tag,0,0,p.PrefWidth,p.PrefHeight)

Tried to initialize TextEngine and CodeView (mCallback, Main.MainForm, Me, mbase). If it comes to BBlbl.Text row it stops with error message that the BBlbl is not initialized. Please Anyone to point me to my failure.
Thank you
 

William Lancee

Well-Known Member
Licensed User
Longtime User
BBCodeView is a custom view and has to be added to the panel by way of the Designer Layout [.LoadLayout("..")]
This is because it is really a class with multiple views.
It is still simple to do. I create a layout with only the custom view with full anchors, save it as for example "CCV". Then do pnl.LoadLayout("CCV")
 
Upvote 0

Guenter Becker

Active Member
Licensed User
Longtime User
Thank you it's working by loading via layout.
 
Upvote 0
Top