URLScan produces invalid JumpIDs

General TRichView support forum. Please post your questions here
Post Reply
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

URLScan produces invalid JumpIDs

Post by Memnarch »

Hi,
Currently using URLScan.pas for detecting URLs.

However, sometimes i load documents and the generated links have invalid jumpids(The returned itemno for the id is -1).

I am sorry that i can not share the document it occurs in, or source atm.

However, after each of the url function(except for the IsEMail, IsUrl, etc) i use Reformat. So i am a bit confused.

And what is the most recent version of the URLScan.pas?

Delphi XE on windows 7.

i'll try to create something for reproduction, but maybe someone can already answer the last question or give me some hints.

Greetings
Memnarch
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

PS: I ask for the ItemNo with the JumpID given by OnJump
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

JumpIDs are generated in the following cases:
- in TRichView - always
- in readonly TRichViewEdit, if rvoNoReadOnlyJumps is excluded from EditorOptions
- when Ctrl is pressed in TRichViewEdit, until it is released, if rvoCtrlJumps is included in EditorOptions.

As you can see, TRichViewEdit does not maintain JumpIDs, it generates them only when it is in a hypertext mode.
They are useful only in OnJump in OnRVMouseMove events.
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

But this doesn't make sense to me. Why is OnJump called, if there is no jump when i click on a link?
Memnarch
Posts: 24
Joined: Mon Jul 08, 2013 7:21 am

Post by Memnarch »

I found the source of the problem and continuing here:
http://www.trichview.com/forums/viewtop ... 5975#25975
as i don't think it is related to URLSCan.pas directly.

Greetings
Memnarch
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

OnJump is called only when clicking a link.
For an editor, this event is called only when the editor is in a hypertext mode. Normally, it is moved to a hypertext mode temporarily, when the user presses and holds Ctrl.
Post Reply