mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-15 11:39:27 +02:00
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:
parent
b70c8ac8e7
commit
72551f3c1e
@ -27,11 +27,11 @@ uses
|
|||||||
// Compatibility
|
// Compatibility
|
||||||
{$ifdef Win32}win32compat,{$endif}
|
{$ifdef Win32}win32compat,{$endif}
|
||||||
// RTL, FCL, LCL
|
// RTL, FCL, LCL
|
||||||
SysUtils, LCLType, Classes, StdCtrls, Controls, Graphics, Forms, WinCEProc,
|
SysUtils, LCLType, Classes, StdCtrls, Controls, Graphics, Forms, LCLProc,
|
||||||
InterfaceBase, LMessages, LCLMessageGlue, LazUTF8, LazUtf8Classes,
|
InterfaceBase, LMessages, LCLMessageGlue, LazUTF8, LazUtf8Classes,
|
||||||
// Widgetset
|
// Widgetset
|
||||||
WSControls, WSStdCtrls, WSLCLClasses, WinCEInt, WinCEWSControls, WinCEExtra,
|
WSControls, WSStdCtrls, WSLCLClasses, WinCEInt, WinCEWSControls, WinCEExtra,
|
||||||
WSProc;
|
WSProc, WinCEProc;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -1022,11 +1022,13 @@ class procedure TWinCEWSCustomEdit.GetPreferredSize(
|
|||||||
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
|
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
|
||||||
WithThemeSpace: Boolean);
|
WithThemeSpace: Boolean);
|
||||||
begin
|
begin
|
||||||
if MeasureText(AWinControl, AWinControl.Caption, PreferredWidth, PreferredHeight) then
|
if MeasureText(AWinControl, 'Fj', PreferredWidth, PreferredHeight) then
|
||||||
begin
|
begin
|
||||||
Inc(PreferredWidth, 5);
|
PreferredWidth := 0;
|
||||||
|
if TCustomEdit(AWinControl).BorderStyle <> bsNone then
|
||||||
Inc(PreferredHeight, 5);
|
Inc(PreferredHeight, 5);
|
||||||
end;
|
end;
|
||||||
|
{$ifdef VerboseSizeMsg}DebugLn(Format('[TWinCEWSCustomEdit.GetPreferredSize] %s: CX %d CY %d',[AWinControl.Name, PreferredWidth, PreferredHeight]));{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TWinCEWSCustomMemo }
|
{ TWinCEWSCustomMemo }
|
||||||
|
Loading…
Reference in New Issue
Block a user