formatting

git-svn-id: trunk@18229 -
This commit is contained in:
paul 2009-01-09 19:37:13 +00:00
parent ed1bf45b79
commit 5df806377b
4 changed files with 27 additions and 24 deletions

View File

@ -159,7 +159,7 @@ type
procedure DoSendTabPosition; procedure DoSendTabPosition;
function GetActivePage: String; function GetActivePage: String;
function GetActivePageComponent: TCustomPage; function GetActivePageComponent: TCustomPage;
function GetPage(aIndex: Integer): TCustomPage; function GetPage(AIndex: Integer): TCustomPage;
function GetPageCount : integer; function GetPageCount : integer;
function GetPageIndex: Integer; function GetPageIndex: Integer;
function FindVisiblePage(Index: Integer): Integer; function FindVisiblePage(Index: Integer): Integer;

View File

@ -206,8 +206,8 @@ begin
begin begin
Caption := GetCaptionOfKind(fKind); Caption := GetCaptionOfKind(fKind);
ModalResult := BitBtnModalResults[FKind]; ModalResult := BitBtnModalResults[FKind];
Default := FKind in [bkOk,bkYes]; Default := FKind in [bkOk, bkYes];
Cancel := FKind in [bkCancel,bkNo]; Cancel := FKind in [bkCancel, bkNo];
end; end;
end; end;

View File

