BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OnKeyPress

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Borut Sustar
Guest





PostPosted: Tue Nov 11, 2003 10:34 am    Post subject: OnKeyPress Reply with quote




Hello!

I created new component based on TDBEdit1 and I wanted to modify standard
OnKeyPress event. So, below there is my code in which the compiler returned
an
error:

class PACKAGE bTDBEdit1 : public TDBEdit1
{
private:
protected:
void __fastcall KeyPress();
public:
__fastcall (TComponent* Owner);
__published:
__property OnKeyPress;

};

void __fastcall bTDBEdit1::KeyPress()
{
TDBEdit1::KeyPress(); // perform standard handling, including
calling handler
// your customizations go here
}

Thx in advance
Borut
Slovenia


Back to top
Todd Brylski
Guest





PostPosted: Tue Nov 11, 2003 11:06 am    Post subject: Re: OnKeyPress Reply with quote



"Borut Sustar" <borut (AT) bokosoft (DOT) si> wrote

Quote:
I created new component based on TDBEdit1 and I wanted to modify standard
OnKeyPress event. So, below there is my code in which the compiler returned
an error:
...
void __fastcall KeyPress();
...

the proper declaration is:

DYNAMIC void __fastcall KeyPress(char &Key);

Todd



Back to top
Borut Sustar
Guest





PostPosted: Tue Nov 11, 2003 3:01 pm    Post subject: Re: OnKeyPress Reply with quote



Still error.

class PACKAGE bTDBEdit1 : public TDBEdit
{
private:
protected:
DYNAMIC void __fastcall KeyPress(char &Key);
public:
__fastcall bTDBEdit1(TComponent* Owner);
__published:
__property OnKeyPress;
default=true};
};

void __fastcall bTDBEdit1::KeyPress()
{
TDBEdit::KeyPress(); // perform standard handling, including
calling handler
// your customizations go here
}

ERROR:
[C++ Error] bTDBEdit1.cpp(13): E2316 '_fastcall bTDBEdit1::KeyPress()' is
not a member of 'bTDBEdit1'

?????
Borut

"Todd Brylski" <tbrylski (AT) yyaahhoooo (DOT) com> wrote

Quote:
"Borut Sustar" <borut (AT) bokosoft (DOT) si> wrote

I created new component based on TDBEdit1 and I wanted to modify
standard
OnKeyPress event. So, below there is my code in which the compiler
returned
an error:
...
void __fastcall KeyPress();
...

the proper declaration is:

DYNAMIC void __fastcall KeyPress(char &Key);

Todd





Back to top
Timothy H. Buchman
Guest





PostPosted: Tue Nov 11, 2003 3:42 pm    Post subject: Re: OnKeyPress Reply with quote

"Borut Sustar" <borut (AT) bokosoft (DOT) si> wrote

Quote:
Still error.
TDBEdit::KeyPress(); // perform standard handling,
including


This function has an argument, key, which you omitted. You are
calling the inherited function here, so the argument is required.

--
Timothy H. Buchman
========================================
City Center Theater, New York NY
mail address tbuchmanPLEASE(at sign)REMOVEcitycenterD O Torg
Search .borland message archive on http://www.tamaracka.com/search.htm


Back to top
Todd Brylski
Guest





PostPosted: Tue Nov 11, 2003 3:59 pm    Post subject: Re: OnKeyPress Reply with quote

"Borut Sustar" <borut (AT) bokosoft (DOT) si> wrote

Quote:
Still error.

You forgot the arg to KeyPress(char& Key).
Exactly what Tim said.

Quote:
__published:
__property OnKeyPress;

You don't need to republish this. It is already published in TDBEdit.

Todd



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.