mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 19:59:14 +02:00
carbon: setting interface constraints for CarbonComboBox
git-svn-id: trunk@26531 -
This commit is contained in:
parent
7d448a1242
commit
fecbf2d56a
@ -45,7 +45,7 @@ type
|
||||
TCarbonControlEvent = (cceValueChanged, cceIndicatorMoved, cceDoAction,
|
||||
cceDraw, cceHit);
|
||||
TCarbonControlEvents = set of TCarbonControlEvent;
|
||||
|
||||
|
||||
{ TCarbonControl }
|
||||
|
||||
TCarbonControl = class(TCarbonWidget)
|
||||
@ -266,8 +266,8 @@ type
|
||||
procedure CreateWidget(const AParams: TCreateParams); override;
|
||||
procedure DestroyWidget; override;
|
||||
function GetContent: ControlRef; override;
|
||||
function GetPreferredSize: TPoint; override;
|
||||
public
|
||||
function GetPreferredSize: TPoint; override;
|
||||
function GetClientRect(var ARect: TRect): Boolean; override;
|
||||
function SetBounds(const ARect: TRect): Boolean; override;
|
||||
procedure SetColor(const AColor: TColor); override;
|
||||
|
@ -304,8 +304,12 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class function TCarbonWSCustomComboBox.CreateHandle(
|
||||
const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
||||
var
|
||||
sz : TPoint;
|
||||
begin
|
||||
Result := TLCLIntfHandle(TCarbonComboBox.Create(AWinControl, AParams));
|
||||
sz:=TCarbonComboBox(Result).GetPreferredSize;
|
||||
AWinControl.Constraints.SetInterfaceConstraints(0,0,0, sz.Y);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -434,10 +438,14 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TCarbonWSCustomComboBox.SetStyle(const ACustomComboBox: TCustomComboBox;
|
||||
NewStyle: TComboBoxStyle);
|
||||
var
|
||||
sz : TPoint;
|
||||
begin
|
||||
if not CheckHandle(ACustomComboBox, Self, 'SetStyle') then Exit;
|
||||
|
||||
TCarbonComboBox(ACustomComboBox.Handle).SetReadOnly(ACustomComboBox.ReadOnly);
|
||||
sz:=TCarbonComboBox(ACustomComboBox.Handle).GetPreferredSize;
|
||||
ACustomComboBox.Constraints.SetInterfaceConstraints(0,0,0,sz.Y);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user