mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:19:19 +02:00
TCustomEditBtn: fix loading Color.
git-svn-id: trunk@44669 -
This commit is contained in:
parent
e3aa48ff3e
commit
58a1d5eef1
@ -59,6 +59,7 @@ type
|
||||
FButtonOnlyWhenFocused: Boolean;
|
||||
FDirectInput: Boolean;
|
||||
FEdit: TBeEdit;
|
||||
FInitialColor: TColor;
|
||||
FIsReadOnly: Boolean;
|
||||
FFlat: Boolean;
|
||||
//Forwarded events from FButton
|
||||
@ -1250,7 +1251,10 @@ end;
|
||||
|
||||
procedure TCustomEditButton.SetColor(AValue: TColor);
|
||||
begin
|
||||
FEdit.Color := AValue;
|
||||
if (csLoading in ComponentState) then
|
||||
FInitialColor := AValue
|
||||
else
|
||||
FEdit.Color := AValue;
|
||||
end;
|
||||
|
||||
procedure TCustomEditButton.SetCursor(AValue: TCursor);
|
||||
@ -1431,6 +1435,11 @@ end;
|
||||
procedure TCustomEditButton.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
{
|
||||
inherited Loaded sends a CM_PARENTFONTCHANGED message, which then
|
||||
also sets FEdit's color, which is undesired.
|
||||
}
|
||||
if GetColor <> FInitialColor then SetColor(FInitialColor);
|
||||
CheckButtonVisible;
|
||||
end;
|
||||
|
||||
@ -1469,6 +1478,7 @@ begin
|
||||
FButton := TSpeedButton.Create(Self);
|
||||
FEdit := TBeEdit.Create(Self);
|
||||
inherited Create(AOwner);
|
||||
FInitialColor := {$ifdef UseCLDefault}clDefault{$else}clWindow{$endif};
|
||||
BorderStyle := bsNone;
|
||||
FButtonAlign := BaRight;
|
||||
FButtonOnlyWhenFocused := False;
|
||||
|
Loading…
Reference in New Issue
Block a user