Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visual Class Builder
Message
From
09/09/1999 12:37:07
Rex Mahel
Realm Software, Llc
Ohio, United States
 
 
To
09/09/1999 11:56:25
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00248040
Message ID:
00262973
Views:
24
Eric,

Try this:

*-*
*-* MakeClass.Prg
*-*

LOCAL ;
lcBaseName,;
lcBaseClass,;
lcBaseClassLibrary,;
lcNewClass,;
lcNewClassLibrary

*******************************************
*-* ComboBox
*******************************************
WAIT WINDOW "Creating class cboRexClLookUp" NOWAIT
loObject = SUBCLASS("RexLookUp","RexCL","cboRexCLLookUp","RexCl")

WITH loObject
.RowSource = "v_RexClLookUp.cName,iId"
ENDWITH

ACTIVATE WINDOW "Class Designer"
KEYBOARD "{Ctrl+W}"


set classlib to RexCl additive

*******************************************
*-* Container
*******************************************
WAIT WINDOW "Creating class cntRexClLookUp" NOWAIT
loObject = SUBCLASS("RexContainer","RexCL","cntRexCLLookUp","RexCl")

WITH loObject
.AddObject("ComboBox","cboRexCLLookUp")
ENDWITH

ACTIVATE WINDOW "Class Designer"
KEYBOARD "{Ctrl+W}"


FUNCTION SUBCLASS
LPARAMETER tcBaseClass,tcBaseClassLibrary,tcNewClass,tcNewClassLibrary
LOCAL ;
laObject[1],;
lnObjectCount

tcNewClassLibrary = IIF(EMPTY(tcNewClassLibrary),tcBaseClassLibrary,tcNewClassLibrary)

CREATE CLASS ;
(tcNewClass) ;
OF ;
(tcNewClassLibrary) ;
AS ;
(tcBaseClass) ;
FROM ;
(tcBaseClassLibrary) ;
NOWAIT

loObject = .NULL.
FOR EACH loForm IN _SCREEN.FORMS
IF UPPER(loForm.CAPTION) # UPPER(tcNewClass)
LOOP
ENDIF
loObject = loForm.CONTROLS[1]
EXIT
ENDFOR
RETURN loObject


**************************************************
*-- Class Library: c:\meremortals\v4.20\apps\impact\rexcl.vcx
**************************************************


**************************************************
*-- Class: rexcontainer (c:\meremortals\v4.20\apps\impact\rexcl.vcx)
*-- ParentClass: container
*-- BaseClass: container
*-- Time Stamp: 09/09/99 12:35:11 PM
*
DEFINE CLASS rexcontainer AS container


Width = 200
Height = 200
Name = "rexcontainer"


ENDDEFINE
*
*-- EndDefine: rexcontainer
**************************************************


**************************************************
*-- Class: rexlookup (c:\meremortals\v4.20\apps\impact\rexcl.vcx)
*-- ParentClass: combobox
*-- BaseClass: combobox
*-- Time Stamp: 09/09/99 12:33:04 PM
*
DEFINE CLASS rexlookup AS combobox


Height = 24
Width = 100
Name = "rexlookup"


ENDDEFINE
*
*-- EndDefine: rexlookup
**************************************************



In my run, I get a Class cboRexCLLookUp is in use by a MODIFY CLASS.

Any ideas?

Rex


>>1. Is the only way to create a composite class stored in a VCX file through the CREATE CLASS command?
>
>That's the only way to do it programmatically, as far as I know. I guess you could try building the vcx yourself, but I wouldn't want to.
>
>>2. Using the CREATE CLASS command, I will need to close the window programmatically. I have tried an ACTIVATE WINDOW "Class Designer" and a KEYBOARD "{Ctrl-W}" with no success. How can I close the designer window?
>
>This works for me-
>
>ACTIVATE WINDOW "Class designer"
>KEYBOARD '{CTRL+W}'
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform