Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5 - How to apply the same prop/methods to a given cla
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00881782
Message ID:
00882332
Views:
32
This message has been marked as the solution to the initial question of the thread.
Bhavbhuti,

>>create class appxsplash of appclasslib as splash from frameworkclasslib nowait
>
>I just got lost here. My class is SplashForm in aApp.vcx. What will be the above line in context?

The code I posted was pseudocode as far as classlib names and objects are concerned. The create class could be used to initially create your class:

create class SplashForm of aApp.vcx as TheSplashFormBaseClass from TheFrameworkClassLib nowait

If you've already got the class created you can

modify class SplashForm of aApp.vcx nowait

>There is another SplashImage in aApp.vcx but this one is only for the image part of it so no complications.

So then the builder code would be:

.SplashImage.Picture = getpict() && or some other code that would set your desired image

>> .AddObject( "lblx1", "SomeLabelClass" )
>> with .lblX1
>> .Top = 200
>> .Left = 50
>> endwith
>
>Will this permanently add a label to the form like as-if I had dragged dropped it onto the form?

Exactly. The aselobj() gives you a reference to the object in the designer and calling it's AddObject() method becomes the exact same as you dragging and dropping a class onto the form/class and then editting the .Name property.

So I have to paste the above modified code into a prg and run it with a DO?

yes. If you had that chunk of code in a file named buildsplash.prg, you can call it from the command window. You might want to add code in the builder to have it make sure that it hasn't been run already. This can be done be checking to see if the lblx1 already exists.

>I have experience with building visual builders for textboxes as provided in CB (one I guess originally created by Ken or YAG), but your example seems to be of a runtime kind and I have no experience with it.

Nope, what I posted was meant as a designtime builder. Although the same code could be used at runtime. Builders like these run at designtime are more setup so that you can take some of the drudge work away and continue the work on the form in the designer.
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