Cursor not showing when TSRichViewEdit is in a VCL Frame

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
rron
Posts: 3
Joined: Tue Mar 25, 2008 12:14 am
Contact:

Cursor not showing when TSRichViewEdit is in a VCL Frame

Post by rron » Thu Dec 13, 2018 4:15 pm

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.

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

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

Post by Sergey Tkachenko » Wed Dec 26, 2018 4:15 pm

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;

Tavo
Posts: 122
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

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

Post by Tavo » Fri Mar 22, 2019 6:30 pm

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

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

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

Post by Sergey Tkachenko » Sat Mar 23, 2019 9:30 am

Did you apply the fix I posted in this topic?

Tavo
Posts: 122
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

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

Post by Tavo » Mon Mar 25, 2019 2:17 pm

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!

Post Reply