Wish Event Click in BBCodeView

Lucas Siqueira

Active Member
Licensed User
Longtime User
Please modify Sub TouchPanel_Touch

B4X:
Private Sub TouchPanel_Touch (Action As Int, X As Float, Y As Float)
    Dim run As BCTextRun = Null
    If URLToLines.Size > 0 Or Action = TouchPanel.TOUCH_ACTION_UP Then
        run = FindTouchedRun(X, Y)
    End If
    If run <> Null And ParseData.URLs.ContainsKey(run) Then
        If Action = TouchPanel.TOUCH_ACTION_UP Then
            Dim url As String = ParseData.Urls.Get(run)
            CallSubDelayed2(mCallBack, mEventName & "_LinkClicked", url)
            MarkURL(Null)
        Else If (xui.IsB4i And Action = 4) Or (xui.IsB4A And Action = 3) Then 'cancelled
            MarkURL(Null)
        Else
            MarkURL(run)
        End If
        Return
    End If
     'new feature
    If Action = TouchPanel.TOUCH_ACTION_UP Then
        CallSubDelayed(mCallBack, mEventName & "_Click")
    End If
    MarkURL(Null)
End Sub

B4X:
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
...
If xui.SubExists(mCallBack, mEventName & "_linkclicked", 1) or xui.SubExists(mCallBack, mEventName & "_Click", 1) Then 
     TouchPanel = xui.CreatePanel("TouchPanel")
End If
...
End Sub
 
Last edited:

asales

Expert
Licensed User
Longtime User
+1
Only now I saw this wish (because I need this).
Will be nice to have this event in BBCodeView, without need to modify the lib by myself.
 
Top