Olá,
Preciso criar um novo browse em uma dialog com as mesmas propriedades de um outro browse que está em outra dialog. Tem como fazer isto ?
Obrigado,
Rossine.
Rossine wrote:Olá,
Preciso criar um novo browse em uma dialog com as mesmas propriedades de um outro browse que está em outra dialog. Tem como fazer isto ?
Obrigado,
Rossine.
oDbLbx:= oClone( oDbfClientes )
#include "fivewin.ch"
#include "xbrowse.ch"
function MAIN
local oDlg, oBrw, aStruc := { { "teste", "teste", "teste", "teste" }, ;
{ "teste", "teste", "teste", "teste" }, ;
{ "teste", "teste", "teste", "teste" }, ;
{ "teste", "teste", "teste", "teste" }, ;
{ "teste", "teste", "teste", "teste" } }
define dialog oDlg from 0, 0 to 300, 310 pixel
oBrw := TXBrowse():New( oDlg )
oBrw:SetArray( aStruc)
oBrw:nTop := 10
oBrw:nLeft := 10
oBrw:nRight := 150
oBrw:nBottom := 100
oBrw:aCols[1]:cHeader := Padr("NAME", 15)
oBrw:aCols[2]:cHeader := "TYPE"
oBrw:aCols[2]:nDataStrAlign := AL_CENTER
oBrw:aCols[2]:nHeadStrAlign := AL_CENTER
oBrw:aCols[3]:cHeader := "SIZE"
oBrw:aCols[3]:nDataStrAlign := AL_RIGHT
oBrw:aCols[3]:nHeadStrAlign := AL_RIGHT
oBrw:aCols[4]:cHeader := "LENGTH"
oBrw:aCols[4]:nDataStrAlign := AL_RIGHT
oBrw:aCols[4]:nHeadStrAlign := AL_RIGHT
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:lRecordSelector := .f.
oBrw:CreateFromCode()
oDlg:oClient := oBrw
@120, 60 button oBtn prompt "Proximo" of oDlg action DLG2( oBrw ) pixel
activate dialog oDlg on init oBrw:SetFocus() centered
RETURN NIL
static function DLG2( oBrw )
local oDlg1, oBrw1
define dialog oDlg1 from 200, 200 to 500, 510 pixel
oBrw1 := oClone( oBrw )
oBrw1:delcol(2)
oBrw1:nTop := 0
oBrw1:nLeft := 0
oBrw1:nRight := 10
oBrw1:nBottom := 50
oBrw1:oWnd := oDlg1
activate dialog oDlg1 on init oBrw1:SetFocus()
RETURN NIL
define dialog oDlg1 from 200, 200 to 500, 510 pixel
oBrw1:CreateFromCode()
activate dialog oDlg1 on init InitBrowse( oBrw1, oBrw
...
Static Function InitBrowse( oBrw1, oBrw )
oBrw1 := oClone( oBrw )
oBrw1:delcol(2)
oBrw1:nTop := 0
oBrw1:nLeft := 0
oBrw1:nRight := 10
oBrw1:nBottom := 50
Return Nil
#INCLUDE "FIVEWIN.CH"
#INCLUDE "XBROWSE.CH"
FUNCTION MAIN
LOCAL ODLG, OBRW, ASTRUC := { { "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" } }
DEFINE DIALOG ODLG FROM 0, 0 TO 300, 310 PIXEL
OBRW := TXBROWSE():NEW( ODLG )
OBRW:SETARRAY( ASTRUC)
OBRW:NTOP := 10
OBRW:NLEFT := 10
OBRW:NRIGHT := 150
OBRW:NBOTTOM := 100
OBRW:ACOLS[1]:CHEADER := PADR("NAME", 15)
OBRW:ACOLS[2]:CHEADER := "TYPE"
OBRW:ACOLS[2]:NDATASTRALIGN := AL_CENTER
OBRW:ACOLS[2]:NHEADSTRALIGN := AL_CENTER
OBRW:ACOLS[3]:CHEADER := "SIZE"
OBRW:ACOLS[3]:NDATASTRALIGN := AL_RIGHT
OBRW:ACOLS[3]:NHEADSTRALIGN := AL_RIGHT
OBRW:ACOLS[4]:CHEADER := "LENGTH"
OBRW:ACOLS[4]:NDATASTRALIGN := AL_RIGHT
OBRW:ACOLS[4]:NHEADSTRALIGN := AL_RIGHT
OBRW:NMARQUEESTYLE := MARQSTYLE_HIGHLCELL
OBRW:LRECORDSELECTOR := .F.
OBRW:CREATEFROMCODE()
ODLG:OCLIENT := OBRW
@120, 60 BUTTON OBTN PROMPT "PROXIMO" OF ODLG ;
ACTION DLG2( OBRW, ASTRUC, ODLG ) PIXEL
ACTIVATE DIALOG ODLG CENTERED ;
ON INIT OBRW:SETFOCUS()
RETURN NIL
STATIC FUNCTION DLG2( OBRW, ASTRUC, ODLG )
LOCAL ODLG1, OBRW1
DEFINE DIALOG ODLG1 FROM 200, 200 TO 500, 510 PIXEL
OBRW1 := OCLONE( OBRW, ASTRUC, ODLG )
OBRW1 := TXBROWSE():NEW( ODLG1 )
OBRW1:SETARRAY( ASTRUC )
OBRW1:NTOP := 10
OBRW1:NLEFT := 10
OBRW1:NRIGHT := 150
OBRW1:NBOTTOM := 100
OBRW1:ACOLS[1]:CHEADER := PADR("NAME", 15)
OBRW1:ACOLS[2]:CHEADER := "TYPE"
OBRW1:ACOLS[2]:NDATASTRALIGN := AL_CENTER
OBRW1:ACOLS[2]:NHEADSTRALIGN := AL_CENTER
OBRW1:ACOLS[3]:CHEADER := "SIZE"
OBRW1:ACOLS[3]:NDATASTRALIGN := AL_RIGHT
OBRW1:ACOLS[3]:NHEADSTRALIGN := AL_RIGHT
OBRW1:ACOLS[4]:CHEADER := "LENGTH"
OBRW1:ACOLS[4]:NDATASTRALIGN := AL_RIGHT
OBRW1:ACOLS[4]:NHEADSTRALIGN := AL_RIGHT
OBRW1:NMARQUEESTYLE := MARQSTYLE_HIGHLCELL
OBRW1:LRECORDSELECTOR := .F.
OBRW1:CREATEFROMCODE()
ODLG1:OCLIENT := OBRW1
/*
OBRW1:SETARRAY( ASTRUC )
OBRW1:DELCOL(2)
OBRW1:NTOP := 0
OBRW1:NLEFT := 0
OBRW1:NRIGHT := 10
OBRW1:NBOTTOM := 50
OBRW1:OWND := ODLG1
*/
ACTIVATE DIALOG ODLG1 ON INIT OBRW1:SETFOCUS()
RETURN NIL
Acho que vc. tem que clonar en el on init del dialog
Code:
define dialog oDlg1 from 200, 200 to 500, 510 pixel
oBrw1:CreateFromCode()
activate dialog oDlg1 on init InitBrowse( oBrw1, oBrw
...
Static Function InitBrowse( oBrw1, oBrw )
oBrw1 := oClone( oBrw )
oBrw1:delcol(2)
oBrw1:nTop := 0
oBrw1:nLeft := 0
oBrw1:nRight := 10
oBrw1:nBottom := 50
Return Nil
vc va a utilizar o mesmo alias no segundo browse?
#INCLUDE "FIVEWIN.CH"
#INCLUDE "XBROWSE.CH"
FUNCTION MAIN
LOCAL ODLG, OBRW, ASTRUC := { { "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" }, ;
{ "TESTE", "TESTE", "TESTE", "TESTE" } }
DEFINE DIALOG ODLG FROM 0, 0 TO 300, 310 PIXEL
OBRW := TXBROWSE():NEW( ODLG )
OBRW:SETARRAY( ASTRUC)
OBRW:NTOP := 10
OBRW:NLEFT := 10
OBRW:NRIGHT := 150
OBRW:NBOTTOM := 100
OBRW:ACOLS[1]:CHEADER := PADR("NAME", 15)
OBRW:ACOLS[2]:CHEADER := "TYPE"
OBRW:ACOLS[2]:NDATASTRALIGN := AL_CENTER
OBRW:ACOLS[2]:NHEADSTRALIGN := AL_CENTER
OBRW:ACOLS[3]:CHEADER := "SIZE"
OBRW:ACOLS[3]:NDATASTRALIGN := AL_RIGHT
OBRW:ACOLS[3]:NHEADSTRALIGN := AL_RIGHT
OBRW:ACOLS[4]:CHEADER := "LENGTH"
OBRW:ACOLS[4]:NDATASTRALIGN := AL_RIGHT
OBRW:ACOLS[4]:NHEADSTRALIGN := AL_RIGHT
OBRW:NMARQUEESTYLE := MARQSTYLE_HIGHLCELL
OBRW:LRECORDSELECTOR := .F.
OBRW:CREATEFROMCODE()
ODLG:OCLIENT := OBRW
@120, 60 BUTTON OBTN PROMPT "PROXIMO" OF ODLG ;
ACTION DLG2( OBRW, ASTRUC, ODLG ) PIXEL
ACTIVATE DIALOG ODLG CENTERED ;
ON INIT OBRW:SETFOCUS()
RETURN NIL
STATIC FUNCTION DLG2( OBRW, ASTRUC, ODLG )
LOCAL ODLG1, OBRW1
DEFINE DIALOG ODLG1 FROM 200, 200 TO 500, 510 PIXEL
OBRW1 := TXBROWSE():NEW( ODLG1 )
OBRW1:SETARRAY( ASTRUC )
OBRW1:NTOP := 10
OBRW1:NLEFT := 10
OBRW1:NRIGHT := 150
OBRW1:NBOTTOM := 100
for n = 1 to 4
OBRW1:ACOLS[n]:CHEADER := OBRW:ACOLS[n]:CHEADER
OBRW1:ACOLS[n]:NDATASTRALIGN := OBRW:ACOLS[n]:NDATASTRALIGN
OBRW1:ACOLS[n]:NHEADSTRALIGN := OBRW:ACOLS[n]:NHEADSTRALIGN
next
OBRW1:DELCOL(2)
OBRW1:NMARQUEESTYLE := MARQSTYLE_HIGHLCELL
OBRW1:LRECORDSELECTOR := .F.
OBRW1:CREATEFROMCODE()
ODLG1:OCLIENT := OBRW1
ACTIVATE DIALOG ODLG1 ON INIT OBRW1:SETFOCUS()
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 35 guests