Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reset to default property for a class in all file
Message
De
23/08/2000 14:43:01
 
 
À
22/08/2000 13:44:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00407867
Message ID:
00408400
Vues:
38
>How to reset to default property for a class in all forms & clases a given project

How about something like this for the forms. The first group of code here brings every form up in the form designer, calls a PRG and saves it.
lnForms = adir(aforms, 'forms\*.scx')
for lnX = 1 to lnFOrms
	modi form (aForms[lnX]) nowait
	aSelObj(aA, 1)
	loopthroughcontrols(aA[1])
	activate window 'form'
	keyboard '{ctrl + w}'
endfor
Now, this is where the ResetToDefault() it done, it loops throuhgh every control looking for "MyClass" and then Resets the "Caption" property.
*LoopThroughControls.PRG
lparameters loObject
local loControl, lcBaseClasses
lcBaseClasses = 'FORM GRID COLUMN CONTAINER CONTROL COMMANDGROUP OPTIONGROUP PAGE PAGEFRAME'

do case
	case type('loObject.ControlCount') = 'N'
		for each loControl in loObject.Controls
			if upper(loControl.Class) = 'MYCLASS'
				loControl.ResetToDefault('Caption')
			endif
			if upper(loControl.BaseClass) $ lcBaseClasses
				LoopTHroughControls(loControl)
			endif
		endfor

	case type('loObject.ButtonCount') = 'N'
		for each loControl in loObject.Buttons
			if upper(loControl.Class) = 'MYCLASS'
				loControl.ResetToDefault('Caption')
			endif
			if upper(loControl.BaseClass) $ lcBaseClasses
				LoopTHroughControls(loControl)
			endif
		endfor

	case type('loObject.PageCount') = 'N'
		for each loControl in loObject.Pages
			if upper(loControl.Class) = 'MYCLASS'
				loControl.ResetToDefault('Caption')
			endif
			if upper(loControl.BaseClass) $ lcBaseClasses
				LoopTHroughControls(loControl)
			endif
		endfor

	case type('loObject.ColumnCount') = 'N'
		for each loControl in loObject.Columns
			if upper(loControl.Class) = 'MYCLASS'
				loControl.ResetToDefault('Caption') = 'C'
			endif
			upper(if loControl.BaseClass) $ lcBaseClasses
				LoopTHroughControls(loControl)
			endif
		endfor
endcase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform