home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
numhdl.zip
/
NUMERIC.CPP
next >
Wrap
Text File
|
1993-09-29
|
2KB
|
32 lines
/**************************************************************************/
/* class NumericHandler */
/* Change History: */
/* Rel Programmer Stamp Date Description */
/* --- ----------------- ----- -------- --------------------------------- */
/* 1.0 Drew Frantz AFF 09/29/93 Creation */
/* A simple numeric handler that is subclassed from the an */
/* IKeyboardhandler. This handler can be attached to IEntryfield instances*/
/* to only permit the entry of numeric characters within the field */
/* (c) Campbell Soup Co. 1993 */
/* CIS: 70712,3547 */
/**************************************************************************/
#include "numeric.hpp"
// ===================================================================
NumericHandler::NumericHandler() : IKeyboardHandler()
{
}
// ===================================================================
Boolean NumericHandler::characterKeyPress(IKeyboardEvent& keyevt)
{
// returning false continues through the hdlr tree
// " true stops at this hdlr.
// if I enter a numer it will display it in the Entryfield
// if it is not a numer it won't ..
if(keyevt.character() <= '9' && keyevt.character() >= '0')
return(false);
else
return(true);
}
// ===================================================================