Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array of non-default properties
Message
 
 
To
24/10/2001 15:01:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00572626
Message ID:
00572849
Views:
25
>Nadya, I've looked at all of the responses here and it looks like you got some pretty good ones. When you finish this, would you mind sharing it?
>Tracy

Tracy,

I wrote a really simple program, which, however, suits my current needs. I just don't have time right now to make it more efficient. Here it is: (in order to work properly you need to select objects, you need to re-convert; substitute wg with your classes):
********************************************************************
*  Description.......: FormBuilder
*  Calling Samples...:
*  Parameter List....:
*  Ideas by..........: Cetin Basoz & Dragan Nedeljkovich
*  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) && All selected objects
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,'wgcheckbox')
     endcase
next
return
*!* ==================================
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