(Subject completed by @Lupp )
If possible please give a practice file.
You will find the subject discussed here: [Solved] Automatically highlighting the active row (View topic) • Apache OpenOffice Community Forum.
There you also find a suggested solution by myself (2017-11-14) which uses ConditionalFormatting, but also requires to assign a Sub to the sheet event onSelectionChanged.
Since I don’t feel the need, I don’t actually use it. Your comments are welciome, however, but you might better comment there ( https://forum.openoffice.org/en/ ) than here.
tdf#33201 (One of the grey-haired feature requests.)
[Edit 2021-05-31 about 13:20 GMT]
Well, there were examples given in the linked thread already.
However, in a playful mood I made a new one using again the CF feature, but in a slightly different way.
If it should be done this way the all-sheet-CF as I examplified it should be the first one of all CF definitions for the sheet, and additional ones need to be created wit the
To get the CF as needed, the condition must call a user function evaluating the address of the cell currently having the focus. Column and row of this address are kept in global variables for efficiency. Anyway you need to call a routine by the sheet event
onSeectionChanged, and this rotine writes to the mentioned global variables.
The remaining problem is that I don’t know a way to simply refresh the view to get the new situation resgarded by CF. I therefore call two changes of the visibility for a window (ComponentWindow or ContainerWindow) which causes an annoying delay - and slightly irritating effects depending on the variant.
Basically the solution works as expected. See attached example. focusCross.ods
Horrible, on every Click the whole Frame is
unvisible for roundabout 2 seconds
It’s much less than 2 s for me,
To do it with the
frame.ComponentWindow is faster.
Of course, a method directly refreshing the CF would be preferable.
Anyway that’s a shortcoming of the API (if at all). Do you know better?
Myself I neither need nor use such a “crosshair”, but it’s requested now and then. If I want to guide my eye in sheets with narrow columns/rows, I use conditional faint coloring the old listing-paer-style.
it’s much less than 2 s for me.
I’m on RaspberryPi, not actually the fastest Hardware on the Planet;-(
Do you know better?
No, I will not dive into that kind of stuff, if either it should be implemented in C++source … or never
Since the workarounds are that incredibly horrible, you surely will rework the source.