LCL: combo box: High-DPI. Issue #31504

git-svn-id: trunk@54369 -
This commit is contained in:
ondrej 2017-03-08 15:54:45 +00:00
parent 146fafd05b
commit fb53b10290
2 changed files with 16 additions and 0 deletions

View File

@ -85,6 +85,20 @@ begin
inherited DestroyWnd;
end;
procedure TCustomComboBox.DoAutoAdjustLayout(
const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double
);
begin
inherited;
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
begin
if (Style in [csOwnerDrawFixed, csOwnerDrawVariable])
and (FItemHeight > 0) then
ItemHeight := Round(ItemHeight * AYProportion);
end;
end;
{------------------------------------------------------------------------------
procedure TCustomComboBox.DrawItem(Index: Integer; Rect: TRect;
State: TOwnerDrawState);

View File

@ -325,6 +325,8 @@ type
procedure SetItems(const Value: TStrings); virtual;
procedure CloseUp; virtual;
procedure AdjustDropDown; virtual;
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
function GetItemCount: Integer; //override;
function GetItemHeight: Integer; virtual;