mbColorLib: Refactor OnChange events. (NOTE: OfficeColorDialog may hang when switching pickers).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5578 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-01-02 00:05:26 +00:00
parent 176aff8ff1
commit 454f0baf7b
41 changed files with 1830 additions and 1837 deletions

View File

@@ -22,6 +22,7 @@ type
procedure SetOpacity(o: integer);
procedure SetBlockSize(s: integer);
protected
procedure DoChange;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
@@ -32,6 +33,7 @@ type
property SwatchStyle: boolean read FSwatchStyle write SetSwatchStyle default false;
property Anchors;
property Align;
property BorderSpacing;
property ShowHint;
property ParentShowHint;
property Visible;
@@ -81,6 +83,12 @@ begin
FSwatchStyle := false;
end;
procedure TmbColorPreview.DoChange;
begin
if Assigned(FOnColorChange) then
FOnColorChange(self);
end;
function TmbColorPreview.MakeBmp: TBitmap;
begin
Result := TBitmap.Create;
@@ -209,7 +217,6 @@ begin
begin
FSelColor := c;
Invalidate;
if Assigned(FOnColorChange) then FOnColorChange(Self);
end;
end;