carbon: setting interface constraints for CarbonComboBox

git-svn-id: trunk@26531 -
This commit is contained in:
dmitry 2010-07-08 17:07:53 +00:00
parent 7d448a1242
commit fecbf2d56a
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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;
{------------------------------------------------------------------------------