| View previous topic :: View next topic |
| Author |
Message |
Borut Sustar Guest
|
Posted: Tue Nov 11, 2003 10:34 am Post subject: OnKeyPress |
|
|
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
|
Posted: Tue Nov 11, 2003 11:06 am Post subject: Re: OnKeyPress |
|
|
"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
|
Posted: Tue Nov 11, 2003 3:01 pm Post subject: Re: OnKeyPress |
|
|
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
|
Posted: Tue Nov 11, 2003 3:42 pm Post subject: Re: OnKeyPress |
|
|
"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
|
Posted: Tue Nov 11, 2003 3:59 pm Post subject: Re: OnKeyPress |
|
|
"Borut Sustar" <borut (AT) bokosoft (DOT) si> wrote
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 |
|
 |
|