[Lazarus] Paintbox.Canvas copyrect problem

Leonardo M. Ramé l.rame at griensu.com
Mon May 7 22:29:41 CEST 2012

On 2012-05-07 17:12:46 -0300, Leonardo M. Ramé wrote:
> On 2012-05-07 16:59:06 -0300, Leonardo M. Ramé wrote:
> > Hi, I'm implementing a Copy to clipboard function to an application. It
> > has to copy the contents of a TPaintBox's Canvas into the Clipboard, but
> > found a bug, it copies the windows over the Paintbox too.
> > 
> > I've attached a screenshot showing a popup over the TPaintbox that's
> > also copied with the paintbox's canvas.
> > 
> I must add this problem only happens on Windows. I've also tested it
> using Linux and Wine and it works ok.

I've attached a sample project, containing a TPaintBox with an OnPaint
event which just paints it in red color, then, I placed a TButton in the
middle of the paintbox.

The onClick event of the button copies the contents of the PaintBox to
the clipboard. But, as you can see, it also copies the button.

As the button is not part of the clipboard (it is over it, not part of
it), it shouldn't be copied.

Leonardo M. Ramé
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.gz
Type: application/x-tar-gz
Size: 1767 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120507/c96ab788/attachment-0003.bin>

More information about the Lazarus mailing list