Xbrowse and EDIT_LISTBOX solved

Xbrowse and EDIT_LISTBOX solved

Postby Maurizio » Tue Oct 29, 2019 5:00 pm

Hello Rao ,
is it possible to see the description ( item 0 ) when I have a value = zero?

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oWnd, aLin := {{0,"",0}}, i, oBrw, oBtn
   local aTabla:= { {  0, "item  0",  0.00 },;
                          {  1, "item  1",  1.00 },;
                          {  2, "item  2",  2.00 },;
                          {  3, "item  3",  3.00 } }

   DEFINE WINDOW oWnd

   @ 10,10 XBROWSE oBrw OF oWnd DATASOURCE aLin ;
      COLUMNS 1, 1, 3 ;
      HEADERS 'Cod', 'Description', 'Price' ;
      CELL LINES NOBORDER FASTEDIT

   WITH OBJECT oBrw
      WITH OBJECT :Description
         :nEditType     := EDIT_LISTBOX
         :aEditListTxt  := aTabla
         :bOnChange     := { || oBrw:aRow[ 3 ] := aTabla[ oBrw:aRow[ 1 ], 3 ], ;
                                oBrw:aRow[ 2 ] := aTabla[ oBrw:aRow[ 1 ], 2 ] }
      END
      :bPastEof   := <||
         if oBrw:nLen == 0 .or. !Empty( ATail( oBrw:aArrayData )[ 1 ] )
            AAdd( oBrw:aArrayData, { 0, "", 0 } )
            oBrw:GoDown()
            oBrw:Refresh()
         endif
         return nil
         >
      :CreateFromCode()
   END

   oWnd:oClient   := oBrw

   ACTIVATE WINDOW oWnd CENTERED

RETURN NIL


Maurizio
Last edited by Maurizio on Thu Oct 31, 2019 9:40 am, edited 1 time in total.
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Xbrowse and EDIT_LISTBOX

Postby nageswaragunupudi » Wed Oct 30, 2019 5:15 pm

Can you please modify xbrowse.prg as below and try?

Please locate "static function XbrLbxLookUp( uVal, aBound, aText, lBlank )" in the xbrowse.prg.
Inside this function locate this line:
Code: Select all  Expand view
  if ! Empty( uVal )
 


Please change it as:
Code: Select all  Expand view
  if .T.  //! Empty( uVal )
 


Can you check if you can now see "item.0" ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and EDIT_LISTBOX solved

Postby Maurizio » Thu Oct 31, 2019 9:39 am

now works :D
Thanks RAO
www.nipeservice.it
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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