mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 23:23:48 +02:00
carbon: restored OSX style button default state switching
git-svn-id: trunk@22646 -
This commit is contained in:
parent
a8f1185fb4
commit
f76a696f9c
@ -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;
|
||||
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user