Default actions do not work with the control by default TEmbeddedWB, because this component does not come off TCustomEdit. TEditAction, which TEditSelectAllleaves, knows only how to process TCustomEdits.
OnUpdate OnExecute , . , , . TEditSelectAll.
procedure TForm1.EditSelectAll1Update(Sender: TObject);
begin
EditSelectAll1.Enabled := (Screen.ActiveControl is TEmbeddedWB) or
EditSelectAll1.HandlesTarget(ActiveControl)
end;
procedure TForm1.EditSelectAll1Execute(Sender: TObject);
begin
if ActiveControl is TEmbeddedWB then
TEmbeddedWB(Screen.ActiveControl).SelectAll
else
EditSelectAll1.ExecuteTarget(Screen.ActiveControl);
end;
ActionList ( OnActionUpdate OnActionExecute ApplicationEvents) :
procedure TForm1.ActionList1Update(Action: TBasicAction; var Handled: Boolean);
begin
if Action is TEditAction then
begin
TCustomAction(Action).Enabled := (Screen.ActiveControl is TEmbeddedWB) or
Action.HandlesTarget(Screen.ActiveControl);
Handled := True;
end;
end;
procedure TForm1.ActionList1Execute(Action: TBasicAction; var Handled: Boolean);
begin
if (Action is TEditSelectAll) and (Screen.ActiveControl is TEmbeddedWB) then
begin
TEmbeddedWB(Screen.ActiveControl).SelectAll;
Handled := True;
end;
end;