From bcb0f4c05e6f58e98bc5e2a2693f52f723c4bf9f Mon Sep 17 00:00:00 2001 From: dmitry Date: Wed, 30 Jun 2010 16:15:57 +0000 Subject: [PATCH] carbon: fix for too small CarbonEdit endless loops. git-svn-id: trunk@26357 - --- lcl/interfaces/carbon/carbonedits.pp | 44 ++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/carbon/carbonedits.pp b/lcl/interfaces/carbon/carbonedits.pp index e365513b13..7bd83bd88f 100644 --- a/lcl/interfaces/carbon/carbonedits.pp +++ b/lcl/interfaces/carbon/carbonedits.pp @@ -153,7 +153,17 @@ type TCarbonEdit = class(TCarbonCustomEdit) private - FIsPassword: Boolean; + FIsPassword : Boolean; + + // Native Carbon edit's bounds are changing "internal edit" control (not the frame) // + // for this reason EditExtra* constants have been introduced. // + // So the bounds of the frame a changed (for LCL compatibility); // + // Howevr, GetFrameBounds cannot return correct value, if Bounds of the edit // + // is smaller than EditExtraLeft + EditExtraRight, or EditExtraTop+EditExtraBottom // + // Incorrect returned bounds is causes endless loop in LCL processing. // + // For this reason "TooSmall" flag is introduced to return smaller size of the control // + FTooSmall : Boolean; + FSmallBounds : TRect; protected procedure CreateWidget(const AParams: TCreateParams); override; function GetFrameBounds(var r: TRect): Boolean; override; @@ -1431,16 +1441,38 @@ begin dec(r.Bottom, EditExtraBottom); inc(r.Left, EditExtraLeft); dec(r.Right, EditExtraRight); + + FTooSmall:=False; + if r.Right