ScrollArea: Add a NoAnimation property to disable the scrolling animation explicitly.

[GB.GUI.BASE]
* NEW: ScrollArea: Add a NoAnimation property to disable the scrolling animation explicitly.
This commit is contained in:
gambas 2021-02-05 21:08:52 +01:00
parent 92161125f0
commit 09554420b3

View file

@ -30,6 +30,7 @@ Property NoShadow As Boolean
Property Read View As DrawingArea Property Read View As DrawingArea
Property UseMouse As Boolean Property UseMouse As Boolean
Property Read Scrolling As Boolean Property Read Scrolling As Boolean
Property NoAnimation As Boolean Use $bNoAnimation
Event Scroll Event Scroll
Event Draw Event Draw
@ -503,7 +504,7 @@ End
Private Sub ScrollX_Write(Value As Integer) Private Sub ScrollX_Write(Value As Integer)
If Application.Animations Then If Application.Animations And If Not $bNoAnimation Then
Scroll(Value, $iTargetY) Scroll(Value, $iTargetY)
Else Else
Scroll(Value, $iScrollY) Scroll(Value, $iScrollY)
@ -519,7 +520,7 @@ End
Private Sub ScrollY_Write(Value As Integer) Private Sub ScrollY_Write(Value As Integer)
If Application.Animations Then If Application.Animations And If Not $bNoAnimation Then
Scroll($iTargetX, Value) Scroll($iTargetX, Value)
Else Else
Scroll($iScrollX, Value) Scroll($iScrollX, Value)
@ -569,7 +570,7 @@ Public Sub Scrollbar_Change()
If $iTargetX <> $iScrollX Or If $iTargetY <> $iScrollY Then If $iTargetX <> $iScrollX Or If $iTargetY <> $iScrollY Then
If Application.Animations And If Not $bIgnoreNextAnimation Then If Application.Animations And If Not $bIgnoreNextAnimation And If Not $bNoAnimation Then
If Not $hTimerScroll Then If Not $hTimerScroll Then
$hTimerScroll = New Timer As "TimerScroll" $hTimerScroll = New Timer As "TimerScroll"
@ -779,7 +780,7 @@ End
Private Sub GetActualScroll(ByRef SX As Integer, ByRef SY As Integer) Private Sub GetActualScroll(ByRef SX As Integer, ByRef SY As Integer)
If Application.Animations Then If Application.Animations And If Not $bNoAnimation Then
SX = $iScrollX SX = $iScrollX
SY = $iScrollY SY = $iScrollY
Else Else
@ -858,7 +859,7 @@ Public Sub EnsureVisible(X As Integer, Y As Integer, W As Integer, H As Integer)
CX = -CX CX = -CX
CY = -CY CY = -CY
If Application.Animations Then If Application.Animations And If Not $bNoAnimation Then
If $iTargetX = CX And If $iTargetY = CY Then Return True If $iTargetX = CX And If $iTargetY = CY Then Return True
Else Else
If $iScrollX = CX And If $iScrollY = CY Then Return True If $iScrollX = CX And If $iScrollY = CY Then Return True
@ -1046,7 +1047,7 @@ End
Private Function Scrolling_Read() As Boolean Private Function Scrolling_Read() As Boolean
If Application.Animations Then If Application.Animations And If Not $bNoAnimation Then
If $iTargetX <> $iScrollX Or If $iTargetY <> $iScrollY Then Return True If $iTargetX <> $iScrollX Or If $iTargetY <> $iScrollY Then Return True
Endif Endif