Page 1 of 1
Removing Selection
Posted: Fri Feb 13, 2009 11:07 pm
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;
Posted: Mon Feb 16, 2009 2:30 pm
by proxy3d
What version SRV do you use?
Posted: Mon Feb 16, 2009 4:19 pm
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.
Posted: Mon Feb 16, 2009 10:10 pm
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.
Posted: Tue Feb 17, 2009 11:08 am
by proxy3d
In ScaleRichView version 2.0.3 were problems with selection. Load ScaleRichView version 2.0.4.
Posted: Tue Feb 17, 2009 5:24 pm
by palmeira
I have just installed version 2.0.4, but it has not solved the problem.
Posted: Tue Feb 17, 2009 6:10 pm
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.
Posted: Tue Feb 17, 2009 8:36 pm
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.
Posted: Fri Feb 20, 2009 3:31 am
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.
Posted: Sat Feb 21, 2009 3:45 pm
by proxy3d
You can send me example EXE of a file in which there is an error? I cannot reproduce a problem with selection.
Posted: Sat Feb 21, 2009 11:22 pm
by palmeira
The files have been sent
Posted: Sun Feb 22, 2009 11:55 am
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.
Posted: Mon Feb 23, 2009 11:02 pm
by palmeira
Thanks. Everything works perfectly now.