Article View: borland.public.cppbuilder.nativeapi
Article #17415drag and drop mouse
From: Jeff Kish
Date: Wed, 26 Mar 2003 20:57
Date: Wed, 26 Mar 2003 20:57
39 lines
1890 bytes
1890 bytes
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)?
I have some c code that does it, but I thought there might be a better
way to to it in cbuilder, given all the events it allows you to
capture. I am dealing with a TPanel on a form.
Thanks
Jeff
p.s. the c code basically does this upon a mouse down message:
set capture
//eat mouse messages until a wm_lbuttonup is encountered
//meanwhile drawing your desired box/rubberband/whatever
for (;;)
{
if (PeekMesage(msg, 0, WM_MOUSEFIRST, WM_MOUSELAST,
PM_REMOVE))
{
DrawStuff();
if (msg.message == WM_LBUTTONUP)
{
result = true;
break;
}
if (msg.message == WM_RBUTTONUP)
{
result = false;
break;
}
continue;
}
ReleaseCapture();
return result;// true means something was captured
}
Technical Details
Message-ID:
<ri448vcicvl3p405t80aohjaeancic9b93@4ax.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-mailShow 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 21:13:44 PST From: Jeff Kish <jeff.kish@mro.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: drag and drop mouse Date: Wed, 26 Mar 2003 15:57:00 -0500 Message-ID: <ri448vcicvl3p405t80aohjaeancic9b93@4ax.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 208.44.113.190 X-Trace: newsgroups.borland.com 1048712218 208.44.113.190 (26 Mar 2003 12:56:58 -0800) Lines: 39 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