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 begin
// redirect messages to designer // redirect messages to designer
Form := GetParentForm(Self); Form := GetParentForm(Self);
//debugln(['TControl.WndProc ',dbgsname(Self)]);
if (Form <> nil) and (Form.Designer <> nil) if (Form <> nil) and (Form.Designer <> nil)
and Form.Designer.IsDesignMsg(Self,TheMessage) then begin and Form.Designer.IsDesignMsg(Self,TheMessage) then begin
Exit; Exit;

View File

@ -865,6 +865,7 @@ var
FocusHandle : HWND; FocusHandle : HWND;
MenuItem : TMenuItem; MenuItem : TMenuItem;
begin begin
//debugln(['TCustomForm.WndProc ',dbgsname(Self)]);
with TheMessage do with TheMessage do
case Msg of case Msg of
LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS: LM_ACTIVATE, LM_SETFOCUS, LM_KILLFOCUS:

View File

@ -780,6 +780,7 @@ end;
procedure TCustomNotebook.CNNotify(var Message: TLMNotify); procedure TCustomNotebook.CNNotify(var Message: TLMNotify);
var var
OldPageIndex: LongInt; OldPageIndex: LongInt;
APage: TCustomPage;
begin begin
with Message do with Message do
case NMHdr^.code of case NMHdr^.code of
@ -801,6 +802,11 @@ begin
//DebugLn(['TCustomNotebook.CNNotify ',DbgSName(Page[PageIndex]),' ',Page[PageIndex].Visible]); //DebugLn(['TCustomNotebook.CNNotify ',DbgSName(Page[PageIndex]),' ',Page[PageIndex].Visible]);
ResizeDelayedAutoSizeChildren; ResizeDelayedAutoSizeChildren;
Change; Change;
if FPageIndex>=0 then begin
APage:=Page[FPageIndex];
// update FShowing
APage.UpdateShowing;
end;
end; end;
end; end;
end; end;

View File

@ -208,7 +208,6 @@ begin
if Parent is TCustomNotebook then if Parent is TCustomNotebook then
begin begin
Result := (PageIndex = TCustomNotebook(Parent).PageIndex); Result := (PageIndex = TCustomNotebook(Parent).PageIndex);
//if Name='FormEditorPage' then DebugLn(['TCustomPage.IsControlVisible PageIndex=',PageIndex,' Parent.PageIndex=',TCustomNotebook(Parent).PageIndex]);
end else begin end else begin
Result := inherited IsControlVisible; Result := inherited IsControlVisible;
end; end;

View File

@ -5580,6 +5580,7 @@ begin
if not (csDestroying in ComponentState) then if not (csDestroying in ComponentState) then
AControl.RequestAlign; AControl.RequestAlign;
Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True)); Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True));
//debugln(['TWinControl.InsertControl ',DbgSName(Self),' ',csDesigning in ComponentState,' ',DbgSName(AControl),' ',csDesigning in AControl.ComponentState]);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------