Adds more parameters to TPage.OnBeforeShow

git-svn-id: trunk@27586 -
This commit is contained in:
sekelsenmat 2010-10-06 13:33:05 +00:00
parent 2245928805
commit e70299b39d
2 changed files with 7 additions and 3 deletions

View File

@ -319,11 +319,15 @@ type
property TabStop; property TabStop;
end deprecated; end deprecated;
TUNBPage = class;
TBeforeShowPageEvent = procedure (ASender: TObject; ANewPage: TUNBPage; ANewIndex: Integer) of object;
{ TUNBPage } { TUNBPage }
TUNBPage = class(TCustomControl) TUNBPage = class(TCustomControl)
private private
FOnBeforeShow: TNotifyEvent; FOnBeforeShow: TBeforeShowPageEvent;
protected protected
procedure SetParent(AParent: TWinControl); override; procedure SetParent(AParent: TWinControl); override;
public public
@ -333,7 +337,7 @@ type
// Lazarus-specific TPage events // Lazarus-specific TPage events
// OnBeforeShow occurs before a page is displayed, so that // OnBeforeShow occurs before a page is displayed, so that
// preparations can be executed in it's user interface, for example // preparations can be executed in it's user interface, for example
property OnBeforeShow: TNotifyEvent read FOnBeforeShow write FOnBeforeShow; property OnBeforeShow: TBeforeShowPageEvent read FOnBeforeShow write FOnBeforeShow;
// Other events // Other events
property ChildSizing; property ChildSizing;
property ClientWidth; property ClientWidth;

View File

@ -177,7 +177,7 @@ begin
FPageIndex := AValue; FPageIndex := AValue;
// And show the new one // And show the new one
if Assigned(Page[FPageIndex].FOnBeforeShow) then Page[FPageIndex].FOnBeforeShow(Self); // OnBeforeShow event if Assigned(Page[FPageIndex].FOnBeforeShow) then Page[FPageIndex].FOnBeforeShow(Self, Page[FPageIndex], FPageIndex); // OnBeforeShow event
Page[FPageIndex].Visible := True; Page[FPageIndex].Visible := True;
Page[FPageIndex].ControlStyle := Page[FPageIndex].ControlStyle :=
Page[FPageIndex].ControlStyle - [csNoDesignVisible]; Page[FPageIndex].ControlStyle - [csNoDesignVisible];