|
Home > Archive > Programming with dBASE > November 2005 > KeyPX on a container?
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 |
KeyPX on a container?
|
|
| Rich Assaf 2005-11-10, 3:23 am |
| I'm having problems figuring out how to get Todd's excellent control onto a
container, the form below shows the error. I've tried various ways to
eliminate the 'No such form object' error, all to no avail so far.... Can
this code be modified to work? Thanks, Rich Assaf
** END HEADER -- do not remove this line
//
// Generated on 11/09/2005
//
parameter bModal
local f
f = new testKeyPxForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class testKeyPxForm of FORM
set procedure to KeyPX.cc additive
with (this)
open = class::OPEN
metric = 6 // Pixels
height = 352.0
left = 196.0
top = 0.0
width = 420.0
text = ""
endwith
this.SEEKEREX1 = new QUERY()
this.SEEKEREX1.parent = this
with (this.SEEKEREX1)
left = 301.0
top = 330.0
sql = 'select * from "SeekerEx.DBF"'
active = true
endwith
this.CONTAINER1 = new CONTAINER(this)
with (this.CONTAINER1)
left = 21.0
top = 22.0
width = 378.0
height = 66.0
endwith
this.CONTAINER1.ENTRYFIELD1 = new ENTRYFIELD(this.CONTAINER1)
with (this.CONTAINER1.ENTRYFIELD1)
dataLink = form.seekerex1.rowset.fields["character"]
height = 22.0
left = 10.0
top = 10.0
width = 91.0
endwith
this.CONTAINER1.SEEKER = new ENTRYFIELD(this.CONTAINER1)
with (this.CONTAINER1.SEEKER)
onGotFocus = class::STYLE0_ONGOTF
OCUS
dataLink = form.seekerex1.rowset.fields["character"]
height = 22.0
left = 125.0
top = 10.0
width = 112.0
colorNormal = "WindowText/0x80ff80"
endwith
this.GRID1 = new GRID(this)
with (this.GRID1)
dataLink = form.seekerex1.rowset
cellHeight = 22.0
height = 143.0
left = 35.0
top = 154.0
width = 371.0
endwith
this.KEYPX = new KEYPX(this)
this.rowset = this.seekerex1.rowset
function Open
*************
*- Overriden open method to setup keypx
// Control is a field and index based seeker rather than an
// index based seeker only. This means the control needs to
// know the field it is searching and the index (if any) used
// to search the field. Knowing the field, the control can
// perform the autocomplete (autofill) feather and perform
// non-indexed searches.
this.keypx.setDataSource(this.rowset.fields['Character'])
this.keypx.setIndex("C_Upper") // Upper of Character
this.rowset.first()
return super::open()
function Style0_onGotFocus
********************
******
*- Setup for Style 0 - Seeker
this.form.keypx.style = 1
this.form.keypx.before = (this)
this.form.keypx.attach((this), true)
return
endclass
| |
| Todd Kreuter 2005-11-10, 7:23 am |
| Rich Assaf wrote:
>
> I'm having problems figuring out how to get Todd's excellent control onto a
> container, the form below shows the error. I've tried various ways to
> eliminate the 'No such form object' error, all to no avail so far.... Can
> this code be modified to work? Thanks, Rich Assaf
Hi Rich,
In that demo form, its shuffling the z-order as each entryfield gets
focus because focus is always passed back to the keyPX. You would not
ordinarily do that when just using one entryfield, so you should ignore
the code setting the before property.
Also, keyPX would need to be in the container with the entryfield to
work properly. Are you trying to create a simple seeker or something
else?
--
Todd Kreuter [dBVIPS]
| |
| Rich Assaf 2005-11-12, 3:23 am |
| Thanks Todd, got it working with your clues....
One other thing - the feature added to look for a placeholder character
(e.g. a comma) doesn't always work as expected - try adding just the name
"Doe" to your sample table. Now it is no longer possible to type in "Doe,
J" or whatever, it's like the comma can't be found. Just a small issue...
Thanks again, Rich
"Todd Kreuter" <tkreuter@dbvips.usa> wrote in message
news:437345B5.6F8BC5A7@dbvips.usa...
>
> In that demo form, its shuffling the z-order as each entryfield gets
> focus because focus is always passed back to the keyPX. You would not
> ordinarily do that when just using one entryfield, so you should ignore
> the code setting the before property.
>
> Also, keyPX would need to be in the container with the entryfield to
> work properly. Are you trying to create a simple seeker or something
> else?
>
> --
> Todd Kreuter [dBVIPS]
| |
| Todd Kreuter 2005-11-15, 9:23 am |
| Rich Assaf wrote:
>
> Thanks Todd, got it working with your clues....
>
> One other thing - the feature added to look for a placeholder character
> (e.g. a comma) doesn't always work as expected - try adding just the name
> "Doe" to your sample table. Now it is no longer possible to type in "Doe,
> J" or whatever, it's like the comma can't be found. Just a small issue...
The current row determines how the data is structured (what separators
are used). If there is no consistency then there will be a problem. Will
have to look at that again.
--
Todd Kreuter [dBVIPS]
|
|
|
|
|