fix ControlStyle csOpaque for TCustomLabel (not opaque when transparent)

git-svn-id: trunk@8240 -
This commit is contained in:
micha 2005-11-29 21:23:28 +00:00
parent 5396e4caf5
commit cced0352b3
2 changed files with 13 additions and 2 deletions

View File

@ -152,8 +152,7 @@ constructor TCustomLabel.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
Font.OnChange := @FontChange;
ControlStyle := [csSetCaption, csOpaque, csClickEvents, csDoubleClicks,
csReplicatable];
ControlStyle := [csSetCaption, csClickEvents, csDoubleClicks, csReplicatable];
Width := 65;
Height := 17;
FShowAccelChar := True;
@ -166,6 +165,17 @@ begin
Result := Color = clNone;
end;
procedure TCustomLabel.SetColor(NewColor: TColor);
begin
inherited;
// if color = clnone then transparent, so not opaque
if NewColor = clNone then
ControlStyle := ControlStyle - [csOpaque]
else
ControlStyle := ControlStyle + [csOpaque];
end;
{------------------------------------------------------------------------------
Method: TCustomLabel.SetLayout
Params: None

View File

@ -1140,6 +1140,7 @@ type
function GetAlignment: TAlignment;
function GetTransparent: boolean;
procedure SetAlignment(Value: TAlignment);
procedure SetColor(NewColor: TColor); override;
procedure SetFocusControl(Value: TWinControl);
procedure SetLayout(Value: TTextLayout);
procedure SetShowAccelChar(Value: Boolean);