@ -437,11 +437,11 @@ begin
if (csLoading in ComponentState) then FLoadedPageIndex:=AValue; if (csLoading in ComponentState) then FLoadedPageIndex:=AValue;
//debugln('TCustomNotebook.SetPageIndex A ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated),' ',dbgs(ComponentState)); //debugln('TCustomNotebook.SetPageIndex A ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated),' ',dbgs(ComponentState));
if (AValue < 0) or (AValue >= PageCount) then exit; if (AValue < 0) or (AValue >= PageCount) then exit;
if fPageIndex = AValue then exit; if FPageIndex = AValue then exit;
if not CanChangePageIndex then exit; if not CanChangePageIndex then exit;
//debugln('TCustomNotebook.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated)); //debugln('TCustomNotebook.SetPageIndex B ',dbgsName(Self),' AValue=',dbgs(AValue),' fPageIndex=',dbgs(fPageIndex),' PageCount=',dbgs(PageCount),' HandleAllocated=',dbgs(HandleAllocated));
fPageIndex := AValue; FPageIndex := AValue;
UpdateAllDesignerFlags; UpdateAllDesignerFlags;
DoSendPageIndex; DoSendPageIndex;
if ([csDesigning, csLoading, csDestroying] * ComponentState = []) if ([csDesigning, csLoading, csDestroying] * ComponentState = [])
@ -454,7 +454,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TCustomNotebook.GetPageIndex: Integer; function TCustomNotebook.GetPageIndex: Integer;
begin begin
Result := fPageIndex; Result := FPageIndex;
end; end;
procedure TCustomNotebook.InsertPage(APage: TCustomPage; Index: Integer); procedure TCustomNotebook.InsertPage(APage: TCustomPage; Index: Integer);
@ -645,11 +645,11 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
TCustomNotebook GetPage TCustomNotebook GetPage
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TCustomNotebook.GetPage(aIndex: Integer): TCustomPage; function TCustomNotebook.GetPage(AIndex: Integer): TCustomPage;
begin begin
if (aIndex<0) or (aIndex>=fPageList.Count) then if (AIndex < 0) or (AIndex >= FPageList.Count) then
RaiseGDBException('TCustomNotebook.GetCustomPage Index out of bounds'); RaiseGDBException('TCustomNotebook.GetCustomPage Index out of bounds');
Result := TCustomPage(fPageList.Items[aIndex]); Result := TCustomPage(FPageList.Items[AIndex]);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -845,11 +845,13 @@ var
begin begin
if (FPageIndex >= 0) and (FPageIndex < PageCount) then if (FPageIndex >= 0) and (FPageIndex < PageCount) then
begin begin
CurPage:=Page[FPageIndex]; CurPage := Page[FPageIndex];
// first make the new page visible // first make the new page visible
//DebugLn(['TCustomNotebook.ShowCurrentPage ',DbgSName(CurPage),' CurPage.Visible=',CurPage.Visible]); //DebugLn(['TCustomNotebook.ShowCurrentPage ',DbgSName(CurPage),' CurPage.Visible=',CurPage.Visible]);
if CurPage.Visible then begin if CurPage.Visible then
if FPageIndexOnLastShow<>fPageIndex then begin begin
if FPageIndexOnLastShow <> FPageIndex then
begin
// some widgetsets like win32/64 do not send WM_SIZE messages for // some widgetsets like win32/64 do not send WM_SIZE messages for
// hidden pages. Force resizing page (it is alClient). // hidden pages. Force resizing page (it is alClient).
//DebugLn(['TCustomNotebook.ShowCurrentPage ',dbgsName(Self),' ',DbgSName(CurPage),' CurPage.Visible=',CurPage.Visible,' BoundsRect=',dbgs(BoundsRect),' ClientRect=',dbgs(ClientRect),' CurPage.BoundsRect=',dbgs(CurPage.BoundsRect),' CurPage.ClientRect=',dbgs(CurPage.ClientRect)]); //DebugLn(['TCustomNotebook.ShowCurrentPage ',dbgsName(Self),' ',DbgSName(CurPage),' CurPage.Visible=',CurPage.Visible,' BoundsRect=',dbgs(BoundsRect),' ClientRect=',dbgs(ClientRect),' CurPage.BoundsRect=',dbgs(CurPage.BoundsRect),' CurPage.ClientRect=',dbgs(CurPage.ClientRect)]);
@ -858,19 +860,20 @@ begin
// therefore AutoSizing of childs was skipped => do it now // therefore AutoSizing of childs was skipped => do it now
CurPage.ReAlign; CurPage.ReAlign;
end; end;
end else begin end else
begin
CurPage.Visible := true; CurPage.Visible := true;
//DebugLn(['TCustomNotebook.ShowCurrentPage CurPage.AutoSizeDelayed=',CurPage.AutoSizeDelayed,' ',dbgs(CurPage.ComponentState),' ',CurPage.HandleAllocated]); //DebugLn(['TCustomNotebook.ShowCurrentPage CurPage.AutoSizeDelayed=',CurPage.AutoSizeDelayed,' ',dbgs(CurPage.ComponentState),' ',CurPage.HandleAllocated]);
end; end;
FPageIndexOnLastShow:=fPageIndex; FPageIndexOnLastShow := FPageIndex;
CurPage.DoShow; CurPage.DoShow;
if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and end;
(FPageIndexOnLastChange <> FPageIndex) then if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
begin (FPageIndexOnLastChange <> FPageIndex) then
// Page[FPageIndexOnLastChange].Visible := False; <-- this will be better, begin
// but this does not work on gtk (tab hides too) // Page[FPageIndexOnLastChange].Visible := False; <-- this will be better,
Page[FPageIndexOnLastChange].DoHide; // but this does not work on gtk (tab hides too)
end; Page[FPageIndexOnLastChange].DoHide;
end; end;
end; end;

View File

@ -648,9 +648,9 @@ begin
SendSelChangeMessage(ANotebook, Handle, AIndex); SendSelChangeMessage(ANotebook, Handle, AIndex);
NotebookFocusNewControl(ANotebook, AIndex); NotebookFocusNewControl(ANotebook, AIndex);
end; end;
if (OldIndex >= 0) and (OldIndex <> AIndex) if (OldIndex >= 0) and (OldIndex <> AIndex) and
and (OldIndex < ANotebook.PageCount) (OldIndex < ANotebook.PageCount) and
and (ANotebook.CustomPage(OldIndex).HandleAllocated) then (ANotebook.CustomPage(OldIndex).HandleAllocated) then
ShowWindow(ANotebook.CustomPage(OldIndex).Handle, SW_HIDE); ShowWindow(ANotebook.CustomPage(OldIndex).Handle, SW_HIDE);
end; end;
end; end;