Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 21 total
Thread Suggestion: Clipboard API support
Wed, Sep 16 2015 5:10 PMPermanent Link

PA

It seems that EWB does not yet have support for platform clipboard.

However, Clipboard API is supported by all modern browsers:

http://caniuse.com/#feat=clipboard

Is this already on the EWB to-do list?
Thu, Sep 17 2015 9:10 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< It seems that EWB does not yet have support for platform clipboard.

However, Clipboard API is supported by all modern browsers:

http://caniuse.com/#feat=clipboard

Is this already on the EWB to-do list? >>

What exactly are you looking to use the clipboard API for ?  Do you just want clipboard events, or do you want to manipulate the clipboard data programmatically ?

EWB handles the copy/cut/paste/ events, but doesn't dispatch them as events currently.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Sep 17 2015 2:30 PMPermanent Link

PA

>What exactly are you looking to use the clipboard API for ?  Do you just want clipboard events, or do you want to manipulate the clipboard data programmatically ?

>EWB handles the copy/cut/paste/ events, but doesn't dispatch them as events currently.

>Tim Young
>Elevate Software
>www.elevatesoft.com

Copy & paste.

Searching the EWB manual, I did not find the word "clipboard" nor a class TClipboard.
Thu, Sep 17 2015 5:47 PMPermanent Link

Raul

Team Elevate Team Elevate

> Copy & paste.
> Searching the EWB manual, I did not find the word "clipboard" nor a class TClipboard.

EWB supports it internally so both on desktop browsers and on mobile
user can copy and paste within EWB app as well as to other apps and OS
itself.

So from user side of things it "just works".

Are you looking to programmatically access system clipboard ? Most
browsers consider this a security risk so it's not a that useful (if you
really need it you can likely accomplish it thru external interfaces).

Raul
Fri, Sep 18 2015 7:15 AMPermanent Link

PA

Thanks for the information.

Yes, of course I mean programmatically.
Fri, Sep 18 2015 9:46 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< Copy & paste. >>

Yes, I know.  But, again, are you looking for copy/cut/paste events so that you can detect such operations, or are you trying to programmatically alter the clipboard ?  If the latter, then you will have issues doing so across all browsers.  As Raul indicates, there are small inconsistencies and security implications that make such access problematic.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Sep 9 2016 5:40 PMPermanent Link

Trinione

Tim Young [Elevate Software] wrote:

<< ... are you looking for copy/cut/paste events so that you can detect such operations >>

Hi:
How can selected text in say a MultiLineEdit control be saved to the Clipboard via a button click?
Sat, Sep 10 2016 11:51 AMPermanent Link

Raul

Team Elevate Team Elevate

On 9/9/2016 5:40 PM, Trinione wrote:
> How can selected text in say a MultiLineEdit control be saved to the Clipboard via a button click?


Have not tried it myself but most browser these days support
"execCommand" with "copy" as the actual command.

See this:
https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand

Bottom of that doc also provides browser compatibility matrix


Raul
Sat, Sep 10 2016 12:18 PMPermanent Link

Raul

Team Elevate Team Elevate

On 9/10/2016 11:51 AM, Raul wrote:
> On 9/9/2016 5:40 PM, Trinione wrote:
>> How can selected text in say a MultiLineEdit control be saved to the
>> Clipboard via a button click?
> See this:
> https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand
> Bottom of that doc also provides browser compatibility matrix

I was playing with external interfaces for something else and tried this
out - works just fine. (noticed after that Webdom does surface the
execCommand under TDocument but had already done external interface so
will list that):


so i have an external JS file in the project and i added this function
to it


function CopySelectionToClipBoard()
{
   return document.execCommand('copy',true,null);
}


and in EWB declared it

   external function CopySelectionToClipBoard():boolean;

and calling it like this (in my case i'm doing the SelectALL but if you
have selection already then skip this line)

procedure TForm1.Button1Click(Sender: TObject);
begin
   MultiLineEdit1.SelectAll;
   CopySelectionToClipBoard();
end;


Raul
Wed, Sep 14 2016 12:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Raul,

<< I was playing with external interfaces for something else and tried this out - works just fine. (noticed after that Webdom does surface the execCommand under TDocument but had already done external interface so will list that): >>

Raul did the heavy lifting (thanks Raul !), but here's the WebDOM equivalent:

uses WebDOM;

procedure TForm1.Button5Click(Sender: TObject);
begin
  Edit1.SelectAll;
  window.document.execCommand('copy',True,False);
end;

Tim Young
Elevate Software
www.elevatesoft.com
Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image