Compare commits

...

5 Commits

Author SHA1 Message Date
robert rozee
02d434a788 Merge branch 'main' into 'main'
fix for TControl.GetDefaultColor never recursing up to parent

See merge request freepascal.org/lazarus/lazarus!452
2025-04-03 21:29:44 +00:00
Bart
9f23efb4c4 Dialogs: fix the description of ofReadOnly and ofHideReadOnly flags. 2025-04-03 23:26:37 +02:00
robert rozee
d070dd6b88 Edit control.inc,
fix for TControl.GetDefaultColor never recursing up to parent as it should. looks like
the original code was 'mangled' by a bad cut-and-paste a number of years back.
2025-03-16 10:27:54 +00:00
robert rozee
b3ce2c3b9b Merge branch lazarus:main into main 2025-03-16 10:18:25 +00:00
robert rozee
e0cc3cca3e Edit inputdialog.inc 2025-03-05 13:42:31 +00:00
3 changed files with 6 additions and 6 deletions

View File

@ -184,9 +184,9 @@ type
{ TOpenDialog }
TOpenOption = (
ofReadOnly, // Include read-only files.
ofReadOnly, // Causes the Read Only check box to be selected initially when the dialog box is created. This flag indicates the state of the Read Only check box when the dialog box is closed.
ofOverwritePrompt, // If selected file exists show a message, that file will be overwritten.
ofHideReadOnly, // Hide read-only file.
ofHideReadOnly, // Hides the Read Only check box.
ofNoChangeDir, // Do not change current directory.
ofShowHelp, // Show a help button.
ofNoValidate, // Disable file name validation using OFN_NOVALIDATE on the Windows platform. Allow file names with invalid characters.

View File

@ -1434,11 +1434,10 @@ const
);
begin
Result := TWSControlClass(WidgetSetClass).GetDefaultColor(Self, DefaultColorType);
if (Result = clDefault) then
if ParentColor and Assigned(Parent) then
Result := Parent.GetDefaultColor(DefaultColorType)
if (Self.Color = clDefault) and ParentColor and Assigned(Parent) then
Result := Parent.GetDefaultColor(DefaultColorType) // recursion
else
Result := DefColors[DefaultColorType];
if Result = clDefault then Result := DefColors[DefaultColorType]; // backstop
end;
function TControl.GetColorResolvingParent: TColor;

View File

@ -81,6 +81,7 @@ begin
Parent := Form;
ShowBevel := False;
ShowButtons := [pbOK, pbCancel];
Color:=Parent.GetDefaultColor(dctBrush); // fix for wrong background colour
Align := alTop;
end;