When I first read about Erel's BCtext in this Forum (not the one in Rome) I was immediately fascinated and decided to use this in my 1st B4J project as a learning exercise (both for B4X-Pages and B4J). It said in that post (May 2019) "not 100% ready and especially it is missing another layer above the engine that will make it easier to build the text with the various options", but I could not find that layer, so I started to roll my own. Out came a tool to build an expandable xCLV list including a button designer and a table designer that lets you import tab-delimited lists with links to a DB.
All works now very nicely except for this thing with the buttons as there could be several expanded panels with one or more buttons with different functions (and I don't want to create a separate sub for each individual button as this would make it very complicated for the future users of this layer tool).
I tried several variations on line 21 with different Sub btn_click variants and even to wrap the button in an URL but could not see any result upon clicking on any of the buttons, because I could not figure out a way to add/recover multiple buttons with tags to jump to different subs (as a button on panel one could have the same function as button on panel 5, e.g. "print list").
Perhaps the BBListitem part in the library could be tweaked, I'll have a look.
Any Idea to help solving this enigma would be more than helpful. Thank you in advance.
john m.
All works now very nicely except for this thing with the buttons as there could be several expanded panels with one or more buttons with different functions (and I don't want to create a separate sub for each individual button as this would make it very complicated for the future users of this layer tool).
Sub createButton:
sub createButton
Dim btn As Button
btn.Initialize("btn")
Dim xbtn As B4XView = btn
xbtn.Text = TextField1.Text '&" "&Q.nrow
xbtn.textColor = xui.Color_White
Select Case Style1.SelectedValue
Case "dark"
xbtn.Color = xui.Color_DarkGray
Case "blue"
xbtn.Color = xui.Color_Blue
Case "red"
xbtn.Color = xui.Color_Red
Case Else '"light"
xbtn.Color = xui.Color_LightGray
xbtn.textColor = xui.Color_Black
End Select
xbtn.Tag = Label4.text
xbtn.SetLayoutAnimated(0, 0, 0, TextField3.Text, TextField4.text) 'these are actually numbers
B4XPages.MainPage.BBCodeViewM.Views.Put($"btn${Q.nRow}"$,xbtn) '
' Dim Out As String =$"[a=2]lets add a button [View=btn${Q.nRow}/] and see whats happens[/a]"$ '${Q.nRow}
Dim Out As String =$" [View=btn${Q.nRow}/] "$ 'btn${Q.nRow
Q.nRow=Q.nRow+1
' E1.TextArea1.Text = E1.TextArea1.Text & CRLF&Out
Dim A As String = E1.TextArea1.Text
Dim F As Int = E1.findstart
If F < 1 Or F > E1.TextArea1.Text.Length - 2 Then
E1.TextArea1.Text = E1.TextArea1.Text & CRLF&Out
Else
E1.TextArea1.Text = A.SubString2(0,E1.findstart).trim &Out & A.SubString(E1.findstart).trim
End If
' Log("E new text from "&E1.findstart&CRLF&E1.TextArea1.Text)
E1.showBB
End Sub
I tried several variations on line 21 with different Sub btn_click variants and even to wrap the button in an URL but could not see any result upon clicking on any of the buttons, because I could not figure out a way to add/recover multiple buttons with tags to jump to different subs (as a button on panel one could have the same function as button on panel 5, e.g. "print list").
Perhaps the BBListitem part in the library could be tweaked, I'll have a look.
Any Idea to help solving this enigma would be more than helpful. Thank you in advance.
john m.