carbon: restored OSX style button default state switching

git-svn-id: trunk@22646 -
This commit is contained in:
dmitry 2009-11-17 10:33:11 +00:00
parent a8f1185fb4
commit f76a696f9c
2 changed files with 6 additions and 7 deletions

View File

@ -328,14 +328,10 @@ end;
Sets the default indication
------------------------------------------------------------------------------}
procedure TCarbonCustomButton.SetDefault(ADefault: Boolean);
var
value : Boolean;
begin
//value := TCustomButton(LCLObject).Default;
value:=ADefault;
OSError(
SetControlData(ControlRef(Widget), kControlEntireControl,
kControlPushButtonDefaultTag, SizeOf(Boolean), @value),
kControlPushButtonDefaultTag, SizeOf(Boolean), @ADefault),
Self, 'SetDefault', SSetData);
end;

View File

@ -1017,13 +1017,16 @@ end;
ADefault
Sets button default indication in Carbon interface
Carbon buttons doesn't switch default-state on change focus (i.e. Windows buttons)
SetDefault is called if button is default or if button is focused.
So default is switched based on TButton.Default property
------------------------------------------------------------------------------}
class procedure TCarbonWSButton.SetDefault(const AButton: TCustomButton;
ADefault: Boolean);
begin
if not CheckHandle(AButton, Self, 'SetDefault') then Exit;
TCarbonCustomButton(AButton.Handle).SetDefault(ADefault);
TCarbonCustomButton(AButton.Handle).SetDefault(AButton.Default);
end;
{ TCarbonWSCustomCheckBox }