mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:29:21 +02:00
carbon: fixes for Luiz's RadioButton changes
git-svn-id: trunk@27063 -
This commit is contained in:
parent
10f1d85bf5
commit
b6c70dc7ed
@ -41,13 +41,14 @@ type
|
||||
{ TCarbonCustomCheckBox }
|
||||
|
||||
TCarbonCustomCheckBox = class(TCarbonControl)
|
||||
private
|
||||
fSupressNotify : Boolean;
|
||||
public
|
||||
class function GetValidEvents: TCarbonControlEvents; override;
|
||||
procedure Hit(AControlPart: ControlPartCode); override;
|
||||
procedure ValueChanged; override;
|
||||
|
||||
function RetrieveState: Integer; virtual;
|
||||
procedure SetState(AState: Integer); virtual;
|
||||
procedure SetState(AState: Integer; NotifyChangeState: Boolean); virtual;
|
||||
end;
|
||||
|
||||
{ TCarbonCheckBox }
|
||||
@ -146,7 +147,10 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCarbonCustomCheckBox.ValueChanged;
|
||||
begin
|
||||
LCLSendChangedMsg(LCLObject);
|
||||
if not fSupressNotify then
|
||||
LCLSendChangedMsg(LCLObject)
|
||||
else
|
||||
fSupressNotify := False;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -164,8 +168,10 @@ end;
|
||||
|
||||
Sets the new state of Carbon custom check box
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCarbonCustomCheckBox.SetState(AState: Integer);
|
||||
procedure TCarbonCustomCheckBox.SetState(AState: Integer; NotifyChangeState: Boolean);
|
||||
begin
|
||||
if RetrieveState=AState then Exit;
|
||||
fSupressNotify := not NotifyChangeState;
|
||||
SetControl32BitValue(ControlRef(Widget), AState);
|
||||
end;
|
||||
|
||||
@ -286,7 +292,7 @@ begin
|
||||
begin
|
||||
ctrl := GetCarbonControl(v);
|
||||
if ctrl is TCarbonRadioButton then
|
||||
TCarbonRadioButton(ctrl).SetState(kControlCheckBoxUncheckedValue);
|
||||
TCarbonRadioButton(ctrl).SetState(kControlCheckBoxUncheckedValue, True);
|
||||
end;
|
||||
v := HIViewGetNextView(v);
|
||||
end;
|
||||
|
@ -1108,8 +1108,7 @@ const
|
||||
(kControlCheckBoxUncheckedValue, kControlCheckBoxCheckedValue, kControlCheckBoxMixedValue);
|
||||
begin
|
||||
if not CheckHandle(ACustomCheckBox, Self, 'SetState') then Exit;
|
||||
|
||||
TCarbonCustomCheckBox(ACustomCheckBox.Handle).SetState(CarbonBtnState[NewState]);
|
||||
TCarbonCustomCheckBox(ACustomCheckBox.Handle).SetState(CarbonBtnState[NewState], False);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user