Article View: borland.public.cppbuilder.nativeapi
Article #14813Re: Trapping button message?
From: Mattias Carleson
Date: Wed, 30 Jul 2003 15:59
Date: Wed, 30 Jul 2003 15:59
22 lines
1657 bytes
1657 bytes
Hi!
The trapping seems to work, but the ControlAtPos() doesnt return anything
but NULL
although the coordinates in 'TPoint click' is within the TSpeedButtons
limits. Any idea why?
My speedbutton is placed upon a TCoolBar.
(The syntax for ControlAtPos should be ControlAtPos(click,false) I think.)
/Mattias
> void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled)
> {
> if(Msg.message == WM_LBUTTONDOWN)
> {
> TPoint click=Form1->ScreenToClient(Msg.pt);
> TControl* cntrl=Form1->ControlAtPos(click,False,False);
> if(!cntrl)return;
> if(SpeedButton1 ==
dynamic_cast<TSpeedButton*>(cntrl))ShowMessage("Button event catched!");
> }
> }
Technical Details
Message-ID:
<3f27eaec$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f26ea7c$1@newsgroups.borland.com> <3f27c07b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,77c37ce9ffa755d1 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-30 09:06:19 PST From: "Mattias Carleson" <mattias.carleson@commentor.se> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f26ea7c$1@newsgroups.borland.com> <3f27c07b$1@newsgroups.borland.com> Subject: Re: Trapping button message? Date: Wed, 30 Jul 2003 17:59:17 +0200 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 194.71.186.117 Message-ID: <3f27eaec$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059580652 194.71.186.117 (30 Jul 2003 08:57:32 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail