From 3af4740453ac25f1a954dd10d60f965e84e7e78f Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 3 Aug 2008 19:55:42 +0000 Subject: [PATCH] LCL: TNotebook: fixed updating FShowing on switching PageIndex by user, fixes invisible controls at designtime git-svn-id: trunk@15937 - --- lcl/include/control.inc | 1 + lcl/include/customform.inc | 1 + lcl/include/customnotebook.inc | 6 ++++++ lcl/include/custompage.inc | 1 - lcl/include/wincontrol.inc | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 8fb72c667c..81a9c8fdfd 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -1498,6 +1498,7 @@ begin begin // redirect messages to designer Form := GetParentForm(Self); + //debugln(['TControl.WndProc ',dbgsname(Self)]); if (Form <> nil) and (Form.Designer <> nil) and Form.Designer.IsDesignMsg(Self,TheMessage) then begin Exit; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 71a27085d2..766c9a5c30 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -865,6 +865,7 @@ var FocusHandle : HWND; MenuItem : TMenuItem; begin + //debugln(['TCustomForm.WndProc ',dbgsname(Self)]); with TheMessage do case Msg of LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS: diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index e128225329..e3aba40dff 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -780,6 +780,7 @@ end; procedure TCustomNotebook.CNNotify(var Message: TLMNotify); var OldPageIndex: LongInt; + APage: TCustomPage; begin with Message do case NMHdr^.code of @@ -801,6 +802,11 @@ begin //DebugLn(['TCustomNotebook.CNNotify ',DbgSName(Page[PageIndex]),' ',Page[PageIndex].Visible]); ResizeDelayedAutoSizeChildren; Change; + if FPageIndex>=0 then begin + APage:=Page[FPageIndex]; + // update FShowing + APage.UpdateShowing; + end; end; end; end; diff --git a/lcl/include/custompage.inc b/lcl/include/custompage.inc index 61abb452c5..8ae4bd7da9 100644 --- a/lcl/include/custompage.inc +++ b/lcl/include/custompage.inc @@ -208,7 +208,6 @@ begin if Parent is TCustomNotebook then begin Result := (PageIndex = TCustomNotebook(Parent).PageIndex); - //if Name='FormEditorPage' then DebugLn(['TCustomPage.IsControlVisible PageIndex=',PageIndex,' Parent.PageIndex=',TCustomNotebook(Parent).PageIndex]); end else begin Result := inherited IsControlVisible; end; diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 2109972f25..f69b5aae93 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -5580,6 +5580,7 @@ begin if not (csDestroying in ComponentState) then AControl.RequestAlign; Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True)); + //debugln(['TWinControl.InsertControl ',DbgSName(Self),' ',csDesigning in ComponentState,' ',DbgSName(AControl),' ',csDesigning in AControl.ComponentState]); end; {------------------------------------------------------------------------------