Help of compareEndPoints method


Abdel
 

Hi dear friends,

With Paul's help, I just wrote a page describing the compareEndPoints method used in textInfo objects.

You will find it here:

https://github.com/nvdaaddons/nvdaaddons.github.io/wiki/compareEndPoints

Kind regards,
Abdel.


Noelia Ruiz
 

Hi Abdel and all:

This is great!
I maintain placeMarkersadd-on, with Chris LM as an author too.
And I cannot use bookmarks in Microsoft Edge. Now I'm trying to use
the procedure explained by you in the treeInterceptor, but the result
is 1 or -1 regardles of the position. If you can help with this, we
may improve this add-on.
Here's some code:


treeInterceptor = obj.treeInterceptor
if isinstance(treeInterceptor, BrowseModeDocumentTreeInterceptor)
and not treeInterceptor.passThrough:
obj = treeInterceptor
...
cur = obj.makeTextInfo(textInfos.POSITION_CARET)
bookmark = cur.bookmark
if hasattr(bookmark, "startOffset"):
if bookmark.startOffset in bookmarks:Perform some tasks
else:
first = obj.makeTextInfo(textInfos.POSITION_FIRST)
position = first._rangeObj.CompareEndPoints(UIAHandler.TextPatternRangeEndpoint_Start,
cur._rangeObj, UIAHandler.TextPatternRangeEndpoint_Start)

Thanks.

2022-07-01 22:28 GMT+02:00, Abdel <abdelkrim.bensaid@...>:

Hi dear friends,

With Paul's help, I just wrote a page describing the compareEndPoints
method used in textInfo objects.

You will find it here:

https://github.com/nvdaaddons/nvdaaddons.github.io/wiki/compareEndPoints

Kind regards,
Abdel.







Abdel
 

Hi dear Noelia,

First of all, sorry for the delay in the answer, I was absent during almost all the Weekend, I have just read your message.

I'll study the question and will answer you during the week.

Thanks for your appreciation.

Kind regards,
Abdel.

Le 02/07/2022 à 15:28, Noelia Ruiz a écrit :
Hi Abdel and all:

This is great!
I maintain placeMarkersadd-on, with Chris LM as an author too.
And I cannot use bookmarks in Microsoft Edge. Now I'm trying to use
the procedure explained by you in the treeInterceptor, but the result
is 1 or -1 regardles of the position. If you can help with this, we
may improve this add-on.
Here's some code:


treeInterceptor = obj.treeInterceptor
if isinstance(treeInterceptor, BrowseModeDocumentTreeInterceptor)
and not treeInterceptor.passThrough:
obj = treeInterceptor
...
cur = obj.makeTextInfo(textInfos.POSITION_CARET)
bookmark = cur.bookmark
if hasattr(bookmark, "startOffset"):
if bookmark.startOffset in bookmarks:Perform some tasks
else:
first = obj.makeTextInfo(textInfos.POSITION_FIRST)
position = first._rangeObj.CompareEndPoints(UIAHandler.TextPatternRangeEndpoint_Start,
cur._rangeObj, UIAHandler.TextPatternRangeEndpoint_Start)

Thanks.

2022-07-01 22:28 GMT+02:00, Abdel <abdelkrim.bensaid@...>:
Hi dear friends,

With Paul's help, I just wrote a page describing the compareEndPoints
method used in textInfo objects.

You will find it here:

https://github.com/nvdaaddons/nvdaaddons.github.io/wiki/compareEndPoints
Kind regards,
Abdel.








Noelia Ruiz
 

Thanks dear Abdel:
May not be possible to fix this issue for placeMarkers add-on, or you may find a solution. I found out that bookmarks canbe saved in pickle files as objects, not just as integers representing offsets, and then those bookmarks can be used to move to them. But in Edge using UIA, bookmarks cannot be pickled since they are weakref objects.
I"ll wait for your answer and, as always, your work and excellent attitude with people is hihgly appreciated.

Enviado desde mi iPhone

El 3 jul 2022, a las 23:40, Abdel <abdelkrim.bensaid@...> escribió:

Hi dear Noelia,

First of all, sorry for the delay in the answer, I was absent during almost all the Weekend, I have just read your message.

I'll study the question and will answer you during the week.

Thanks for your appreciation.

Kind regards,
Abdel.

Le 02/07/2022 à 15:28, Noelia Ruiz a écrit :
Hi Abdel and all:

This is great!
I maintain placeMarkersadd-on, with Chris LM as an author too.
And I cannot use bookmarks in Microsoft Edge. Now I'm trying to use
the procedure explained by you in the treeInterceptor, but the result
is 1 or -1 regardles of the position. If you can help with this, we
may improve this add-on.
Here's some code:


treeInterceptor = obj.treeInterceptor
if isinstance(treeInterceptor, BrowseModeDocumentTreeInterceptor)
and not treeInterceptor.passThrough:
obj = treeInterceptor
...
cur = obj.makeTextInfo(textInfos.POSITION_CARET)
bookmark = cur.bookmark
if hasattr(bookmark, "startOffset"):
if bookmark.startOffset in bookmarks:Perform some tasks
else:
first = obj.makeTextInfo(textInfos.POSITION_FIRST)
position = first._rangeObj.CompareEndPoints(UIAHandler.TextPatternRangeEndpoint_Start,
cur._rangeObj, UIAHandler.TextPatternRangeEndpoint_Start)

Thanks.

2022-07-01 22:28 GMT+02:00, Abdel <abdelkrim.bensaid@...>:
Hi dear friends,

With Paul's help, I just wrote a page describing the compareEndPoints
method used in textInfo objects.

You will find it here:

https://github.com/nvdaaddons/nvdaaddons.github.io/wiki/compareEndPoints
Kind regards,
Abdel.