mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 09:19:40 +02:00
Win32: Save CustomColors in TColorDialog. Fixes issue #0023960.
Patch by David Gray. git-svn-id: trunk@40493 -
This commit is contained in:
parent
068b003b83
commit
277b78225d
@ -382,6 +382,7 @@ var
|
||||
CC: PChooseColor;
|
||||
UserResult: WINBOOL;
|
||||
State: TApplicationState;
|
||||
i: Integer;
|
||||
begin
|
||||
if ACommonDialog.Handle <> 0 then
|
||||
begin
|
||||
@ -392,7 +393,14 @@ begin
|
||||
UserResult := ChooseColor(CC);
|
||||
SetDialogResult(ACommonDialog, UserResult);
|
||||
if UserResult then
|
||||
begin
|
||||
TColorDialog(ACommonDialog).Color := CC^.RGBResult;
|
||||
for i := 0 to 15 do
|
||||
if i < TColorDialog(ACommonDialog).CustomColors.Count then
|
||||
TColorDialog(ACommonDialog).CustomColors[i] := Format('Color%s=%x', [Chr(Ord('A')+i), CC^.lpCustColors[i]])
|
||||
else
|
||||
TColorDialog(ACommonDialog).CustomColors.Add (Format('Color%s=%x', [Chr(Ord('A')+i), CC^.lpCustColors[i]]));
|
||||
end;
|
||||
finally
|
||||
RestoreApplicationState(State);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user