xbrowse and arrays

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

xbrowse and arrays

Post by Colin Haig »

Hi All

I am trying to use one browse to display different arrays - which have different headers ,column sizes etc

here is how I am setting up the browse

Code: Select all

 oLbx := TXBrowse():New(oDlg)
       oLbx:nMarqueeStyle := MARQSTYLE_HIGHLCELL
       oLbx:nColDividerStyle := LINESTYLE_BLACK
       oLbx:nRowDividerStyle := LINESTYLE_BLACK
       oLbx:lColDividerComplete := TRUE
       oLbx:lFastEdit := TRUE
       oLbx:nDatalines := 1
       oLbx:nRowHeight  := 24
       oLbx:SetArray(aData)
       oLbx:lHScroll := FALSE
       oLbx:nStretchCol := STRETCHCOL_LAST
       oLbx:bClrStd  := { || {CBRWTEXT,CBRWBACK} }
       oLbx:bClrSel:=   { || {CBRWTEXT,CBRWBACK} }
       oLbx:lFooter := TRUE

       for i := 1 to len(aTitle)
          for j := 1 to len(aTitle[i])
             oLbx:aCols[j]:cHeader      := aTitle[i,j]
             oLbx:aCols[j]:nWidth       := aSizes[i,j]
             oLbx:aCols[j]:cEditPicture := aPicture[i,j]
          next
       next

       oLbx:CreateFromResource(Brw)

// This function tries resetting the browse

static function lfSetArrays(nSelect,aTitle,aSizes,aPicture,oLbx)
local i := 0,j := 0
asize(aTitle,0)
asize(aSizes,0)
asize(aPicture,0)
asize(oLbx:aCols,0)
if nSelect == 1 .or. nSelect == 2 .or. nSelect == 3
   aadd(aTitle,{'Job No.','Job Date','Description','Comp. Date','Contact','Order No.'})
   aadd(aSizes,{  55     ,   70     ,    500      ,   70       ,  110    ,  100      })
   aadd(aPicture,{'@!'   ,'99/99/9999','@','99/99/9999','@','@!'})
   //aadd(aData,{" ",dtoc(date())," ",dtoc(date())," "," "})
endif
if nSelect == 4
   asize(oLbx:aCols,7)
   aadd(aTitle,{'Invoice','Date','Sub Total','GST','Total','Paid','Balance'})
   aadd(aSizes,{  70     ,   70 ,    100    , 100 ,  100  ,  100 , 100  })
   aadd(aPicture,{'@!'   ,'99/99/9999','9999999.99','9999999.99','9999999.99','9999999.99','9999999.99'})
endif
for i := 1 to len(aTitle)
   for j := 1 to len(aTitle[i])
      oLbx:aCols[j]:cHeader      := aTitle[i,j]
      oLbx:aCols[j]:nWidth       := aSizes[i,j]
      oLbx:aCols[j]:cEditPicture := aPicture[i,j]
   next
next
return(nil)

 
There is an error on this
oLbx:aCols[j]:cHeader := aTitle[i,j]

Error BASE/1005 Class: 'NIL' has no property: CHEADER

Can anyone tell me how to achieve mutliple array's being displayed using the one browse.

Thanks

Colin
ricardommarques
Posts: 21
Joined: Fri Jul 04, 2008 10:01 pm

Re: xbrowse and arrays

Post by ricardommarques »

Code: Select all

oLbx := TXBrowse():New(oDlg)
       oLbx:nMarqueeStyle := MARQSTYLE_HIGHLCELL
       oLbx:nColDividerStyle := LINESTYLE_BLACK
       oLbx:nRowDividerStyle := LINESTYLE_BLACK
       oLbx:lColDividerComplete := TRUE
       oLbx:lFastEdit := TRUE
       oLbx:nDatalines := 1
       oLbx:nRowHeight  := 24
       oLbx:SetArray(aData)
       oLbx:lHScroll := FALSE
       oLbx:nStretchCol := STRETCHCOL_LAST
       oLbx:bClrStd  := { || {CBRWTEXT,CBRWBACK} }
       oLbx:bClrSel:=   { || {CBRWTEXT,CBRWBACK} }
       oLbx:lFooter := TRUE

       for i := 1 to len(aTitle)
          for j := 1 to len(aTitle[i])
             oCol := oLbx:AddCol( oLbx, aTitle[i,j], aSizes[i,j], aPicture[i,j] )             
          next
       next

       oLbx:CreateFromResource(Brw)
       
//--------------------------------------------------
Function ADDCol( oLbx, cTitle, nSize, cPict )
 Local oCol
 
 oCol := oLbx:AddCol()
 oCol:cHeader        := cTitle
 oCol:nWidth          := nSize
 oCol:cEditPicture  := cPict
 
Return NIL
//-------------------------------------------------
 
Ricardo.
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: xbrowse and arrays

Post by Silvio »

ricardo
I need your vrmm last release
on seven I not see the buttonbar
please help me please
have you old versions
Best Regards, Saludos

Falconi Silvio
ricardommarques
Posts: 21
Joined: Fri Jul 04, 2008 10:01 pm

Re: xbrowse and arrays

Post by ricardommarques »

I need your vrmm last release
Get here:
http://www.megaupload.com/?d=9F3IGGKS

or here:
http://www.megaupload.com/?d=O3A5TZHV

Image
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: xbrowse and arrays

Post by Silvio »

ricardo
I cannot see the buttonbar on windows seven
look it please

Image
Best Regards, Saludos

Falconi Silvio
ricardommarques
Posts: 21
Joined: Fri Jul 04, 2008 10:01 pm

Re: xbrowse and arrays

Post by ricardommarques »

look it please
replace your "vrmm.exe" on this
http://www.megaupload.com/?d=UDB2PO8H

this vrmm you can resize.


Image
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xbrowse and arrays

Post by anserkk »

In you function lfSetArrays, before setting the cHeaders, did you try to assign the new array to browse.

I mean

Code: Select all

oBrw:aArrayData:=aNewArray

// After setting the new array you can use the column properties as usual

For i:=1 to Len(oBrw:aCols)

   oBrw:aCols[I]:cHeader:=<your column title from your array>

Next
Anser
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: xbrowse and arrays

Post by Silvio »

ricardo
thanks
but there is another error
look the picture please
Image

I think you must use setgrid(1,1)


And this error in for each control

I tried with say,get,button,image,listbox,check,radio,folder, group,browse,datepicker,.....
Best Regards, Saludos

Falconi Silvio
ricardommarques
Posts: 21
Joined: Fri Jul 04, 2008 10:01 pm

Re: xbrowse and arrays

Post by ricardommarques »

but there is another error
VRMM for Windows Seven / Vista

Get here:
http://www.megaupload.com/?d=63YS4EJM


Image
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: xbrowse and arrays

Post by Silvio »

ricardo ,
it seem run ok now
gimme the word on english

I want translate it in italian language
why NOT use i18n function ?

with mine Tlanguage class we can translate the hil file easy

you can create the hil file when you compile the app with -j parameters

sample /jSILVIO.HIT
and (x) harbour save all i18n("xxxxxxx") on silvio.hit
Best Regards, Saludos

Falconi Silvio
Post Reply