Handling OnMoved event for splitter to resize TSRVPageScroll

General TRichView support forum. Please post your questions here
Post Reply
nachbar
Posts: 11
Joined: Sun Dec 12, 2010 11:35 pm
Contact:

Handling OnMoved event for splitter to resize TSRVPageScroll

Post by nachbar »

I noticed that the C++ Builder ActionTestTabs demo has a splitter between the TSRVPageScroll and the main TSRichViewEdit. The user should be able to use this splitter to allow more or less room for the TSRVPageScroll, but the TSRVPageScroll pages do not change size as the user moves the splitter.

You can handle the OnMoved event for the splitter with something like:

SRVPageScroll1->PageWidth = SRVPageScroll1->Width * 0.85;

That works to change the page size, but the TSRVPageScroll does not update to show the pages in the new size until the user clicks either the TSRVPageScroll or the TSRichViewEdit, which triggers some sort of update, and the pages get redrawn in the new, changed size.

I have tried multiple ways to try to get the TSRVPageScroll to automatically update after the page size is changed, including Repaint(), Invalidate(), Update() and Refresh(), on both the TSRVPageScroll and the TSRichViewEdit, but have not been able to get this to update.

Can you tell me the best way to get the TSRVPageScroll to update after changing its PageWidth?

Thank you.
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

Fixed:

Code: Select all

procedure TSRVPageScroll.SetPageWidth(Value : Integer);
begin
  if FPageWidth <> Value then
    begin
      FPageWidth := Value;
      UpdateCache;   // <<<<<<<<<<<< ADDING
      Invalidate;
    end;
end;
nachbar
Posts: 11
Joined: Sun Dec 12, 2010 11:35 pm
Contact:

That fixed it

Post by nachbar »

Thank you!
Post Reply