Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CListObjEdit misbehaving
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00482825
Message ID:
00483376
Vues:
8
>Dr. Wieder,
>
>It sounds like you have disabled the "built-in" business object without registering the replacement business object as per the Developer's Guide...si, no?

No Señor, I'm sticking to built-in bizobjs on this one.

However, I did solve the problem by making a few mods to my code and a few to the Framework.

Here's what I did:

MMCode:
in cListObjEdit.SetButtonEnabledStatus
IF	This.oBizObj.lNoRecords = .T.
	*--------------------------------------------
	*--- Disable the Delete, Edit buttons
	*--- (The parent method disables the grid)
	*--------------------------------------------
	This.CListObj1.grdList.Refresh()
	This.CListObj1.grdList.Enabled = .F.
	This.cmdDelete.Enabled = .F.
	This.cmdEdit.Enabled = .F.
	* AW Disabled the following line in the hope that
	* this action will stop interference with keypress event
	* of host form.
	* This.cmdAdd.SetFocus() <--- AW commented this line
ELSE
	*-------------------------------------------
	*--- Enable Delete, Edit buttons
	*--- (The parent method enables the grid)
	*-------------------------------------------
	* AW: Not really. There is no dodefault() anywhere in this method!
	* Added by AW:
	This.CListObj1.grdList.Refresh()
	This.CListObj1.grdList.Enabled = .T.
	This.cmdDelete.Enabled = .T.
	This.cmdEdit.Enabled = .T.
ENDIF
What I don't really understand is why the This.cmdAdd.SetFocus that I commented would interfere with the focus set by vfp. I went MMad looking for this one. I was typing on a control on the form so I would guess the focus was there. Somehow, however, when I hit or , vfp would assume that the focus was on the cmdAdd button and Bam! crossmojination all over the place!

The mods I did to my version of the cListObjEdit simply set the bizobj's lNoRecords to .f. as soon as I add a new record to the cursor through code.

Now all my objects feel loved again.

Thanks for trying!

Alex
Low-carb diet not working? Try the Low-food diet instead!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform