Buena tarde... Mr. Rao
Es posible que la clase TXBrowse, de soporte a la librería HDO de Manuel Expósito, tal como lo hace con EAGLE1.
Gracias
JONSSON RUSSI T.
Colombia
#include "fivewin.ch"
#include "hdo.ch"
REQUEST HDO
REQUEST RDLMARIADBN
function main()
local oHDO, oTb
local oBrw, aCol := array( 2 )
oHDO := THDO():new( "mariadbn" )
oHDO:setAttribute( HDO_ATTR_ERRMODE, .f. )
oHDO:setAttribute( HDO_ATTR_CASE, CASE_UPPER )
oHDO:setAttribute( HDO_ATTR_STR_PAD, .t. )
oHDO:setAttribute( HDO_ATTR_TINY_AS_BOOL, .t. )
oHDO:setAttribute( HDO_ATTR_NULL_TO_VAL, .t. )
if oHDO:connect( "fivewin_demo", "localhost", "root", "myPassword", 3306 ) == .f.
msgStop( oHDO:errorStr(), oHDO:errorCode() + "/" + alltrim( str( oHDO:errorNo() ) ) )
oHDO:free()
oHDO := nil
return nil
endif
if hb_isObject( oHDO )
oTb := oHDO:rowSet( "SELECT * FROM clients" )
oTb:load()
define window oWnd title "FWH + HDO"
oBrw:=TxBrowse():New(oWnd)
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:lColDividerComplete := (.F.)
oBrw:nHeaderHeight := 25
oBrw:nRowHeight := 22
oBrw:nDataLines := 1
oBrw:lHScroll := (.F.)
aCol[1] := oBrw:AddCol()
aCol[1]:bStrData := { || oTb:getValueByName("first") }
aCol[1]:cHeader := "first"
aCol[1]:nHeadStrAlign := AL_LEFT
aCol[1]:nDataStrAlign := AL_LEFT
aCol[1]:nWidth := 100
aCol[2] := oBrw:AddCol()
aCol[2]:bStrData := { || oTb:getValueByName("last") }
aCol[2]:cHeader := "last"
aCol[2]:nHeadStrAlign := AL_LEFT
aCol[2]:nDataStrAlign := AL_LEFT
aCol[2]:nWidth := 210
oBrw:CreateFromCode()
setHDO( oBrw, oTb )
oWnd:oClient = oBrw
activate window oWnd
oHDO:free()
endif
oHDO:=nil
return nil
procedure setHDO( oBrw, oTb )
oBrw:cAlias := ""
oBrw:bGoTop := {|| If( oTb:RecCount() > 0, oTb:First(), nil ) }
oBrw:bGoBottom := {|| If( oTb:RecCount() > 0, oTb:Last(), nil ) }
oBrw:bSkip := {| n | oTb:Skipper( If( n==nil, 1, n ) ) }
oBrw:bBof := {|| oTb:Bof() }
oBrw:bEof := {|| oTb:Eof() }
oBrw:bBookMark := {| n | If( n == nil,;
If( oTb:RecCount() > 0, oTb:Recno(), 0 ), ;
If( oTb:RecCount() > 0, oTb:GoTo( n ), 0 ) ) }
oBrw:bKeyNo := {| | RecNo() }
oBrw:bKeyCount := {|| oTb:RecCount() }
oBrw:refresh()
return nil
Antonio Linares wrote:Querido Lailton, muchas gracias!
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 45 guests