B4J Question Scrolling in BBCodeView

T201016

Active Member
Licensed User
Longtime User
Hi,
How can I set the same scroll position for BBCodeView1, in case I scroll manually BBCodeView2 marked
in the photo number two? I temporarily get this through the Timer:

Sub Timer_Tick
BBCodeView1.sv.ScrollViewOffsetY = BBCodeView2.sv.ScrollViewOffsetY
End Sub

Can it be done programmatically via an event for BBCodeView2 ?
 

Attachments

  • ScreenShot00003.png
    ScreenShot00003.png
    17.1 KB · Views: 291
Solution
I used a different method to solve the problem. I modified the BCTextEngine library a bit, making some small changes.

Project - B4J (in standard class HTMLEditorWrapper)
Added :
Code: Copy
'Transfer the vertical scroll position from BBCodeView1
Sub BBCodeView1_VScrollView(V As Double)
    If BBCodeView2.sv.ScrollViewOffsetY <> V Then
        BBCodeView2.sv.ScrollViewOffsetY = V
    End If
End Sub

'Transfer the vertical scroll position from BBCodeView2
Sub BBCodeView2_VScrollView(V As Double)
    If BBCodeView1.sv.ScrollViewOffsetY <> V Then
        BBCodeView1.sv.ScrollViewOffsetY = V
    End If
End Sub
BCTextEngine LIB V1.92 - B4J (in standard class BBCodeView)
Added :
Code: Copy
#if B4J
Private Sub sv_VScrollChanged (Position As...
Only by modifying the source code and exposing this event.

The timer solution should work. Test it in release mode.
Hello Erel,
a pity, that is, it has its own scrolling service.
This is how the timer works during the test. Thanks for the info.
 
Upvote 0
I used a different method to solve the problem. I modified the BCTextEngine library a bit, making some small changes.

Project - B4J (in standard class HTMLEditorWrapper)
Added :
Code: Copy
'Transfer the vertical scroll position from BBCodeView1
Sub BBCodeView1_VScrollView(V As Double)
    If BBCodeView2.sv.ScrollViewOffsetY <> V Then
        BBCodeView2.sv.ScrollViewOffsetY = V
    End If
End Sub

'Transfer the vertical scroll position from BBCodeView2
Sub BBCodeView2_VScrollView(V As Double)
    If BBCodeView1.sv.ScrollViewOffsetY <> V Then
        BBCodeView1.sv.ScrollViewOffsetY = V
    End If
End Sub
BCTextEngine LIB V1.92 - B4J (in standard class BBCodeView)
Added :
Code: Copy
#if B4J
Private Sub sv_VScrollChanged (Position As Double)
    If LazyLoading Then DrawVisibleRegion
    If xui.SubExists(mCallBack, mEventName & "_VScrollView", 1) Then
        CallSubDelayed2(mCallBack, mEventName & "_VScrollView", sv.ScrollViewOffsetY) 'Transfer the vertical scroll position
    End If
End Sub

Now scrolling BBCodeView1 its counterpart BBCodeView2 scrolls automatically. I think that this is a bit better way than using Timer.
 

Attachments

Upvote 0
Solution
Back
Top