🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6053

How to implement inherited for CM_DIALOGKEY

#6053
From: Blue Knight
Date: Mon, 13 Jun 2005 10:40
44 lines
1940 bytes
Hi all,

I have a message handler in my form for CM_DIALOGKEY, in order to trap 
TAB.  However, if the current Control is not one of two, then I want to 
perform the default action - how can I do that?  In Delphi you can use 
inherited, but I don't know what the equivalent is in C++.

eg.

class TMyForm : public TForm
{
...
protected:
   void __fastcall CMDialogKey(TMessage msg);

BEGIN_MESSAGE_MAP
   MESSAGE_HANDLER(CM_DIALOGKEY, TMessage, CMDialogKey)
END_MESSAGE_MAP(TForm);
};


void __fastcall TMyForm::CMDialogKey(TMessage msg)
{
// Control1 and Control2 are controls on the form
   if(ActiveControl == Control1 || ActiveControl == Control2)
   {
     if(msg.WParam == VK_TAB)
     {
       // Do special handling here
       msg.Result = 1;
       return;
     }
   }

   // What do I need to do here?
}

I have tried Perform(...) and TForm::Perform(...), but both result in a 
stack overflow, for obvious reasons.


Regards,

Bevan
Technical Details
Message-ID: <42ad62c4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,59059b6367de65a2,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 13 Jun 2005 22:40:56 +1200
From: Blue Knight <bevan231X@Xhotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to implement inherited for CM_DIALOGKEY
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.109.148.53
Message-ID: <42ad62c4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1118659268 203.109.148.53 (13 Jun 2005 03:41:08 -0700)
Lines: 44
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail