Home > Archive > Programming with dBASE > October 2005 > Seeker CC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Seeker CC
Pat Curran

2005-10-17, 1:26 pm

Hi;

I am currently using a seeker.cc for vdBase 5.7. I want to remove the custom
class and just place the lines of code for my entryfield. The reason I want
to do this is because I want to do some stuff on the onLostFocus event. If I
try to do something now, I recieve the error that this is linked to a
outside procedure and asks me if I want to overwrite it. Basically what I
want to do is to add an entryfield and it will work like the seeker. How is
this done? Here is the code from the seeker:

CLASS Seeker( fArg, cName ) of entryfield( fArg, cName ) CUSTOM

this.SelectAll = .t.
this.Value = ""

PROCEDURE OnGotFocus
this.lNear = ( SET( "NEAR" ) == "ON" )
this.lExact = ( SET( "EXACT" ) == "ON" )
set near on && To do incremental matching
set exact off && To return FOUND() .T. on substring match

PROCEDURE Key( nChar, nPosition )
if nChar == 255
if .not. isblank( this.Value )
this.Seek()
endif
nChar = 0
else
if nChar >= 32 .and. nChar < 255
keyboard "{255}"
endif
endif
RETURN nChar

PROCEDURE Seek
seek this.NormalizedValue()
if eof() && Always move record pointer to real record
goto bottom
endif

PROCEDURE NormalizedValue
RETURN upper( trim( this.Value ))

PROCEDURE OnLostFocus
if .not. this.lNear
set near off
endif
if this.lExact
set exact on
endif

ENDCLASS

Thanks
Pat


Bruce Beacham

2005-10-17, 1:26 pm

Pat Curran wrote:

> I am currently using a seeker.cc for vdBase 5.7. I want to remove the
> custom class and just place the lines of code for my entryfield. The
> reason I want to do this is because I want to do some stuff on the
> onLostFocus event. If I try to do something now, I recieve the error
> that this is linked to a outside procedure and asks me if I want to
> overwrite it.



That's OK. Override it, and in your overriding code make a call to the
superclass's method:

seeker::onLostFocus(
)

Then you don't need to duplicate its code.


Bruce Beacham
Pat Curran

2005-10-17, 1:26 pm

Thanks Bruce! I didnt know you could do that :-)


Bruce Beacham

2005-10-17, 1:26 pm

Pat Curran wrote:
> Thanks Bruce! I didnt know you could do that :-)


Ah, this is dBASE - anything is possible!


Bruce
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com