mbColorLib: Add locking mechanism for OnChange events. Fix OfficeDlg forgetting selected color if picker type is changed on custom page.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5599 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-01-06 14:02:14 +00:00
parent a8a50d3df3
commit 69b268fa82
6 changed files with 58 additions and 19 deletions

View File

@ -53,7 +53,7 @@ type
implementation
uses
Math, mbUtils;
Math, mbUtils, PalUtils;
{ THSColorPicker }
@ -91,7 +91,10 @@ begin
if Focused or (csDesigning in ComponentState) then
c := clBlack
else
c := clWhite;
case BrightnessMode of
bmLuminance: c := clWhite;
bmValue : c := clGray;
end;
InternalDrawMarker(x, y, c);
end;
@ -154,9 +157,10 @@ begin
if WebSafe then c := GetWebSafe(c);
ColorToHSLV(c, H, S, L, V);
{
if (H = FHue) and (S = FSat) then
exit;
}
FHue := H;
FSat := S;
FSelected := HSLVtoColor(FHue, FSat, FLum, FVal);