[DUG] Copy and Paste
Paul A Norman
paul.a.norman at gmail.com
Wed Oct 26 18:50:30 NZDT 2005
If you want something less idyllic and a quick (and hopefully not nasty)
solution . . .
you might train the user to Crtl+Click or double click the components they
want to copy. Declare a global Tstringlist, and create in the form
FormCreate event, (free it in the form's ondestroy I think), attach to the
copyable components' onmousedown a method (common for components of common
descent) to test the mouse down for a CRTL presence or just use the
ondoubleclick.
Once fired, in the chosen method add to the Tstringlist the caption or text
property contents.
Add a popup menu item for the form, "Copy Chosen" or something, and put the
text held in the Tstringlist onto the clipboard, or write it to stream, or
send a wm_CopyData message, and always clear the Tstringlist for the next
round.
As I said not idyllic but good enough sometimes.
Paul
On 25/10/05, Paul McKenzie <paul at smss.org.nz> wrote:
>
> Have you looked into converting the Form (Selected area) to a canvas.
> I can't remember how to do this (many years since I looked into this area)
> - I think you can print
> the form to a file that may give the canvas or there are functions to
> convert the form to a canvas -
> It may be as easy as just looking at the Form.Canvas.
>
> HTH
>
> This may give some new direction or ideas...
>
> Regards
> Paul McKenzie
> Wellington
> New Zealand
>
>
> John Bird wrote:
> > Even if I use one of the copy/paste aware controls, ideally what I want
> to
> > do is to allow users to drag and select over a range of the screen. That
> is
> > give the user the freedom to select and copy whatever they want as
> though
> > they were in a text document/email/word document etc...
> >
> > eg to pick up a name and 3 address lines in one selection.
> > These are in 4 different controls, so I don't think I can do that anyway
> > with any normal components....
> >
> > John
> >
> > -----Original Message-----
> > From: Rohit Gupta [mailto:rohit at cfl.co.nz]
> > Sent: Tuesday, 25 October 2005 10:18 a.m.
> > To: johnkbird at paradise.net.nz; NZ Borland Developers Group - Delphi List
> > Subject: Re: [DUG] Copy and Paste
> >
> >
> > For Data, you should be using StaticText. Labels are not for
> > dynamic information. I still dont know if Copy/Paste will work... but it
> > is the more appropriate component for your purpose.
> >
> > From: "John Bird" <johnkbird at paradise.net.nz>
> > To: "'NZ Borland Developers Group - Delphi List'" <delphi at ns3.123.co.nz>
> > Subject: [DUG] Copy and Paste
> > Date sent: Fri, 21 Oct 2005 16:02:46 +1300
> > Organization: John Bird Consulting
> > Send reply to: johnkbird at paradise.net.nz,
> > NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
> > <mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
> > <mailto:delphi-request at ns3.123.co.nz?subject=subscribe>
> >
> >
> > With data displayed in labels on a form or data displayed in
> > stringlists (read only) there seems no way to use the clipboard to
> > copy and paste data. Is there a way around this, or to allow a copy
> > and paste option do I have to either (i) put the data in the clipboard
> > programmatically or (ii) use a different control to display data.
> >
> > John
> >
> >
> > Regards
> >
> > Rohit
> >
> > ====================================================
> > ==================
> > CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New
> > Zealand
> > PH (649) 489-2280
> > FX (649) 489-2290
> > email rohit at cfl.co.nz or r.gupta at xtra.co.nz
> > ====================================================
> > ==================
> >
> >
> >
> >
> > _______________________________________________
> > Delphi mailing list
> > Delphi at ns3.123.co.nz
> > http://ns3.123.co.nz/mailman/listinfo/delphi
> >
> >
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20051026/de78e981/attachment.html
More information about the Delphi
mailing list