Page 2 of 2

Posted: Fri May 31, 2013 7:34 pm
by Martian
TRichView.UseStyleTemplates = False
Still can't find the problem :?

Posted: Mon Jun 03, 2013 3:54 pm
by Sergey Tkachenko
Ok, we found that TerminateHyperlink is called.
Next question - is GetNonHypertextStyleNo called?

Posted: Mon Jun 03, 2013 7:06 pm
by Martian
On the first VK_RETURN GetNonHypertextStyleNo doesn't call but on the second - calls but doesn't close URL.

How RVE processes VK_RETURN? Maybe it intercepts it somewhere else?

Posted: Tue Jun 04, 2013 6:25 am
by Sergey Tkachenko
Sorry, I do not understand your answer.
What is called and what is not called?

Posted: Tue Jun 04, 2013 8:00 am
by Martian
When I press Enter after some URL for the first time - GetNonHypertextStyleNo does NOT calls and text style stays blue underlined.

If I press Enter again (cursor is on the next line after the URL already) - GetNonHypertextStyleNo CALLS but does not close URL style and on the 3rd line I still have blue underlined font.

Only after TAB or SPACE it works fine.

Posted: Wed Jun 05, 2013 5:29 am
by Sergey Tkachenko
I am afraid I cannot help without a project reproducing the problem.

Posted: Wed Jun 26, 2013 7:07 am
by Martian
I have no idea why this happens. I didn't change my code - just updated to a new RVE and problem is here. Tried everything (maybe not). Problem persists. And I'm not alone here, I didn't create this topic.

Posted: Thu Jun 27, 2013 11:03 am
by Sergey Tkachenko
This topic was created almost 4 years ago. And, actually, the problem was in using OnKeyPress.
For Enter, you need to use OnKeyDown.

Posted: Thu Jun 27, 2013 6:37 pm
by Martian
Yeah I know and posted my code with OnKeyDown. Still investigating...

Posted: Fri Aug 16, 2013 8:12 am
by Martian
Still CANNOT fight this bug! RVE 14.7.1, Delphi XE4, Windows 7

Just try your Demos\DelphiUnicode\Assorted\Hypertext\CreateHyperlink demo - it has the same bug! Press ENTER after the "Hyperlink example".
Create new hyperlink and press ENTER.

Posted: Fri Aug 16, 2013 12:27 pm
by Sergey Tkachenko
I confirm the problem, URL termination does not work on Enter if StyleTemplates are not used (if they are used, the component terminates kinks on Enter automatically).

It will be fixed in the next update.
A quick fix:
RVERVData.pas, TRVEditRVData.GetNextStyleNo, add the red lines:

Code: Select all

    // if styles are not used
    if (StyleNo=FCurTextStyleNo) and (TextStyle.NextStyleNo>=0) then
      Result := TextStyle.NextStyleNo
    [color=red]else
       Result := FCurTextStyleNo[/color];
    exit;

Posted: Fri Aug 16, 2013 6:50 pm
by Martian
Finally! It works. Thanks.