Page 1 of 1

Cursor not showing when TSRichViewEdit is in a VCL Frame

Posted: Thu Dec 13, 2018 4:15 pm
by rron
If I place a TSRichViewEdit in a frame, the cursor is not shown. When I place the same TSRichViewEdit directly in the form that contains the frame, the cursor is visible (and blinking). Using Delphi 10.3 Rio and ScaleRichView-Pre9.

Re: Cursor not showing when TSRichViewEdit is in a VCL Frame

Posted: Wed Dec 26, 2018 4:15 pm
by Sergey Tkachenko
I confirm the problem.
Quick fix: open <TRichView Dir>\ScaleRichView\Source\SclRView.pas, add to the end of the procedure TSRichViewEdit.CreateWnd:

Code: Select all

  if srvs_TimerCaret in FState then
    UpdateCaretTimer;

Re: Cursor not showing when TSRichViewEdit is in a VCL Frame

Posted: Fri Mar 22, 2019 6:30 pm
by Tavo
Hi!
I recently updated my version of ScaleRichView. I find this same problem: Cursor not showing when TSRichViewEdit is in a VCL Frame.
The same form (with a frame with a ScaleRichView) was working well until the update. The only problem that I have detected so far is that the cursor does not to blink.
Within TSRichViewEdit.WndProc(), execution enters into the second IF only once, at first. Is that data useful?

In SclRView.pas

Code: Select all

procedure TSRichViewEdit.WndProc(var Message: TMessage);
begin
  inherited;
  if IsNotRunTimeMode then
    exit;

  if not(srvs_TimerCaret in FState) and HandleAllocated then
  begin
    Include(FState, srvs_TimerCaret);
    FPageProperty.PageWidth := FPageProperty.PageWidth;
    FPageProperty.PageHeight := FPageProperty.PageHeight;
    UpdateView;
    UpdateCaretTimer;
    OldPageCount := 0;
    CalculatePageCount;
  end;
end;
Thanks for readme

Re: Cursor not showing when TSRichViewEdit is in a VCL Frame

Posted: Sat Mar 23, 2019 9:30 am
by Sergey Tkachenko
Did you apply the fix I posted in this topic?

Re: Cursor not showing when TSRichViewEdit is in a VCL Frame

Posted: Mon Mar 25, 2019 2:17 pm
by Tavo
Hello Sergey, thanks for answering.
I had not done it because-this post being so old-I thought it was already incorporated into the library.
I just did it and it works perfect! :-)
Thank you!