lcl: TColorBox: trigger OnChange event when manually change selected color (by Denis Golovan, issue #0014516)

git-svn-id: trunk@21588 -
This commit is contained in:
paul 2009-09-06 10:55:38 +00:00
parent 194d83f7a8
commit 747eead0bb

View File

@ -431,6 +431,9 @@ procedure TCustomColorBox.SetSelected(Value: TColor);
var var
c: integer; c: integer;
begin begin
if Selected = Value then
Exit;
if HandleAllocated then if HandleAllocated then
begin begin
FSelected := Value; FSelected := Value;
@ -439,6 +442,7 @@ begin
if Colors[c] = Value then if Colors[c] = Value then
begin begin
ItemIndex := c; ItemIndex := c;
inherited Change;
Exit; Exit;
end; end;
end; end;
@ -453,6 +457,7 @@ begin
end end
else else
FSelected := Value; FSelected := Value;
inherited Change;
end; end;
procedure TCustomColorBox.SetStyle(const AValue: TColorBoxStyle); procedure TCustomColorBox.SetStyle(const AValue: TColorBoxStyle);