Hi,
I added a WPSymbolDlg to the editor. When executing it, the fontnames aren't sorted properly.
Is there a way to sort them in alphabetical order?
Regards,
Stef
Hi,
I added a WPSymbolDlg to the editor. When executing it, the fontnames aren't sorted properly.
Is there a way to sort them in alphabetical order?
Regards,
Stef
Please see the code in WPSymDlg.pas,
you can change the last 2 procedures to
{$IFDEF USEENUMF}
function EnumFont(var lp: TEnumLogFont;
var tm: TNewTextMetric; dwType: DWORD; lpData: lParam): Integer; stdcall;
begin
Result := 1; TStringList(lpData).Add(lp.elfLogFont.lfFaceName);
end;
{$ENDIF}
procedure TWPSymbolDialog.FormCreate(Sender: TObject);
var str: TStringList;
begin
str := TStringList.Create;
try
{$IFDEF USEENUMF}
cbxFontList.Items.Clear;
EnumFontFamilies(Canvas.Handle, nil, @EnumFont, Integer(str));
{$ELSE}
cbxFontList.Items := Screen.Fonts;
{$ENDIF}
str.Sorted := TRUE;
cbxFontList.Items := str;
finally
str.Free;
end;
end;
Alles anzeigen
Thank you very much!
This workes like a charm.
Will this solution be integrated into a future release so we don't have to make the change everytime I update WPTools? I guess we could always implement our own dialog, but it might be good to integrate it for general usage.
That could is already in the current V5.20.3