Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close Class Designer window programmatically
Message
From
07/11/2005 12:25:53
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01066052
Message ID:
01066060
Views:
25
>Hi everybody,
>
>I'm writing a very simple program to update one of the property in all class library programmatically. Once I activate the class designer window, I can not close it. Here is my code, how can I fix it? Or may be this could be written more elegantly?
>
>
>*  Program...........: UPDATEPROPERTY.PRG
>*  Author............: Nadya Nosonovsky
>*  Project...........: Visual Collections
>*  Created...........: 11/07/2005  11:43:24
>*  Copyright.........: (c) Jzanus, 2005
>*) Description.......:
>*  Calling Samples...:
>*  Parameter List....:
>*  Major change list.:
>
>LPARAMETERS tcLibrary, tcProperty, tuValue
>
>IF EMPTY(tcLibrary)
>   tcLibrary = GETFILE('vcx')
>ENDIF
>
>IF EMPTY(tcProperty)
>   tcProperty = "StatusBarText"
>ENDIF
>
>IF EMPTY(tuValue)
>	tuValue = [" "]
>ENDIF
>
>LOCAL laClasses[1], arrObj[1]
>LOCAL lnClasses, lnI, loObject
>
>lnClasses =AVCXCLASSES(laClasses, m.tcLibrary)	
>
>FOR lnI =1 TO lnClasses
>   MODIFY CLASS (laClasses[m.lnI,1]) OF (m.tcLibrary) nowait
>   =ASELOBJ(arrObj,1)
>   loObject = arrObj[1]
>
>	IF VARTYPE(m.loObject) = "O"
>		IF PEMSTATUS(m.loObject,m.tcProperty,5)		
>		   m.loObject.WriteExpression(m.tcProperty, m.tuValue)
>*		   STORE m.tuValue TO (m.loObject + "." + m.tcProperty)
>		endif
>	ENDIF
>	ACTIVATE WINDOW "Class Designer"
>	KEYBOARD '{CTRL+W}'
> NEXT
>
>Thanks in advance.
FOR lnI =1 TO AVCXCLASSES(laClasses, m.tcLibrary)	
   MODIFY CLASS (laClasses[m.lnI,1]) OF (m.tcLibrary) NOWAIT
   IF ASELOBJ(arrObj,1)>0 AND PEMSTATUS(arrObj[1],m.tcProperty,5)
		arrObj[1].WriteExpression(m.tcProperty, m.tuValue)	&& attention this set a expression, not a value
*		arrObj[1].AddProperty(m.tcProperty, m.tuValue)          && this set a Properies compatible value
	ENDIF
	ACTIVATE WINDOW (WONTOP())
	KEYBOARD '{CTRL+W}' PLAIN
 NEXT
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform