mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 11:30:28 +02:00
Merged revision(s) 52306 #2b94ec1a7c from trunk:
IDEIntf: assign OnClick events in RegisterIDEButtonCommand. Issue #30137 ........ git-svn-id: branches/fixes_1_6@52314 -
This commit is contained in:
parent
132a62707f
commit
81b73425cc
@ -1697,22 +1697,21 @@ procedure TIDESpecialCommand.SetCommand(const AValue: TIDECommand);
|
|||||||
begin
|
begin
|
||||||
if FCommand = AValue then
|
if FCommand = AValue then
|
||||||
Exit;
|
Exit;
|
||||||
if FCommand <> nil then
|
|
||||||
begin
|
|
||||||
//DebugLn('TIDEMenuCommand.SetCommand OLD ',ShortCutToText(FCommand.AsShortCut),' FCommand.Name=',FCommand.Name,' Name=',Name,' FCommand=',dbgs(Pointer(FCommand)));
|
|
||||||
if FCommand.OnExecute=OnClick then
|
|
||||||
FCommand.OnExecute:=nil;
|
|
||||||
if FCommand.OnExecuteProc=OnClickProc then
|
|
||||||
FCommand.OnExecuteProc:=nil;
|
|
||||||
end;
|
|
||||||
FCommand := AValue;
|
FCommand := AValue;
|
||||||
if FCommand <> nil then
|
if FCommand <> nil then
|
||||||
begin
|
begin
|
||||||
if FCommand.OnExecute = nil then
|
if (FCommand.OnExecute=nil) and (OnClick<>nil) then
|
||||||
FCommand.OnExecute := OnClick;
|
FCommand.OnExecute := OnClick
|
||||||
if FCommand.OnExecuteProc = nil then
|
else
|
||||||
FCommand.OnExecuteProc := OnClickProc;
|
if (OnClick=nil) and (FCommand.OnExecute<>nil) then
|
||||||
//DebugLn('TIDEMenuCommand.SetCommand NEW ',ShortCutToText(FCommand.AsShortCut),' FCommand.Name=',FCommand.Name,' Name=',Name,' FCommand=',dbgs(Pointer(FCommand)));
|
OnClick := FCommand.OnExecute;
|
||||||
|
|
||||||
|
if (FCommand.OnExecuteProc=nil) and (OnClickProc<>nil) then
|
||||||
|
FCommand.OnExecuteProc := OnClickProc
|
||||||
|
else
|
||||||
|
if (OnClickProc=nil) and (FCommand.OnExecuteProc<>nil) then
|
||||||
|
OnClickProc := FCommand.OnExecuteProc;
|
||||||
|
|
||||||
FCommand.UserAdded(Self);
|
FCommand.UserAdded(Self);
|
||||||
FCommand.Change;
|
FCommand.Change;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user