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}'
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement