Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Methods in formset's forms' controls in a .prg
Message
 
 
To
25/07/1998 16:51:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00121398
Message ID:
00121512
Views:
10
Dragan,

>Opened in class browser and took a look at the source code, copied it into a .prg and found no way to run it.

The class browser does not generate runable code, especially if there is more that one level of containership invloved.

You have to write an add-in that took each object and generated it's DEFINE CLASS (like what you did at the end) and convert the ADD OBJECT lines to use the defined class.

>It was something like this:
>
>Define Class someclass as formsetclass
>
> add object form1 as form
> add object form1.control1 as textbox
>
> procedure control1.click
> wait "you clicked, sir?" window nowait
> endproc
>enddefine
>
>It showed " procedure control1.click" as if belonged to formset, and not to formset.form1. It compiled anyway, but refused to run, stating that object reference is wrong. So I changed it to procedure form1.control1.click", but wasn't any better. Tried a couple of other things, but none worked.
>
>Does anyone know a way around this, or the thing is simply impossible. The only solution I've found so far is like this:
>
>
>Define Class someclass as formsetclass
>
> add object form1 as form
> add object form1.control1 as MYtextbox
>EndDefine
>
>Define Class mytextbox as textbox
> procedure click
> wait "you clicked, sir?" window nowait
> endproc
>enddefine
>
>...but it seems like an overkill, having to subclass every control which needs some method code.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform