then I create the xbrowse for only the first 5 field
@ 120, 05 XBROWSE oBrowse OF oDlg ;
COLUMNS 1, 2, 3, 4,5 ;
HEADERS "ico","Descrizione servizio","Q.tà","Prezzo","Totale" ;
COLSIZES 50, 120, 50, 90,90 ;
ARRAY aData LINES FASTEDIT CELL ;
SIZE 100,70 PIXEL
on the first column i wish to show the image and I made
WITH OBJECT oBrowse:aCols[ 1]
:bFooter := { || Ltrim( Str( oBrowse:KeyNo() ) ) + " / " + LTrim( Str( oBrowse:KeyCount() ) )+" servizi" }
:lBmpStretch := .F.
:lBmpTransparent := .T.
:bStrImage := {|oCol, oBrw| aData[ oBrowse:nAt,1 ] }
END
but it not show the image
if click on hscroll it make an error
- Code: Select all Expand view RUN
- Application
===========
Path and name: C:\Work\Errori\servizi_singoli\test.Exe (32 bits)
Size: 3,770,368 bytes
Compiler version: Harbour 3.2.0dev (r1703231115)
FiveWin version: FWH 17.12
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 19 secs
Error occurred at: 07/05/18, 12:20:59
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... } length: 3
[ 2] = N 5
Stack Calls
===========
Called from: test.prg => (b)TEST( 88 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTCELL( 12673 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA( 12377 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DRAWLINE( 2557 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESHCURRENT( 2502 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:GORIGHT( 3551 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HSCROLL( 3318 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 10297 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 436 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 23 )
Called from: test.prg => (b)TEST( 88 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTCELL( 12673 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA( 12377 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 2028 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 1752 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1697 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 10297 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 436 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 23 )
Called from: test.prg => (b)TEST( 88 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTCELL( 12673 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA( 12377 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DRAWLINE( 2557 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESHCURRENT( 2502 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:GORIGHT( 3551 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HSCROLL( 3318 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 10297 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: test.prg => TEST( 164 )
then I wish have the get on bottom because I wish have SubTotal, Descuent, and Total
the final user can insert the Descuent and the total must be refresh
I made a function to calculate the subtotal and the total but it past allway nsconto=0 and if the final user insert a value it past allway zero
Function CalcoloTotali(oBrowse)
Local n
nTotale:= 0
nSubtotale:= 0
For n=1 to Len(oBrowse:aArrayData)
nSubtotale+= oBrowse:aArrayData[n][5]
next
nTotale:=nSubTotale-nSconto
//Msginfo(nSconto)
// Msginfo(nSubTotale)
// Msginfo(ntotale)
aGet[3]:refresh()
aGet[5]:refresh()
oBrowse:Refresh()
oBrowse:GoBottom()
return nil