Hi there !
I have a question... well i want to have a pane moving with keys into a scrollpane...
Well... i can have check keyevents and moving the pane... and any object... but scrollpane also listening for keys too.. and moving scrollbar too (that is something i don't want to be automatically)
Thought that the solution was somewhere in the middle... but as i see is not so easy or something passing in front of me...
Yes the following works for moving my b4xview that is into scrollpane... but also moving the scrollbar :-(
I have a question... well i want to have a pane moving with keys into a scrollpane...
Well... i can have check keyevents and moving the pane... and any object... but scrollpane also listening for keys too.. and moving scrollbar too (that is something i don't want to be automatically)
Thought that the solution was somewhere in the middle... but as i see is not so easy or something passing in front of me...
Yes the following works for moving my b4xview that is into scrollpane... but also moving the scrollbar :-(
dim DrawPane as Scrollpane 'loaded with layout bjl
dim SelectedB4XObject as b4xview 'can be a pane... into scrollpane...
dim stepd as int=1
...
Dim r As Reflector
r.Target = DrawPane 'drawpane is my scrollpane
r.AddEventHandler("Drawpane_KeyPressed", "javafx.scene.input.KeyEvent.ANY")
...
Sub Drawpane_KeyPressed_Event(e As Event)
Dim KE As Reflector
KE.Target = e
e.Consume 'kill it fast... but the same..
Dim keycode As String = KE.RunMethod("getCode")
Select Case keycode
'MOVING SELECTEDOBJECT WITH KEYS...
Case "UP"
SelectedB4XObject.TOP=SelectedB4XObject.TOP-stepd
Case "DOWN"
SelectedB4XObject.TOP=SelectedB4XObject.TOP+stepd
End Select
End Sub