Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to distinguish between column click for drag or clic
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01368955
Message ID:
01369060
Vues:
10
Hi Naomi

One more thing in this regards. The following is the code I use to replace the Header in the grids. Is there any better VFP9 way to do this? Please I have CodeBook as the framework so I won't be able to do things at c-Level just i-Level or in my custom sub-classes based on i-Level classes.

UPDATE: Grid.Init() call this for each column

UPDATE: Grid.ProcessHeader()
LPARAMETERS toColumn


LOCAL loObj, lnProps, lcName, loHeader, loErr, lnCnt
LOCAL ARRAY laProps[1]


FOR EACH loObj IN toColumn.CONTROLS
	IF loObj.BASECLASS = 'Header'
		*** Save the changed properties
		lnProps = AMEMBERS(laProps, loObj)


		*** store the property values
		DIMENSION laVals[lnProps]

		FOR lnCnt = 1 TO lnProps
			laVals[lnCnt] = EVALUATE('loObj.' + laProps[lnCnt])
		ENDFOR


		*** replace the header with custom header class
		*** created in code
		lcName = loObj.NAME

		toColumn.REMOVEOBJECT(lcName)
		toColumn.ADDOBJECT(lcName + "_new", THIS.cHeaderClass)

		loHeader = EVALUATE("toColumn." + ALLTRIM(lcName) + "_new")
		loHeader.NAME = lcName


		*** Restore the changed properties
		FOR lnCnt = 1 TO lnProps
			lcProp = 'loHeader.' + laProps[lnCnt]

			TRY
				&lcProp = laVals[lnCnt]

			CATCH TO loErr
				IF loErr.ERRORNO = 1743
					*** Property BASECLASS is read-only.  Ignore
				ELSE
					THROW
				ENDIF
			ENDTRY
		ENDFOR
	ENDIF
ENDFOR


toColumn = .NULL.
loObj    = .NULL.
loHeader = .NULL.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform