lcl: formatting

git-svn-id: trunk@20769 -
This commit is contained in:
paul 2009-06-30 11:58:06 +00:00
parent b3be50f764
commit dcc7044d85
2 changed files with 13 additions and 11 deletions

View File

@ -132,9 +132,9 @@ begin
{$IFDEF NOTEBOOK_DEBUG}
DebugLn(['TNBPages.Insert A ',FNoteBook.Name,' Index=',Index,' S="',S,'"']);
{$ENDIF}
NewOwner:=FNotebook.Owner;
if NewOwner=nil then
NewOwner:=FNotebook;
NewOwner := FNotebook.Owner;
if NewOwner = nil then
NewOwner := FNotebook;
NewPage := FNotebook.PageClass.Create(NewOwner);
with NewPage do
Caption := S;
@ -478,7 +478,8 @@ begin
UpdateDesignerFlags(Index);
if HandleAllocated and (not (csLoading in ComponentState)) then begin
if HandleAllocated and (not (csLoading in ComponentState)) then
begin
AddRemovePageHandle(APage);
if PageIndex = Index then
DoSendPageIndex;

View File

@ -243,17 +243,18 @@ var
List: TList;
i: Integer;
begin
if (Parent<>nil) and (Parent is TCustomNotebook) then begin
Result:=0;
List:=TCustomNotebook(Parent).PageList;
i:=0;
if (Parent <> nil) and (Parent is TCustomNotebook) then
begin
Result := 0;
List := TCustomNotebook(Parent).PageList;
i := 0;
repeat
if i=List.Count then exit(-1);
if (TObject(List[i])=Self) then exit;
if i = List.Count then exit(-1);
if (TObject(List[i]) = Self) then exit;
if TCustomPage(List[i]).TabVisible or (csDesigning in ComponentState)
then inc(Result);
inc(i);
until false;
until False;
end else
Result := -1;
end;