LCL: Ignore AutoSize in ShouldAutoAdjustWidthAndHeight for TEdit and TCombobox. Helps with DPI issues. Issue #30995, patch from AlexeyT.

git-svn-id: trunk@53486 -
This commit is contained in:
juha 2016-11-30 15:07:13 +00:00
parent 85e7d6da06
commit ea8843fd24
3 changed files with 12 additions and 0 deletions

View File

@ -622,6 +622,11 @@ begin
Result := False;
end;
function TCustomComboBox.ShouldAutoAdjustWidthAndHeight: Boolean;
begin
Result := (Align = alNone);
end;
{------------------------------------------------------------------------------
function TCustomComboBox.GetItemCount: Integer;

View File

@ -505,6 +505,11 @@ begin
inherited WndProc(Message);
end;
function TCustomEdit.ShouldAutoAdjustWidthAndHeight: Boolean;
begin
Result := (Align = alNone);
end;
procedure TCustomEdit.CMWantSpecialKey(var Message: TCMWantSpecialKey);
begin
// don't allow LCL to handle arrow keys for edit controls

View File

@ -345,6 +345,7 @@ type
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
procedure MouseUp(Button: TMouseButton; Shift:TShiftState; X, Y: Integer); override;
function SelectItem(const AnItem: String): Boolean;
function ShouldAutoAdjustWidthAndHeight: Boolean; override;
property ItemHeight: Integer read GetItemHeight write SetItemHeight;
property ItemWidth: Integer read GetItemWidth write SetItemWidth default 0;
@ -764,6 +765,7 @@ type
procedure WMChar(var Message: TLMChar); message LM_CHAR;
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
procedure WndProc(var Message: TLMessage); override;
function ShouldAutoAdjustWidthAndHeight: Boolean; override;
property AutoSelect: Boolean read FAutoSelect write FAutoSelect default True;
property AutoSelected: Boolean read FAutoSelected write FAutoSelected;