Removing Selection

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Removing Selection

Post by palmeira »

If I select some text (or an entire document) and click in part of the selection, sometimes the selection is removed, but more often it is not. Is there a way to make the selection always be removed?

Edit: I also use a component TRVAPopupMenu with live spell checking. If I right click a mispelled word, it does no display the suggestions provided by the spell checker. In order to make it work correctly, I have added the following code to the OnMouseDown event:

if Button = mbright then
if ve1.GetSelText = '' then
begin
{Simulate mouse move}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
{Simulate the left mouse button up}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, x, y, 0, 0);
end;
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

What version SRV do you use?
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As for spell checking.
You need to call this code:

Code: Select all

  RVA_GetRichViewEditFromPopupComponent :=
   SRVGetRichViewEditFromPopupComponent;
one time when the application starts, for example in the initialization section of the main form unit.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

Thanks for the posts.

1) I am using ScaleRichView version 2.0.3.

2) I had already added the popup code. The popup is shown when I right click a word, the problem is that the correction suggestions are not (unless I simulate a left click, as mentioned.) Anyway, I reported this just for your information, as I already have a work-around.
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

In ScaleRichView version 2.0.3 were problems with selection. Load ScaleRichView version 2.0.4.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

I have just installed version 2.0.4, but it has not solved the problem.
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Is the problem with selection persistent? I.e. if you repeat the same actions again, the result is the same? If yes, please give the step-by-step instuction how to select text and then click so that the selection is not cleared.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

Sometimes the selection is cleared, sometimes it is not. I have the same problem with the rvaction demo (with scalerichview), but I am not sure e-mailing the source or the executable would be any help, as I have not changed the source.

I have, however, applied the patch to RVECaretMove:

procedure TSclRVRuler.RVECaretMove(Sender: TObject);
var
RemCanUpdate : Boolean;
begin
if not FSRichViewEdit.CanUpdateMargin then
Exit;
UpdateRulerIndents;
UpdateTableEditor;
if PageCurrent <> FSRichViewEdit.CurrentPage then
begin
RemCanUpdate := FSRichViewEdit.CanUpdate;
if RemCanUpdate then
FSRichViewEdit.CanUpdate := FALSE;
Scrolled;
UpdateTableEditor;
if RemCanUpdate <> FSRichViewEdit.CanUpdate then
FSRichViewEdit.CanUpdate := RemCanUpdate;
end;

if Assigned(FRVECaretMove) then
FRVECaretMove(Sender);
end;

I will check it tomorrow it that is what is causing the selection not to be cleared.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

I reverted to the original code, but it made no difference: when I click inside a selection, most often the selection is not cleared, as before.
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

You can send me example EXE of a file in which there is an error? I cannot reproduce a problem with selection.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

The files have been sent
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

I have looked. This bug has already been fixed. You downloaded SRV the version v2.0.4? In the new version this bug has been fixed. I have sent you the corrected version. Soon we will download updating.
palmeira
Posts: 139
Joined: Mon Sep 12, 2005 10:18 pm

Post by palmeira »

Thanks. Everything works perfectly now.
Post Reply