Guillermo,
Según la respuesta de René, debo aclarar una cosa,con el permiso del
MAESTRO, claro está...
Siempre puedes poner tantos Formularios "dentro" de un PRG como quieras,
pero sin diseño desde el IDE, creo, al menos yo lo hago.
Ahora bien, la pregunta es si es lo mas práctico o fácilmente "legible" a
nivel de código.
Yo te recomiendo que cada PRG sea un Formulario, por pequeño que sea.
Pero si necesitas incluir un Formulario dentro de un PRG de un formulario,
puedes hacerlo llamando a una función, por ej. y creando el Formulario a
"pelo" esto es una parte de código que estoy utilizando...
METHOD Browse1KeyDown( oSender, nKey, nFlags ) CLASS TFrmVenciments
local oForm, oLbl, oEdit, oBtn, oRBtn, oCbox, aItems, n, nRebuts, oCheck,
cEdit
Local lSiAlta := nKey == VK_INSERT
Local lModifica := .F.
local nAssent, cCtaBanc, nImportOrdre
If nKey == VK_DELETE .and. ::oBrowse1:KeyCount() > 0
WITH OBJECT oForm := TForm():New()
:SetBounds( 0, 0, 255, 190 )
:cText := ::aIdioma[19,AppData:nIdioma]
:nBorderStyle := bsDIALOG
:lParentIcon := .F.
:lCentered := .T.
:lAutoScroll := .F.
:Create()
END WITH
oBtn := TButton():Create( oForm )
oBtn:cText := ::aIdioma[20,AppData:nIdioma]
oBtn:OnClick := {|| (oForm:Hide(),lModifica:=.T.,oForm:Close()) }
oLbl := { TLabel():Create( oForm ),;
TLabel():Create( oForm ),;
TLabel():Create( oForm ),;
TLabel():Create( oForm ) }
oLbl[1]:cText := ::aIdioma[21,AppData:nIdioma]
oLbl[1]:SetBounds( 10, 25 )
cEdit := AllTrim( If( ::oDbfDataSet1:T = "P", AppData:cPago,
AppData:cCobro ) )
cEdit += If( Empty( cEdit ), "", " " ) + ::oDbfDataSet1:COMENTARI
oEdit := { TMaskEdit():Create( oForm ),;
TMaskEdit():Create( oForm ),;
TMaskEdit():Create( oForm ) }
oEdit[1]:Value := cEdit
oEdit[1]:SetBounds( oLbl[1]:nLeft + oLbl[1]:nWidth +5,
oLbl[1]:nTop -4, 175 )
oLbl[2]:cText := ::aIdioma[22,AppData:nIdioma]
oLbl[2]:SetBounds( oLbl[1]:nLeft, oLbl[1]:nTop + oLbl[1]:nHeight +
10 )
oEdit[2]:lAutoSelect := asSELECTNONE
oEdit[2]:Value := ::oDbfDataSet1:DATAVEN
oEdit[2]:SetBounds( oLbl[2]:nLeft + oLbl[2]:nWidth +5,
oLbl[2]:nTop -4, 65 )
oLbl[3]:cText := ::aIdioma[23,AppData:nIdioma]
oLbl[3]:SetBounds( oLbl[1]:nLeft, oLbl[2]:nTop + oLbl[2]:nHeight +
10 )
oLbl[4]:cText := ::aIdioma[24,AppData:nIdioma]
oEdit[3]:Value := ::oDbfDataSet1:IMPORT
oEdit[3]:cPicture := "@E 999999999.99"
oEdit[3]:nAlignment := taRIGHT
oEdit[3]:SetBounds( oEdit[1]:nLeft + oEdit[1]:nWidth -65,
oLbl[2]:nTop -4, 65 )
oLbl[4]:SetBounds( oEdit[3]:nLeft - oLbl[4]:nWidth - 5, oLbl[2]:nTop )
oCbox := TComboBox():Create( oForm )
oCbox:SetBounds( oLbl[3]:nLeft + oLbl[3]:nWidth + 5, oLbl[3]:nTop -5,
55 )
oCheck := TCheckBox():Create( oForm )
oCheck:SetBounds( oLbl[1]:nLeft, oLbl[3]:nTop + 25,
oForm:nClientWidth - oLbl[1]:nLeft )
oCheck:cText := ::aIdioma[25,AppData:nIdioma]
oCheck:lChecked := If( !Empty(::oDbfDataSet1:COMPTE) .and.
!Empty(::oDbfDataSet1:BANC), .T., .F. )
oCheck:lEnabled := oCheck:lChecked
oCheck:OnChange := {|| oEdit[1]:lEnabled := oEdit[2]:lEnabled :=
oEdit[3]:lEnabled := oCbox:lEnabled := oCheck:lChecked }
aItems := { "" }
oCbox:lEnabled := oCheck:lEnabled
oEdit[1]:lEnabled := oCheck:lEnabled
oEdit[2]:lEnabled := oCheck:lEnabled
oEdit[3]:lEnabled := oCheck:lEnabled
If oCbox:lEnabled
If xDbfAssentaments( .T., AppData:cRuta, AppData:cCodiEmpresa, .T.,
"ASSENTAMENTS" )
ASSENTAMENTS->( DbSetOrder(2) )
ASSENTAMENTS->( DbSeek( ::oDbfDataSet1:COMPTE ) )
While ASSENTAMENTS->DEBE == ::oDbfDataSet1:COMPTE .and.
ASSENTAMENTS->( !Eof() )
If( !Empty( ASSENTAMENTS->IVA ) .and. Empty(
ASSENTAMENTS->MOV3 ) .and. ASSENTAMENTS->ORDRE <> 0,;
Aadd( aItems, AllTrim( Str( ASSENTAMENTS->ORDRE,
5 ) ) ), )
ASSENTAMENTS->( DbSkip() )
EndDo
ASSENTAMENTS->( DbSetOrder(3) )
ASSENTAMENTS->( DbSeek( ::oDbfDataSet1:COMPTE ) )
While ASSENTAMENTS->HABER == ::oDbfDataSet1:COMPTE .and.
ASSENTAMENTS->( !Eof() )
If( !Empty( ASSENTAMENTS->IVA ) .and. Empty(
ASSENTAMENTS->MOV3 ) .and. ASSENTAMENTS->ORDRE <> 0,;
Aadd( aItems, AllTrim( Str( ASSENTAMENTS->ORDRE,
5 ) ) ), )
ASSENTAMENTS->( DbSkip() )
EndDo
ASSENTAMENTS->( DbCloseArea() )
EndIf
Asort( aItems,,, {|x,y| Val(x) < Val(y) } )
oCbox:aItems := aItems
EndIf
oForm:OnShow := {|| oBtn:SetBounds( oForm:nClientWidth -
oBtn:nWidth -10, oForm:nClientHeight - oBtn:nHeight -10 ) }
oForm:ShowModal()
If lModifica
If ::oDbfDataSet1:T = "C"
::nC -= ((::oDbfDataSet1:Alias)->IMPORT)
::oLblC:cText := TransForm( ::nC, "@E 999,999,999.99" )
Else
::nP -= ((::oDbfDataSet1:Alias)->IMPORT)
::oLblP:cText := TransForm( ::nP, "@E 999,999,999.99" )
EndIf
::oBrowse1:Delete()
EndIf
oForm:Destroy()
::oBrowse1:SetFocus()
Return 0
....
Un Saludo,
Xevi.
"Guillermo Guevara C." <
soporte@pv2000.com.mx> escribió en el mensaje de
noticias news:47330f63$[email=
1@ozsrv2.ozlan.local...]
1@ozsrv2.ozlan.local...[/email]
> Estoy desarrollando una aplicación muy grande, y requiero tener varios
> formularios CLASS ... FROM integrados en un mismo PRG, no me dió ningún
> problema al integrarlos en un PRG junto con sus respectivos:
> METHOD...CLASS generados de cada evento de sus controles y componentes, se
> hace referencia también de los INCLUDES XFM al final de cada ENDCLASS, al
> compilarlos todo funciona correctamente.
>
> El problema es que Xailer ya no me permite el acceso a la edición de esos
> formularios, no me permite verlos ni con el F12 (Cambiar módulo /
> formulario), hay algún método ó forma de poder verlos y accesarlos.
>
> Ing. Guillermo Guevara C.
> Grupo Computación 2000
> Nuevo Mundo Nº 2821
> Jardines de la Cruz
> Guadalajara, Jal. 44950
> (33) 1078-8363 / 1078-8364
>
www.pv2000.com.mx
>
soporte@pv2000.com.mx
>
>