Jump to content

execCommand


picyka

Recommended Posts

procedure TUnimFormGerarChaveLiberacaoM.btnGerarChaveClick(Sender: TObject);
begin
  if Self.edProtocolo.Text = '' then
  begin
    TMessageUtils.Warning('Protocolo não informado!');
    Self.edProtocolo.SetFocus;
    Exit;
  end;

  Self.UnimMemoChave.Text := TEncryption.Encrypt(UniMainModule.UserActive.Empresa.Id.ToString + '|' + UniMainModule.UserActive.Id.ToString + '|' + Self.edProtocolo.Text);

  btnGerarChave.JSInterface.JSCode('UnimFormGerarChaveLiberacaoM.UnimMemoChave.focus(true);');
  btnGerarChave.JSInterface.JSCode('UnimFormGerarChaveLiberacaoM.UnimMemoChave.select();');
  btnGerarChave.JSInterface.JSCode('document.execCommand(''copy'');');
end;

I would like when clicking a button on mobile, copy the text of a memo, is this possible? I need this format, because before copying I need to run a rule to feed the memo.

Link to comment
Share on other sites

11 minutes ago, picyka said:
procedure TUnimFormGerarChaveLiberacaoM.btnGerarChaveClick(Sender: TObject);
begin
  if Self.edProtocolo.Text = '' then
  begin
    TMessageUtils.Warning('Protocolo não informado!');
    Self.edProtocolo.SetFocus;
    Exit;
  end;

  Self.UnimMemoChave.Text := TEncryption.Encrypt(UniMainModule.UserActive.Empresa.Id.ToString + '|' + UniMainModule.UserActive.Id.ToString + '|' + Self.edProtocolo.Text);

  btnGerarChave.JSInterface.JSCode('UnimFormGerarChaveLiberacaoM.UnimMemoChave.focus(true);');
  btnGerarChave.JSInterface.JSCode('UnimFormGerarChaveLiberacaoM.UnimMemoChave.select();');
  btnGerarChave.JSInterface.JSCode('document.execCommand(''copy'');');
end;

I would like when clicking a button on mobile, copy the text of a memo, is this possible? I need this format, because before copying I need to run a rule to feed the memo.

Hello, try here: http://forums.unigui.com/index.php?/search/&q=clipboard&quick=1

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...