LCL: WinCE: align implementation of TWinCEWSCustomEdit.GetPreferredSize with Win32. Does not use AWinControl.Caption. In WinCE7 GetTextExtentPoint32() for empty string returns 0 height (In WinCE6 returns non-zero height), which causes empty TEdit controls to shrink in height.

git-svn-id: trunk@62641 -
This commit is contained in:
lacak 2020-02-17 15:06:00 +00:00
parent b70c8ac8e7
commit 72551f3c1e

View File

@ -27,11 +27,11 @@ uses
// Compatibility
{$ifdef Win32}win32compat,{$endif}
// RTL, FCL, LCL
SysUtils, LCLType, Classes, StdCtrls, Controls, Graphics, Forms, WinCEProc,
SysUtils, LCLType, Classes, StdCtrls, Controls, Graphics, Forms, LCLProc,
InterfaceBase, LMessages, LCLMessageGlue, LazUTF8, LazUtf8Classes,
// Widgetset
WSControls, WSStdCtrls, WSLCLClasses, WinCEInt, WinCEWSControls, WinCEExtra,
WSProc;
WSProc, WinCEProc;
type
@ -1022,11 +1022,13 @@ class procedure TWinCEWSCustomEdit.GetPreferredSize(
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean);
begin
if MeasureText(AWinControl, AWinControl.Caption, PreferredWidth, PreferredHeight) then
if MeasureText(AWinControl, 'Fj', PreferredWidth, PreferredHeight) then
begin
Inc(PreferredWidth, 5);
Inc(PreferredHeight, 5);
PreferredWidth := 0;
if TCustomEdit(AWinControl).BorderStyle <> bsNone then
Inc(PreferredHeight, 5);
end;
{$ifdef VerboseSizeMsg}DebugLn(Format('[TWinCEWSCustomEdit.GetPreferredSize] %s: CX %d CY %d',[AWinControl.Name, PreferredWidth, PreferredHeight]));{$endif}
end;
{ TWinCEWSCustomMemo }