Uso de TXbrowse Con TMySql

Uso de TXbrowse Con TMySql

Postby compubrion » Fri Sep 04, 2009 4:01 pm

Hola a Todos ;

Algien que use la clase Tmysql podria indicarme si ha logrado usar la Clase TXBROWSE y de ser así indicarme como ya que a mi no me muestra los datos en el Browse, expongo aqui como lo hago, de ante mano Muhisimas Gracias desde la Republica Bolivariana de Venezuela

Cruz Alfredo Oses
FWH 9.04 xHarbour Bcc55

*--
FUNCTION CONTRATOS()
*--
LOCAL nLin, nFil, nAncho, nLargo, nPie
LOCAL oBar, oFont, oFolder, oBrow, oTabs, oCol
LOCAL oWndMain, nRegis := Space(05), cTable
LOCAL nCont := 0
*--
IF oWndConj == NIL
*--
cTable := "contratos"

oTb := oApp:oServer:Query( "SELECT * FROM " + cTable )

IF oTb:LastRec() = 0
FOR nCont = 1 To 10

oTb:FieldPut("edificio",STRZERO( nCont,5) )
oTb:FieldPut("nombre","RESIDENCIAS ", + STR(nCont,5) )
oTb:FieldPut("aptos",nCont )

oTb:Append()

IF oTb:lError
ALERT( oTb:Error() )
ENDIF

NEXT
Endif
*--
IF oTb:lError
RETURN( NIL )
ENDIF
*--
oTb:GoTop()
*--
oWndMain := WndMain()
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 BOLD
*--
DEFINE WINDOW oWndConj ;
TITLE "Contratos Y Servicios" ;
ICON oWndMain:oIcon ;
NO ZOOM BORDER NONE ;
MDICHILD OF oWndMain
*--
SET FONT OF oWndConj TO oWndMain:oFont
DEFINE BUTTONBAR oBar 3D SIZE 40,40 oF oWndConj 2007
*--
DEFINE BUTTON RESOURCE 2010 OF oBar GROUP NOBORDER TOOLTIP "Incluir Registro" ;
ACTION( CONJUNTOS(.T.), oBrow:Refresh() )
*--
DEFINE BUTTON RESOURCE 2011 OF oBar NOBORDER TOOLTIP "Modificar Registro" ;
ACTION( CONJUNTOS(.F.), oBrow:Refresh() )
*--
DEFINE BUTTON RESOURCE 2012 OF oBar NOBORDER
DEFINE BUTTON RESOURCE 2013 OF oBar NOBORDER TOOLTIP "Eliminar Registro" ;
ACTION ( SacaRegis(), oBrow:Refresh() )
*--
DEFINE BUTTON RESOURCE 2014 OF oBar GROUP NOBORDER TOOLTIP "Primer Registro";
ACTION IIF( oTb:LastRec() > 0,;
( oTb:GoTop(), oBrow:Refresh(), oBrow:SetFocus() ), nil )
*--
DEFINE BUTTON RESOURCE 2015 OF oBar NOBORDER TOOLTIP "Registro Anterior";
ACTION ( oTb:Skip(-1), oBrow:Refresh(), oBrow:SetFocus() )
*--
DEFINE BUTTON RESOURCE 2016 OF oBar NOBORDER TOOLTIP " Sigiente Registro";
ACTION ( oTb:Skip(1), oBrow:Refresh(), oBrow:SetFocus() )
*--
DEFINE BUTTON RESOURCE 2017 OF oBar NOBORDER TOOLTIP "Ultimo Registro" ;
ACTION IIF( oTb:LastRec() > 0,;
( oTb:GoBottom(), oBrow:Refresh(), oBrow:SetFocus() ), nil )
*--
DEFINE BUTTON RESOURCE 2018 OF oBar GROUP NOBORDER
DEFINE BUTTON RESOURCE 2019,2020 OF oBar GROUP ACTION( oWndConj:End() ) NOBORDER TOOLTIP "Salir"
*--
nAncho := oWndConj:nWidth - 120
nLargo := oWndConj:nHeight - 140
*--
nlin := Altura( oWndConj:nHeight, nLargo ) - 10
nFil := Altura( oWndConj:nWidth, nAncho )
*--
@ nLin,nFil FOLDER oFolder OF oWndConj ;
PROMPT "&Contratos" ;
SIZE nAncho,nLargo PIXEL ;
FONT oWndConj:oFont
*--
oBrow := TxBrowse():New( oFolder:aDialogs[1] )
*--
WITH OBJECT oBrow

:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:lColDividerComplete := .T.
:l2007 := .T.
:lFooter := .T.

:bGoTop := {|| oTb:GoTop() }
:bGoBottom := {|| oTb: GoBottom() }
:bSkip := {| n | oTb:SKIP( n ) }
:bBof := {|| oTb:Bof() }
:bEof := {|| oTb:Eof() }
:bBookMark := {| n | IF( n == nil, oTb:RecNo(), oTb:Goto(n) )}
:bKeyNo := :bBookMark
:bKeyCount := {|| oTb:LastRec() }

END
*--
oCol := oBrow:AddCol()
oCol:cHeader := " Contrato "
oCol:bStrData := {|| oTb:FieldGet("edificio") }
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_LEFT
*--
oCol := oBrow:AddCol()
oCol:bStrData := { || oTb:FieldGet("nombre") }
oCol:cHeader := " Nombre ó Razón Social "
oCol:nHeadStrAlign := AL_LEFT
oCol:nDataStrAlign := AL_LEFT
*--
oCol := oBrow:AddCol()
oCol:bStrData := { || STR(oTb:FieldGet("aptos"),5) }
oCol:cHeader := " Unidades "
oCol:nHeadStrAlign := AL_CENTER
oCol:nDataStrAlign := AL_LEFT
*--
oCol := oBrow:AddCol()
oCol:bStrData := {|| oTb:FieldGet("direccion") }
oCol:cHeader := " Dirección del Inmueble "
oCol:nHeadStrAlign := AL_LEFT
oCol:nDataStrAlign := AL_LEFT
*--
oFolder:aDialogs[1]:SetControl( oBrow )
oWndConj:bGotFocus = { || oBrow:SetFocus() }
ACTIVATE WINDOW oWndConj ;
ON INIT( oBrow:Refresh(), oBrow:SetFocus() ) ;
VALID( Cierra() )
ELSE
oWndConj:Restore()
oWndConj:Refresh()
oWndConj:SetFocus()
ENDIF
RETURN( NIL )
*--
*
Harbour / Bcc / MinGW / Fwh 13.9
User avatar
compubrion
 
Posts: 130
Joined: Thu Mar 08, 2007 6:12 pm
Location: Miranda - Venezuela

Re: Uso de TXbrowse Con TMySql

Postby compubrion » Mon Sep 07, 2009 2:23 am

Para los que le interese, con esto resolvi el problema :D

WITH OBJECT oBrow

:bGoTop := {|| oTb:GoTop() }
:bGoBottom := {|| oTb:GoBottom() }
:bSkip := {| n | oTb:Skip( IIF( n == nil,1,n)) }
:bBof := {|| oTb:Bof() }
:bEof := {|| oTb:Eof() }
:bBookMark := {| n | IIF( n == nil, ( oTb:RecNo() ),( oTb:GoTo(n) ) ) }
:bKeyNo := oBrow:bBookMark
:bKeyCount := {|| oTb:LastRec() }

:nDataType := 3 && DATATYPE_MYSQL
END
Harbour / Bcc / MinGW / Fwh 13.9
User avatar
compubrion
 
Posts: 130
Joined: Thu Mar 08, 2007 6:12 pm
Location: Miranda - Venezuela


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests