Commit 6ffcd274 authored by Michael W. Vogel's avatar Michael W. Vogel
Browse files

LCL: Win32: Fixed Frame.Color not change the color of frame. Issue #35229

git-svn-id: trunk@64872 -
parent 28e5806a
......@@ -302,13 +302,18 @@ type
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure SetParent(AParent: TWinControl); override;
procedure SetParentBackground(const AParentBackground: Boolean); override;
procedure CMParentColorChanged(var Message: TLMessage); message CM_PARENTCOLORCHANGED;
procedure DefineProperties(Filer: TFiler); override;
procedure CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean); override;
procedure UpdateOpaque;
public
constructor Create(AOwner: TComponent); override;
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
class function GetControlClassDefaultSize: TSize; override;
property ParentBackground default True;
end;
TCustomFrameClass = class of TCustomFrame;
......@@ -370,6 +375,7 @@ type
property OnStartDock;
property OnStartDrag;
property OnUnDock;
property ParentBackground;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
......
......@@ -137,6 +137,19 @@ begin
end;
end;
procedure TCustomFrame.SetParentBackground(const AParentBackground: Boolean);
begin
inherited SetParentBackground(AParentBackground);
UpdateOpaque;
end;
procedure TCustomFrame.CMParentColorChanged(var Message: TLMessage);
begin
inherited;
if csLoading in ComponentState then Exit;
UpdateOpaque;
end;
class function TCustomFrame.GetControlClassDefaultSize: TSize;
begin
Result.CX := 320;
......@@ -169,6 +182,14 @@ begin
WithThemeSpace);
end;
procedure TCustomFrame.UpdateOpaque;
begin
if ParentBackground then
ControlStyle := ControlStyle - [csOpaque]
else
ControlStyle := ControlStyle + [csOpaque];
end;
constructor TCustomFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment