Vista, Field editor: Work around for higher DPI settings no longer needed using the Segeo font. Instead, fix the pulldown's ItemHeight in that case which per default only fits for 96 DPI.

This commit is contained in:
Ansgar Becker
2008-09-02 18:22:18 +00:00
parent ff5480682a
commit c15f1ce7a5

View File

@ -146,6 +146,9 @@ begin
btnDeleteAllColumnsFromIndex.PngImage := Mainform.PngImageListMain.PngImages[79].PngImage;
btnDeleteColumnFromIndex.PngImage := Mainform.PngImageListMain.PngImages[77].PngImage;
InheritFont(Font);
// The datatype pulldown does OwnerDrawing which enables its ItemHeight property. Use that to make it fit on higher DPI settings
ComboBoxType.Height := EditFieldname.Height;
ComboBoxType.ItemHeight := ComboBoxType.Height - 8;
end;
@ -1106,19 +1109,8 @@ procedure TFieldEditForm.ComboBoxTypeDrawItem(Control: TWinControl; Index:
Integer; Rect: TRect; State: TOwnerDrawState);
var
s: string;
{*dc: HDC;
dpi: Integer;*}
begin
with Control as TComboBox,Canvas do begin
// custom DPI support
{*
// not useful unless SetDPIAware() is issued.
dc := GetDC(MainForm.Handle);
dpi := GetDeviceCaps(dc, LOGPIXELSX);
ReleaseDC(MainForm.Handle, dc);
Font.PixelsPerInch := dpi;
*}
Font.PixelsPerInch := 96;
// decide colors
Brush.Color := clWindow;
Font.Color := clWindowText;