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: 78
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 :
Project - B4J (in standard class HTMLEditorWrapper):
'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 :
BCTextEngine LIB V1.92 - B4J (in standard class BBCodeView):
#if B4J
Private Sub sv_VScrollChanged (Position As...

T201016

Active Member
Licensed User
Longtime User
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

T201016

Active Member
Licensed User
Longtime User
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 :
Project - B4J (in standard class HTMLEditorWrapper):
'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 :
BCTextEngine LIB V1.92 - B4J (in standard class BBCodeView):
#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

  • BCTextEngine LIB1.92 lib.zip
    95.2 KB · Views: 59
Upvote 0
Solution
Top