XBrowse and Array?

XBrowse and Array?

Postby Horizon » Wed Dec 16, 2009 11:14 pm

Hi,

My sample is below. I want to print "Apple","Orange","Banana","Pear" instead of 1,2,3,4 at 6. column.

Is there any solution?

Thanks,

Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"
//------------------------------------------------------------------//

function Main()

   local aData := { ;
     { 1, 'One', 45, date(), 23456, 1 }, ;
     { 2, 'Two', 2222, date()-1, 345, 2 } , ;
     { 3, 'Three', 3333, date()-2, 789, 3 }, ;
     { 4, 'Four', 4444, date()-3, 234, 4 } }
   local oDlg, oBrw
   local aType := {"Apple","Orange","Banana","Pear"}

   DEFINE DIALOG oDlg SIZE 440,240 PIXEL
   @ 10,10 XBROWSE oBrw SIZE 200,100 PIXEL OF oDlg ;
      COLUMNS 1, 2, 3, 4, 5, 6 ;
      HEADERS 'No', 'Description', 'Number', 'Date', 'Number-2', 'Type' ;
      ARRAY aData ;
      ON DBLCLICK MsgInfo( 'ok' ) ;
      MESSAGE 'my message'

   WITH OBJECT oBrw
      :lHScroll         := .F.
      :nMarqueeStyle    := MARQSTYLE_HIGHLROW
      :nColDividerStyle := LINESTYLE_RAISED
      :nRowDividerStyle := LINESTYLE_RAISED
      :nStretchCol      := STRETCHCOL_WIDEST
      :CreateFromCode()
   END
   
   if ! Empty( oCol := oBrw:oCol( "Type" ) )
//      oCol:bStrData := {|o| ?????????
   endif

   ACTIVATE DIALOG oDlg CENTERED

return ( 0 )
 
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: XBrowse and Array?

Postby nageswaragunupudi » Thu Dec 17, 2009 1:41 am

Code: Select all  Expand view

oBrw:oCol( 'Type' ):bEditValue   := { || aType[ oBrw:aRow[ 6 ] ] }
 

This should be before oBrw:CreateFromCode()
Note: FWH advises not to use bStrData and instead to use bEditValue
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests