Post by John NobleHello Guys,
I'm using a Seeker Control along with a grid. The grids height shows around
10 rows. It also has 2 columns - ID & Name.
As the user types the beginning of the ID into the seeker, the grid will
begin to find the first closest match. What I would like the up / down
arrows to do is move the selected row on the grid.
UpArrow = form.rowset.next(-1)
DnArrow = form.rowset.next()
Sorry if this is a dumb question but where and how do I do this?
John,
If all you want to do is add arrow key navigation to a seeker control,
Marc VdB created an mSeeker.cc control (which I extended slightly with a
few other options). I've been using it successfully, and it's replacing
the ON KEY LABEL option I posted in an earlier message, primarily
because the ON KEY LABEL is slightly but noticeably slower than mSeeker.
Header below, zip posted in Binaries:
/***********************************************************************
Programmers....: Marc Van den Berghen, Roland Wingerter, Rich Assaf
Version........: 0.6 (5 May 2008)
Notes..........: This seeker extends basic Seeker/zSeeker functionality
Additional features:
- Up/Down arrow keys can be used to navigate in the rowset
- PgUp and PgDn will skip by user-defined nSkipRecords
- Home and End keys go first() and last() respectively
- PgUp/PgDn/Home/End can be ignored by the paintbox
- seeker can optionally react to the Enter key
(just assign your own method).
- optionally execute code if seeker doesn't find a match
- Features from zSeeker (By Peter Rorlick, Feb 1998)
* Does a SEEK on Backspace or Del
* Yellow background when in focus.
* Choice to enable/disable the exact match functionality
Written for ...: dBase 32bit (7.0 --> )
History.......:
0.1 (Jan 12, 2007) Marc VdB posted Seekerform.wfm in dbase.programming
0.2 (Jan 12, 2007) R. Wingerter made cc form Marc's code
0.3 (Jan 13, 2007) New custom property onEnterAction replaces
properties bSelectOnEnter and cFieldName.
0.5 (Feb 24, 2007) - Rich Assaf
Extended paintbox to respond to Home/End/PgUp/PgDn.
Eliminated dependencies on zSeeker and Seeker
Added NoMatch functionality if the seek fails
Corrected typo: re_estate() to re_state()
0.6 (May 5, 2008) - Rich Assaf
Added properties lAllowEOF and lSelectAll
Reason:
If true, lAllowEOF will position record pointer to EOF,
visually indicating (to datalinked controls) if the
seeker is in uncharted territory.... lSelectAll more
robustly selects the entire field contents than the built-
in standard EntryField property (allows single mouse click).
Dependencies.: Messenger.cc (included at bottom of this file)
Usage.......: This class can be used in the same way as Seeker.cc.
In the form designer, make sure that the rowset you wish
to use this control with has the indexName property set to
an index tag that is character, and created with the UPPER()
function, so that it is indexed on the upper-case of any
characters in the field(s) index on.
Drag the SEEKER control to the design surface. When the form
is run, entering text in the entryfield will cause an
incremental search to occur, using the index tag mentioned
above.
NOTE: do not attempt to datalink this custom entryfield,
first, it is "protected" so that you cannot access this
property in the designer, and second, the code will not function
properly if datalinked to a field in the table.
If you want the control to react to the Enter key,
simply assign a method to this.onEnterAction in
an overridden onOpen event. (cf. sample form).
Note that, although not required, it is a good idea to call
mSeeker.cleanup() in your form's canClose event.
***********************************************************************/