1

Topic: Good afternoon, respected. I ask the help in development of a script for LibreOffice Calc

Respected , such there is a task:
It is required to trace relocation on cells in sheet
To load a picture in a component "the Graphic control item"
It is necessary for me, when the user is moved on cells:
1) to return a current line
2) to obtain the data from a column "C" and lines on which now there is a cursor - a way to a picture (to check up that it is)
3) to load this picture in "the Graphic control item" - it at me is called Image1
Problem not in syntax Basic (I am able to program a little), namely in the organization of interceptions of events ..
On the first point dug out the working code:

Sub AddChartDataListener ()
oCell1 = ThisComponent.getSheets ().getByIndex (0).getCellRangeByName ("A5:A6")
oListener = CreateUnoListener ("MyApp _", "com.sun.star.chart.XChartDataChangeEventListener")
oCell1.addChartDataChangeEventListener (oListener)
End Sub
Sub MyApp_chartDataChanged (oEvent)
dCell = ThisComponent.getSheets ().getByIndex (0).GetCellByPosition (1,1)
MsgBox dCell. String ' dCell. Value
End Sub

The given code deduces the cell text at range editing but how to make for relocation on cells?
Who can shares the code?
Or links
Thanks all

2

Re: Good afternoon, respected. I ask the help in development of a script for LibreOffice Calc

Found the code which allows to intercept pushing of buttons.
The code the worker:

Option Explicit
Global oDocView
Global oKeyHandler
Sub RegisterKeyHandler
oDocView = ThisComponent.getCurrentController
oKeyHandler = _
createUnoListener ("MyApp _", "com.sun.star.awt. XKeyHandler")
'
writedbginfo oKeyHandler
oDocView.addKeyHandler (oKeyHandler)
End Sub
Sub UnregisterKeyHandler
oDocView.removeKeyHandler (oKeyHandler)
End Sub
Sub MyApp_disposing (oEvt)
' here becomes nothing
End Sub
Function MyApp_KeyPressed (oEvt) As Boolean
select case oEvt. KeyChar
case "t", "a", "b", "u"
MyApp_KeyPressed = True
msgbox "key" "" and oEvt. KeyChar and """it is not resolved!"
case else
MyApp_KeyPressed = False
end select
End Function
Function MyApp_KeyReleased (oEvt) As Boolean
MyApp_KeyReleased = False
End Function

Now the following task - to receive the text of a cell from a current line and a column "C"