Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close Class Designer window programmatically
Message
 
 
To
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:
01066062
Views:
31
>>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
>
Hi Fabio,

Good you joined that thread. Using just ACTIVATE WINDOW (WONTOP())
KEYBOARD '{CTRL+W}' PLAIN doesn't seem to work. However, then I put all code from your ClassSave method in another thread, it worked.

But when I open the class in designer to examine the change I see, that statusbar is shown as =" ". Is it possible to put blank value, but not having it as =" ", just a space?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform