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;
end deprecated;
TUNBPage = class;
TBeforeShowPageEvent = procedure (ASender: TObject; ANewPage: TUNBPage; ANewIndex: Integer) of object;
{ TUNBPage }
TUNBPage = class(TCustomControl)
private
FOnBeforeShow: TNotifyEvent;
FOnBeforeShow: TBeforeShowPageEvent;
protected
procedure SetParent(AParent: TWinControl); override;
public
@ -333,7 +337,7 @@ type
// Lazarus-specific TPage events
// OnBeforeShow occurs before a page is displayed, so that
// 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
property ChildSizing;
property ClientWidth;

View File

@ -177,7 +177,7 @@ begin
FPageIndex := AValue;
// 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].ControlStyle :=
Page[FPageIndex].ControlStyle - [csNoDesignVisible];