Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can one form create another, H2

Status
Not open for further replies.

justamistere

Programmer
Jul 25, 2002
67
US
I want to create a form to collect programmers' parameters.
Then with these parameters I want to create a .scx form,
adding code to PEM's (Properties, Events, and Methods).

Visually: I can't add custom code to Events and Methods.

Programatically: I have added everything, but can't save it as a .scx form

In the Vfp-Command Window I execute the following two lines.
Do _MyFormTest
MyFormTest.SaveAs("FormTest_01")

I get the following error message.
"One of the members of this Form or FormSet is based on a
nonvisual class. Cannot write .SCX file."

************************************************************
* Name: _FormTest.prg
* Author:
* Description: Shortened code... (No Custom PEM-code)
************************************************************
PUBLIC MyFormTest
MyFormTest = CREATEOBJECT("MyFormTest")
RETURN

DEFINE CLASS MyFormTest AS FORM
DoCreate = .T.
AutoCenter = .T.
Caption = "MyFormTest"
Height = 235
Left = 2
Name = "MyFormTest"
Top = 0
Width = 491
WindowType = 1

ADD OBJECT cmdCancel AS COMMANDBUTTON WITH ;
Caption = &quot;\<Close&quot;, ;
Enabled = .T., ;
Height = 22, ;
Left = 410, ;
Name = &quot;cmdCancel&quot;, ;
TabIndex = 4, ;
Top = 5, ;
Visible = .T., ;
Width = 62

ADD OBJECT txtCustomer AS TEXTBOX WITH ;
Height = 22, ;
InputMask = &quot;XXXXXXXXXXXXXXXXXXXXXXXXX&quot;, ;
Left = 261, ;
MaxLength = 25, ;
Name = &quot;txtCustomer&quot;, ;
ReadOnly = .T., ;
SpecialEffect = 1, ;
TabIndex = 2, ;
Tag = &quot;01&quot;, ;
Top = 53, ;
Visible = .T., ;
Width = 184

PROCEDURE cmdCancel.CLICK
Thisform.Release()
ENDPROC

ENDDEFINE
 
I think you are a little confused or at least you got me about what are you confused trying to accomplish. First why you said Visually: I can't add custom code to Events and Methods.
Of course you can; just double click on the from and in the code window select whatever method or event you want and write whatever you want this method or event to do for you.

Second, if you decided to define the class your self in code, why then you want to save it as SCX file?


Walid Magd
Engwam@Hotmail.com
 
Let me clarify what I want. Any help is appreciated.
1) I want to create a form to collect programmers' parameters. Then with these parameters

2) I want to create a .scx form,
adding code to PEM's (Properties, Events, and Methods).

In the second sentence by the &quot;I&quot;, I meant that the programmer clicks on the &quot;Generate&quot; button and *Programatically* (through, method code) this form creates another .scx form or .scx table for a form.

This form is to be like a Vfp-&quot;Builder&quot; or a &quot;Wizard&quot; style form. It functions like the Vfp App-Builder. The App-Builder adds classes.

I would also like to have the form add my code to the newly created form's Event/Methods based on selections by the programmer.
 
I would think someone out there has tried something of this nature, I may try the Fox-pros at universalthread.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top