Bug report on listbox

Bug report on listbox

Postby Piscicelli Zingoni » Tue May 16, 2006 3: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
Piscicelli Zingoni
 
Posts: 76
Joined: Wed Oct 12, 2005 5:52 pm
Location: Milan,Italy

Postby tnhoe » Wed May 17, 2006 8:00 pm

you forget this :

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

Hoe, email: easywin3@yahoo.com
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia

Postby Piscicelli Zingoni » Wed May 17, 2006 9:18 pm

Many tanks!
Piscicelli Zingoni
 
Posts: 76
Joined: Wed Oct 12, 2005 5:52 pm
Location: Milan,Italy

Postby Ugo » Fri May 19, 2006 8:12 am

For Antonio:
This problem is for the incorrect initialization of ::aHeaders into WBrowse Class!
I suggest this:

at line 1184:
Code: Select all  Expand view
   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:
Code: Select all  Expand view
   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
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Postby Antonio Linares » Fri May 19, 2006 11:03 am

Ugo,

This way we have a number for each column:
Code: Select all  Expand view
   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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ugo » Fri May 19, 2006 11:13 am

Good solution! :-)
Can you insert in next release?
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 79 guests