From 6ce8bb23282ea84c8ceb44345ebf5934a29acaba Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 30 Apr 2020 20:12:06 +0000 Subject: [PATCH] jvcllaz: Make sure that JvPageList has an ActivePage at designtime after adding a page. Patch by Michal Gawrycki. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7421 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/run/JvPageComps/jvpagelist.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/jvcllaz/run/JvPageComps/jvpagelist.pas b/components/jvcllaz/run/JvPageComps/jvpagelist.pas index 850554f17..0a483d622 100644 --- a/components/jvcllaz/run/JvPageComps/jvpagelist.pas +++ b/components/jvcllaz/run/JvPageComps/jvpagelist.pas @@ -562,8 +562,8 @@ begin end; procedure TJvCustomPageList.CMDesignHitTest(var Msg: TCMDesignHitTest); -var - Pt: TPoint; +//var +// Pt: TPoint; begin inherited; //Pt := SmallPointToPoint(Msg.Pos); @@ -963,6 +963,8 @@ begin Page.Caption := ACaption; Page.Name := GetUniqueName(Owner, Copy(Page.ClassName, 2, MaxInt)); Page.PageList := Self; + if (csDesigning in ComponentState) and (ActivePage = nil) then + ActivePage := Page; end; procedure TJvCustomPageList.MovePage(CurIndex, NewIndex: Integer);