TFontDialog fdLimitSize for font-size doesn't work
Original Reporter info from Mantis: rvk
-
Reporter name: Rik van Kekem
Original Reporter info from Mantis: rvk
- Reporter name: Rik van Kekem
Description:
When setting fdLimitSize in options and MaxFontSize and MinFontSize on TFontDialog you would expect the dialog to limit the font-size. Instead the font-size listbox is empty and when choosing a valid font-size the OK-button gives a "Size must be between 0 and 0 points." error.
Steps to reproduce:
Empty project with one button:
procedure TForm1.Button1Click(Sender: TObject);
var
Fd: TFontDialog;
begin
Fd := TFontDialog.Create(nil);
try
Fd.Font.Name := 'Arial';
Fd.Font.Size := 9;
Fd.MinFontSize := 8;
Fd.MaxFontSize := 24;
Fd.Options := Fd.Options + [fdLimitSize];
if Fd.Execute then;
finally
Fd.Free;
end;
end;
Press button and choose a valid (9) point size and press ok.
Additional information:
In lazarus/lcl/interfaces/win32/win32wsdialogs.pp the fdLimitSize is implemented correctly but nowhere is the setting of MaxFontSize/MinFontSize to be found. Without it the dialog check for Min 0 and Max 0.
[code]if fdLimitSize in Options then Result := Result or CF_LIMITSIZE;[/code]
Mantis conversion info:
- Mantis ID: 30340
- OS: Windows
- Version: 1.6.1 (SVN)
- Fixed in version: 1.6.2
- Fixed in revision: r52649 (#61f5442a)
- Target version: 1.6.2