Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#4

Re: Change one value + many OnChange events = stack overflow

  Alt 30. Dez 2011, 18:33
Sure, this is sample:

Delphi-Quellcode:
OnFormCreate:
UpdateColor(clWhite);

OnHSLChange:
UpdateColor(HSLPicker.SelectedColor);

OnRGBChange:
UpdateColor(RGB(R, G, B));

OnHSLChange:
HSLToRGB()
UpdateColor()

OnCMYKChane:
CMYKToRGB()
UpdateColor()

UpdateColor(const AColor: TColor):
Preview.Color := AColor;
GetRGBValues(Preview.Color, R, G, B);
edtR.Value := R;
// ... get RGB, HSL and CMYK and set edits

HSLPicker.SelectedColor := AColor;
Picker is the one from mbColorLib.
  Mit Zitat antworten Zitat