Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cloneobject() in a subclass of a combobox
Message
From
06/11/1998 12:37:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/11/1998 03:47:10
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00154829
Message ID:
00155283
Views:
26
>Thanks Cetain,
>I llike your idea, but It is different of what I thought because it is a lot of work.
>I don't only want to do that for combobox. I would like to do it for textbox, editbox, check, etc...
>My idea was duplicate all properties. At desingtime, the developer only has to set the properties of one object, and at runtime, when the container is started up, we get the two objects (exactly the same but controlsource property). In the refres method of the container is choosed wich one is visible.
>You probably think "Why don't make only one object and change the controlsource property in the refres of the container?"
>I have done it, but it does not work perfect (only in combobox).In case that the first controlsource is a field of a table, and that table has set a filter which select 0 records, and the combobox enabled property si set to .F.. If you change the controlsource property to a variable and the combobox enabled property to .T., you still get like the combobox enabled property was .F. because you can't change the value. Rare but real like the live.
>Thanks
Jose,
If at designtime developer only plays one object's properties and want it to be cloned why not also do it there ? Since you're in designtime you can use cloneobject after setting properties. I sometimes use it when I'll have ie: many checkboxes and don't want to make a class.
*sample clone.prg
lparameters tnCopies
aselobj(aObj)         && Refs to control(s) selected in form
aselobj(aObjContainer,1)  && Refs to control's container
for ix=1 to tnCopies
    aObj[1].cloneobject(aObj[1].name+padl(ix,2,"0"))
    with eval("aObjContainer[1]."+aObj[1].name+padl(ix,2,"0"))
         .top = aObj[1].top + (aObj[1].height + 2) * ix
         .left = aObj[1].left
    endwith
endfor
aObjContainer[1].refresh
Also I'm not sure what you need is a builder or making that control another class.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform