LCL: TNotebook: fixed updating FShowing on switching PageIndex by user, fixes invisible controls at designtime

git-svn-id: trunk@15937 -
This commit is contained in:
mattias 2008-08-03 19:55:42 +00:00
parent af49852343
commit 3af4740453
5 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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;
{------------------------------------------------------------------------------