Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array of non-default properties
Message
 
 
To
24/10/2001 11:39:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00572626
Message ID:
00572695
Views:
35
>>
>>I guess, I don't have an alternative here. Too bad, we haven't upgraded yet.
>
>Nadya,
>You main problem wouldn't be to find modified properties but rather traversing the form objects. Just a reminder.
>Cetin

Cetin,

I wrote this program (just finished it and finally made it work). The complicated part was to properly use macro... I tried with name expression before, and it didn't work, so I had to use macros (wich I hate, personally). Here it is (simple builder)
********************************************************************
*  Description.......: FormBuilder
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Cetin Basoz
*  Modified by.......: Nadya Nosonovsky 10/23/2001 01:11:58 PM
********************************************************************
=aselobj(aForm,1) && aForm would be private array visible in CreateClonedCopy function
=aselobj(aObjects)
set step on
for each oObj in aObjects
     do case
     case lower(oObj.class) = 'label'
          =CreateClonedCopy(oObj,'wgLabel')

     case lower(oObj.class) = 'text'
          =CreateClonedCopy(oObj,'wgtextbox')

     case lower(oObj.class) = 'checkbox'
          =CreateClonedCopy(oObj,'wgtextbox')
     endcase

*oObj.classlibrary = '..\commonwg\classes\wgcontrols.vcx'
next
*!* ==================================
function CreateClonedCopy
lparameter oObj, tcClass
local lnProps, lnK, lnI, lcName
local array laProps[1]
local array laChangedProps[1]
lnProps = amembers(laProps,oObj)
lnK=0
for lnI=1 to m.lnProps
     if pemstatus(oObj,laProps[m.lnI],0) && Non-default property
          lnK = m.lnK + 1
          dimension laChangedProps[m.lnK,2]
          laChangedProps[m.lnK,1]=laProps[m.lnI]
          laChangedProps[m.lnK,2]=getpem(oObj,laProps[m.lnI])
     endif
next
lcName = oObj.name
aForm[1].removeobject((m.lcName))
aForm[1].newobject((m.lcName),m.tcClass,"\redp\appl\commonwg\classes\wgcontrols.vcx")
with aForm[1].&lcName
     for lnK = 1 to alen(laChangedProps,1)
          .&laChangedProps[m.lnK,1]=laChangedProps[m.lnK,2] && to (aForm[1] + "." + m.lcName + "."+laChangedProps[m.lnK,1])
     next
endwith
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