mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 08:57:24 +01:00
cocoa: Redesigns the blocking of events during modal to use lclIsEnabled
git-svn-id: trunk@49815 -
This commit is contained in:
parent
5c6d68e163
commit
b690381ab0
@ -1640,8 +1640,6 @@ end;
|
||||
|
||||
procedure TCocoaButton.actionButtonClick(sender: NSObject);
|
||||
begin
|
||||
if CocoaWidgetSet.IsControlDisabledDueToModal(Self) then Exit;
|
||||
|
||||
// this is the action handler of button
|
||||
if Assigned(callback) then
|
||||
callback.ButtonClick;
|
||||
@ -2276,6 +2274,7 @@ end;
|
||||
function LCLControlExtension.lclIsEnabled:Boolean;
|
||||
begin
|
||||
Result := IsEnabled;
|
||||
if Result and CocoaWidgetSet.IsControlDisabledDueToModal(Self) then Result := False;
|
||||
end;
|
||||
|
||||
procedure LCLControlExtension.lclSetEnabled(AEnabled:Boolean);
|
||||
|
||||
@ -320,6 +320,7 @@ procedure TLCLRadioButtonCallback.ButtonClick;
|
||||
var
|
||||
SubView: NSView;
|
||||
begin
|
||||
if not Owner.lclIsEnabled() then Exit;
|
||||
if NSButton(Owner).state = NSOnState then
|
||||
begin
|
||||
for SubView in NSButton(Owner).superView.subviews do
|
||||
@ -333,6 +334,7 @@ end;
|
||||
|
||||
procedure TLCLButtonCallback.ButtonClick;
|
||||
begin
|
||||
if not Owner.lclIsEnabled() then Exit;
|
||||
SendSimpleMessage(Target, LM_CLICKED);
|
||||
end;
|
||||
|
||||
@ -348,6 +350,7 @@ end;
|
||||
procedure TLCLCheckBoxCallback.ButtonClick;
|
||||
begin
|
||||
inherited;
|
||||
if not Owner.lclIsEnabled() then Exit;
|
||||
SendSimpleMessage(Target, LM_CHANGED);
|
||||
// todo: win32 has something about dbcheckbox handling here. so maybe we need to handle it special too
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user