LCL: added TWSControl.ConstraintWidth/Height

git-svn-id: trunk@26513 -
This commit is contained in:
mattias 2010-07-07 20:28:13 +00:00
parent 0b3a7661b0
commit 927577f78d
2 changed files with 18 additions and 0 deletions

View File

@ -140,6 +140,8 @@ begin
if (Result<MinW) then Result:=MinW;
MaxW:=EffectiveMaxWidth;
if (MaxW>0) and (Result>MaxW) then Result:=MaxW;
if (Control is TWinControl) and TWinControl(Control).HandleAllocated then
TWSControlClass(Control.WidgetSetClass).ConstraintWidth(Control, Self, Result);
end;
function TSizeConstraints.MinMaxHeight(Height: integer): integer;
@ -152,6 +154,8 @@ begin
if (Result<MinH) then Result:=MinH;
MaxH:=EffectiveMaxHeight;
if (MaxH>0) and (Result>MaxH) then Result:=MaxH;
if (Control is TWinControl) and TWinControl(Control).HandleAllocated then
TWSControlClass(Control.WidgetSetClass).ConstraintHeight(Control, Self, Result);
end;
{------------------------------------------------------------------------------

View File

@ -73,6 +73,8 @@ type
published
class procedure AddControl(const AControl: TControl); virtual;
class function GetConstraints(const AControl: TControl; const AConstraints: TObject): Boolean; virtual;
class procedure ConstraintWidth(const AControl: TControl; const AConstraints: TObject; var aWidth: integer); virtual;
class procedure ConstraintHeight(const AControl: TControl; const AConstraints: TObject; var aHeight: integer); virtual;
end;
TWSControlClass = class of TWSControl;
@ -160,6 +162,18 @@ begin
Result := WidgetSet.GetControlConstraints(AConstraints);
end;
class procedure TWSControl.ConstraintWidth(const AControl: TControl;
const AConstraints: TObject; var aWidth: integer);
begin
end;
class procedure TWSControl.ConstraintHeight(const AControl: TControl;
const AConstraints: TObject; var aHeight: integer);
begin
end;
{ TWSWinControl }
class procedure TWSWinControl.AdaptBounds(const AWinControl: TWinControl;