Sets wince combobox constrain

git-svn-id: trunk@25350 -
This commit is contained in:
sekelsenmat 2010-05-13 10:04:15 +00:00
parent 7bb3ea0c82
commit 1c67912380

View File

@ -489,19 +489,25 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinCEWidgetSet.GetControlConstraints(Constraints: TObject): boolean; function TWinCEWidgetSet.GetControlConstraints(Constraints: TObject): boolean;
var var
SizeConstraints: TSizeConstraints; SizeConstraints: TSizeConstraints absolute Constraints;
SizeRect: TRect; SizeRect: TRect;
Height, Width: Integer; Height, Width: Integer;
FixedHeight, FixedWidth: boolean; FixedHeight, FixedWidth: boolean;
begin begin
Result:=true; Result := True;
if Constraints is TSizeConstraints then begin if Constraints is TSizeConstraints then
SizeConstraints:=TSizeConstraints(Constraints); begin
if (SizeConstraints.Control=nil) then Exit;
if (SizeConstraints.Control=nil) then exit;
FixedHeight := false; FixedHeight := false;
FixedWidth := false; FixedWidth := false;
if SizeConstraints.Control is TCustomComboBox then
begin
// wince combo (but not csSimple) has fixed height
FixedHeight := TCustomComboBox(SizeConstraints.Control).Style <> csSimple;
end;
{if SizeConstraints.Control is TCustomCalendar then {if SizeConstraints.Control is TCustomCalendar then
begin begin
FixedHeight := true; FixedHeight := true;
@ -512,6 +518,7 @@ begin
and TWinControl(SizeConstraints.Control).HandleAllocated then and TWinControl(SizeConstraints.Control).HandleAllocated then
begin begin
Windows.GetWindowRect(TWinControl(SizeConstraints.Control).Handle, @SizeRect); Windows.GetWindowRect(TWinControl(SizeConstraints.Control).Handle, @SizeRect);
if FixedHeight then if FixedHeight then
Height := SizeRect.Bottom - SizeRect.Top Height := SizeRect.Bottom - SizeRect.Top
else else
@ -520,6 +527,7 @@ begin
Width := SizeRect.Right - SizeRect.Left Width := SizeRect.Right - SizeRect.Left
else else
Width := 0; Width := 0;
SizeConstraints.SetInterfaceConstraints(Width, Height, Width, Height); SizeConstraints.SetInterfaceConstraints(Width, Height, Width, Height);
end; end;
end; end;