Item added to context menu is always disabled
Posted: Thu Mar 06, 2025 12:37 pm
In the ChromiumBeforeContextMenu event, I clear the context menu options and add new options.
However, even after passing through the model.SetEnabled method, it remains disabled.
What can I do to resolve the situation?
I am using version 131 of CEF4Delphi.
Code: Select all
procedure TFraChromium.ChromiumBeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; const model: ICefMenuModel);
var
LOption: TMenuOption;
begin
model.Clear;
for LOption in FMenuOptions do
begin
case LOption.Id
of 0: model.AddSeparator;
else
Begin
model.AddItem(LOption.Id, LOption.Caption);
model.SetEnabled(LOption.Id, True);
End;
end;
end;
end;
What can I do to resolve the situation?
I am using version 131 of CEF4Delphi.