TGradTabControl: Fixed Hide Close-Button on MouseLeave

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@905 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
eugene1
2009-07-13 14:51:03 +00:00
parent 5e019c5aec
commit 0ea82dc33e
2 changed files with 13 additions and 1 deletions

View File

@ -16,7 +16,7 @@
<VersionInfo>
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<CurrentBuildNr Value="1161"/>
<CurrentBuildNr Value="1166"/>
<ProjectVersion Value="0.0.0.0"/>
</VersionInfo>
<PublishOptions>

View File

@ -54,6 +54,7 @@ type
procedure GetContentRect(var TheRect: TRect); override;
procedure SetBaseColor(const Value: TColor); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure CloseButtonLeave(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -534,6 +535,7 @@ begin
FCloseButton.Left:=1;
FCloseButton.Top:=1;
FCloseButton.Caption:='';
FCloseButton.OnMouseLeave:=@CloseButtonLeave;
FShowCloseButton:=false;
FShowCloseButtonOnMouseOver:=false;
@ -548,6 +550,15 @@ begin
inherited Destroy;
end;
procedure TGradTabPageButton.CloseButtonLeave(Sender: TObject);
begin
if not FShowCloseButton then Exit;
if not FShowCloseButtonOnMouseOver then Exit;
// Hide Close Button Fix
FCloseButton.Visible:=false;
end;
{-------------------------------------------------------------------------------
TGradTabPageButton AlignCloseButton
------------------------------------------------------------------------------}
@ -750,6 +761,7 @@ begin
CloseBtnRect.Right:=FCloseButton.Left+FCloseButton.Width;
CloseBtnRect.Bottom:=FCloseButton.Top+FCloseButton.Height;
// Shows the Close Button
FCloseButton.Visible:=PtInRect(CloseBtnRect, Point(X,Y));
end;