mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 01:39:10 +02:00
Sets wince combobox constrain
git-svn-id: trunk@25350 -
This commit is contained in:
parent
7bb3ea0c82
commit
1c67912380
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user