FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug report on listbox
Posts: 76
Joined: Wed Oct 12, 2005 05:52 PM
Bug report on listbox
Posted: Tue May 16, 2006 03:21 PM

I cannot run this example in fwh:

include "FiveWin.ch"

//----------------------------------------------------------------------------//
function Main()

local oDlg, oBrw
local aData := { { "1", "Cliente", "=", "123456" },;
{ "2", "Direccion", "$", "Spain" },;
{ "3", "Telefono", "<>", "889977665" } }

DEFINE DIALOG oDlg FROM 0, 0 TO 30, 100

@ 1, 1 LISTBOX oBrw FIELDS aData[ oBrw:nAt ][ 1 ],;
aData[ oBrw:nAt ][ 2 ],;
aData[ oBrw:nAt ][ 3 ],;
aData[ oBrw:nAt ][ 4 ] OF oDlg ;
SIZE 150, 100

oBrw:SetArray( aData )

@ 9 , 9 BUTTON "&End" OF oDlg ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED

any help?
Piscicelli/Zingoni

Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
Bug report on listbox
Posted: Wed May 17, 2006 08:00 PM

you forget this :

headers "header1',"header2","header3","header4" ;

Regards

Hoe, email: easywin3@yahoo.com
Posts: 76
Joined: Wed Oct 12, 2005 05:52 PM
Bug report on listbox
Posted: Wed May 17, 2006 09:18 PM

Many tanks!

Posts: 283
Joined: Sat Oct 15, 2005 06:40 AM
Bug report on listbox
Posted: Fri May 19, 2006 08:12 AM
For Antonio:
This problem is for the incorrect initialization of ::aHeaders into WBrowse Class!
I suggest this:

at line 1184:
   if Len( ::aHeaders ) < nElements
      if ::Cargo == nil
         ::aHeaders = Array( nElements )
         IF Upper( ::cAlias ) != "ARRAY"       
            for n = 1 to nElements
               ::aHeaders[ n ] = ( cAlias )->( FieldName( n ) )
            next
         ELSE
            ::aHeaders := AFill( ::aHeaders, "" )
         ENDIF
      else
         ::aHeaders = { "" }
      endif
   endif


and at line 1824:
   if ! Empty( ::cAlias ) .and. Upper( ::cAlias ) != "ARRAY"  // aggiunto da Ugo il 22/03/04

      ::bGoTop     = If( uVal1 != nil, { || ( ::cAlias )->( DbSeek( uVal1, .t. ) ) },;
                                    { || ( ::cAlias )->( DbGoTop() ) } )

      ::bGoBottom  = If( uVal2 != nil, { || ( ::cAlias )->( BrwGoBottom( uVal2 ) ) },;
                                    { || ( ::cAlias )->( DbGoBottom() ) } )

      ::bSkip      = If( uVal1 != nil, BuildSkip( ::cAlias, cField, uVal1, uVal2 ),;
                      { | n | ( ::cAlias )->( _DbSkipper( n ) ) } )

      ::bLogicLen  = If( uVal1 != nil,;
                      { || ( ::cAlias )->( Self:RecCount( uVal1 ) ) },;
                      { || ( ::cAlias )->( RecCount() ) } )

      ::nLen       = Eval( ::bLogicLen, Self )

      ::lHitTop    = .f.
      ::lHitBottom = .f.

      if uVal1 != nil
         Eval( ::bGoTop, Self )
      endif
   else
      ::bLogiclen = { || 0 }
   endif
Ciao, best regards,

Ugo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug report on listbox
Posted: Fri May 19, 2006 11:03 AM
Ugo,

This way we have a number for each column:
   if Len( ::aHeaders ) < nElements
      if ::Cargo == nil
         ::aHeaders = Array( nElements )
         for n = 1 to nElements
             if ! Empty( cAlias ) .and. Upper( cAlias ) != "ARRAY"
                ::aHeaders[ n ] = ( cAlias )->( FieldName( n ) )
             else
                ::aHeaders[ n ] = AllTrim( Str( n ) )
             endif   
         next
      else
         ::aHeaders = { "" }
      endif
   endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 283
Joined: Sat Oct 15, 2005 06:40 AM
Bug report on listbox
Posted: Fri May 19, 2006 11:13 AM

Good solution! :-)
Can you insert in next release?

Ciao, best regards,

Ugo

Continue the discussion