FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to use TDolphin with TWbrowse()
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
How to use TDolphin with TWbrowse()
Posted: Fri Jul 03, 2015 10:41 AM

Dear All,

I cannot find the sample that use TDolphin with TWBrowse() in the forum.

Thanks in advance for any help.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: How to use TDolphin with TWbrowse()
Posted: Fri Jul 03, 2015 04:22 PM

HI,
I use TWBrowse with TDolphin, no problems.
Regards
Willi

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to use TDolphin with TWbrowse()
Posted: Fri Jul 03, 2015 09:25 PM
Dear Wille,

I try with this below code but it doesn't show any record. I use TWBrowse() of Hernan.
Code (fw): Select all Collapse
REDEFINE LISTBOX oBrw FIELDS oRep:REP_NR, oRep:REP_NAME ;
                          HEADERS 'No', 'Name' ;
                          FIELDSIZES 40,250 ;
                          UPDATE ;
                          ID 101

or
Code (fw): Select all Collapse
REDEFINE LISTBOX oBrw FIELDS oRep:FieldGet("REP_NR"), oRep:FieldGet("REP_NAME") ;
                          HEADERS 'No', 'Name' ;
                          FIELDSIZES 40,250 ;
                          UPDATE ;
                          ID 101

Willi Quintana wrote:HI,
I use TWBrowse with TDolphin, no problems.
Regards
Willi
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use TDolphin with TWbrowse()
Posted: Sat Jul 04, 2015 10:25 AM

Dutch,

Daniel commented that he had examples with TDolphin and TSBrowse:

viewtopic.php?p=101739#p101739

Surely he can help us on this :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: How to use TDolphin with TWbrowse()
Posted: Sat Jul 04, 2015 12:02 PM
Hello

you need config the browse




Code (fw): Select all Collapse
...

   @ 1, 1 LISTBOX oBrw FIELDS oQry:first, oQry:last HEADER "Name", "LastName" OF oWnd  SIZE 400, 400

   SetDolphin( oQry, oBrw )

...


PROCEDURE SetDolphin(oQry, oBrw)

   WITH OBJECT oBrw
      :bGoTop    := {|| If( oQry:LastRec() > 0, oQry:GoTop(), NIL ) }
      :bGoBottom := {|| If( oQry:LastRec() > 0, oQry:GoBottom(), nil )  }
      :bSkip     := {| n | oQry:Skip( n ) }
      :bLogicLen := {|| oQry:LastRec() }
   END

RETURN
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: How to use TDolphin with TWbrowse()
Posted: Sun Jul 05, 2015 04:37 AM
HI,,
I'm use this code:

Code (fw): Select all Collapse
REDEFINE LISTBOX oLbx FIELDS  oQry:first, oQry:last HEADER "Name", "LastName" OF oDlg                             
MySetBrowse( oLbx, oQry )
..
...
....



Function MySetBrowse( oBrw, oDataSource )

    local lRet := .t.
    local bGoTop, bGoBottom, bSkipper
    local cClsName

    if ValType( oBrw ) != "O" .or. ValType( oDataSource ) != "O"
        lRet := .f.
    else
        bGoTop := { || oDataSource:GoTop() }
        bGoBottom := { || oDataSource:GoBottom() }
        bSkipper := { | n | oDataSource:Skip( n ) }

        cClsName := upper( oBrw:ClassName() )

        if cClsName == "TBROWSE" // El nativo de Harbour y xHarbour
            oBrw:goTopBlock := bGoTop
            oBrw:goBottomBlock := bGoBottom
            oBrw:SkipBlock := bSkipper
        elseif cClsName $ "TWBROWSE TCBROWSE TSBROWSE TGRID TXBROWSE" // Para windows
            oBrw:cAlias := ""
            oBrw:bGoTop := bGoTop
            oBrw:bGoBottom := bGoBottom
            oBrw:bSkip := bSkipper
            if cClsName == "TXBROWSE"
                oBrw:bBof := { || oDataSource:Bof() }
                oBrw:bEof := { || oDataSource:Eof() }
                oBrw:bBookMark :={ | n | if( n == nil, oDataSource:RecNo(), ;
                                                       oDataSource:GoTo( n ) ) }
                oBrw:bKeyNo :=  { || oDataSource:RecNo() }
                oBrw:bKeyCount := { || oDataSource:RecCount() }
            else
                oBrw:bLogicLen := { || oDataSource:RecCount() }
            endif
            if oBrw:oVScroll() != nil
                oBrw:oVscroll():SetRange( 1, oDataSource:RecCount() )
            endif
            oBrw:Refresh()
        else
            oDataSource:oError:Say( "Browse no implementado en SetBrowse", .f. )
        endif
    endif

return( lRet )
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to use TDolphin with TWbrowse()
Posted: Sun Jul 05, 2015 06:29 AM

Dear Daniel,

Thanks, it works well.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion