Crear clases mediante programacion
Publicado por sergio (737 intervenciones) el 20/10/2006 20:38:28
tengo el siguiente codigo y no se donde van el procedimiento procedure boton.click para que puedan ser ejecutadas, si las pango dentro de la clase me dice miembro desconocido, si las pongo fuera de la clase no las lee, alguien podria decirme como programar el click del objeto boton
procedure boton.click
export to c:\sergio\planilla type xls
thisform.release
endproc
CLEAR ALL
CLEAR
PUBLIC oForm
oForm=CREATEOBJECT("MyForm",ADDBS(GETDIR("c:\sergio")),"*.*",.f.)
DEFINE CLASS MyForm as Form
AllowOutput=.f. && so '?' output goes to screen
Width=_screen.Width
Height=_screen.Height-50
Width=800
Height=600
PROCEDURE init
lparameters cPath , cMask , fSubDir
SET EXCLUSIVE OFF
SET SAFETY OFF
SET TALK off
SET EXACT OFF
CREATE table Files (path c(240),fname c(240),fsize n(10,0),timestamp t)
this.DoDir(cPath,cMask)
INDEX on timestamp DESCENDING TAG t && choose your desired order
this.AddObject("grilla","grid")
this.addobject("boton","commandbutton")
this.grilla.Visible=1
this.grilla.top = 30
this.grilla.Width = thisform.width
this.grilla.Height=thisform.height
this.grilla.Column3.InputMask="999,999,999"
this.Show
this.boton.visible = .t.
this.boton.top = 0
this.boton.left = 0
PROCEDURE DoDir
lparameters cPath, cMask
LOCAL n,i,listado[1]
nCantidad=ADIR(listado,cPath+cMask,"",1)
FOR i = 1 TO nCantidad
INSERT INTO files (Path,fname,fsize,timestamp) VALUES (cPath, listado[i,1], listado[i,2],CTOT(DTOC(listado[i,3])+listado[i,4]))
ENDFOR
ENDDEFINE
procedure boton.click
export to c:\sergio\planilla type xls
thisform.release
endproc
CLEAR ALL
CLEAR
PUBLIC oForm
oForm=CREATEOBJECT("MyForm",ADDBS(GETDIR("c:\sergio")),"*.*",.f.)
DEFINE CLASS MyForm as Form
AllowOutput=.f. && so '?' output goes to screen
Width=_screen.Width
Height=_screen.Height-50
Width=800
Height=600
PROCEDURE init
lparameters cPath , cMask , fSubDir
SET EXCLUSIVE OFF
SET SAFETY OFF
SET TALK off
SET EXACT OFF
CREATE table Files (path c(240),fname c(240),fsize n(10,0),timestamp t)
this.DoDir(cPath,cMask)
INDEX on timestamp DESCENDING TAG t && choose your desired order
this.AddObject("grilla","grid")
this.addobject("boton","commandbutton")
this.grilla.Visible=1
this.grilla.top = 30
this.grilla.Width = thisform.width
this.grilla.Height=thisform.height
this.grilla.Column3.InputMask="999,999,999"
this.Show
this.boton.visible = .t.
this.boton.top = 0
this.boton.left = 0
PROCEDURE DoDir
lparameters cPath, cMask
LOCAL n,i,listado[1]
nCantidad=ADIR(listado,cPath+cMask,"",1)
FOR i = 1 TO nCantidad
INSERT INTO files (Path,fname,fsize,timestamp) VALUES (cPath, listado[i,1], listado[i,2],CTOT(DTOC(listado[i,3])+listado[i,4]))
ENDFOR
ENDDEFINE
Valora esta pregunta


0