Article View: borland.public.cppbuilder.nativeapi
Article #17406Re: drag and drop mouse
From: Rodolfo Frino - Stargate Softwar...
Date: Wed, 26 Mar 2003 21:30
Date: Wed, 26 Mar 2003 21:30
42 lines
2178 bytes
2178 bytes
You can create (or maybe display) a "box" (in this example a TRichEdit
control)
when the mouse goes down on your panel, and destroy (or maybe hide) the
"box"
when the mouse goes up on your panel (or held down and moved away from the
panel
and then released) by using the event handlers corresponding to the
OnMouseDown and OnMouseUp events:
TRichEdit* p1;
void __fastcall TForm1::Panel1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button == mbLeft)
{
// Create your component here
p1 = new TRichEdit(this);
p1->Parent = this;
//...
}
}
void __fastcall TForm1::Panel1MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if (Button == mbLeft)
delete p1; // Destroy your component here
}
Rodolfo
"Jeff Kish" <jeff.kish@mro.com> wrote in message
news:ri448vcicvl3p405t80aohjaeancic9b93@4ax.com...
> Greetings.
>
> Is there a code snippet appropriate for cbuilder that shows the best
> way to display a image/wireframe/box/whatever when the user is
> operating the mouse to select stuff (i.e. between the mouse down and
> mouse up)?
Technical Details
Message-ID:
<3e8224ed$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<ri448vcicvl3p405t80aohjaeancic9b93@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8f01a687cd3e32e5 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-26 20:56:43 PST From: "Rodolfo Frino - Stargate Software" <starcinema@eftel.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <ri448vcicvl3p405t80aohjaeancic9b93@4ax.com> Subject: Re: drag and drop mouse Date: Thu, 27 Mar 2003 08:30:46 +1100 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 203.129.132.249 Message-ID: <3e8224ed$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048716525 203.129.132.249 (26 Mar 2003 14:08:45 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail