- Code: Select all Expand view
#include "fivewin.ch"
#include "xbrowse.ch"
function main()
local aData := {}
local oWnd, oBrw, oBar
define dialog oWnd size 600, 300
@ 12,15 xbrowse oBrw of oWnd ;
header 'one','two','tipo', "cuatro" ;
columns 1, 2, 3, 4 ;
colsizes 50,70,50,70 ;
pictures '999','mmm dd, yyyy', "9999.99" ;
SIZE 300, 300 PIXEL ;
array aData lines cell fastedit footers
WITH OBJECT oBrw
:bClrStd := { || If( oBrw:KeyNo() % 2 == 0, ;
{ CLR_BLACK, RGB( 224, 236, 255 ) }, ;
{ CLR_BLACK, RGB( 189, 211, 253 ) } ) }
END
AEval( oBrw:aCols, { |o| o:nEditType := EDIT_GET } )
WITH OBJECT oBrw:tipo
:nEditType := EDIT_LISTBOX
:aEditListBound := ;
:aEditListTxt := { "NOV", "NTO", "TOR", "VAC", "VAQ", "TM ", "TH " }
END
WITH OBJECT oBrw:cuatro
:nTotal := 0
:lTotal := .t.
END
WITH OBJECT oBrw
:bClrStd := { || If( oBrw:KeyNo() % 2 == 0, ;
{ CLR_BLACK, RGB( 224, 236, 255 ) }, ;
{ CLR_BLACK, RGB( 189, 211, 253 ) } ) }
:MakeTotals()
END
oBrw:CreateFromCode()
AAdd( oBrw:aArrayData, { 1, date()+1, "NOV", 0 } )
AAdd( oBrw:aArrayData, { 2, date()+2, "NOV", 0 } )
AAdd( oBrw:aArrayData, { 3, date()+3, "NOV", 0 } )
AAdd( oBrw:aArrayData, { 4, date()+4, "NOV", 0 } )
activate dialog oWnd on init ( oWnd:Resize() )
return nil
If you change LISTBOX "Tipo" have this error :
Application
===========
Path and name: C:\FWMY\x_list1.exe (32 bits)
Size: 1,986,560 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 09/27/11, 16:27:16
Error description: Error BASE/1004 Class: 'NIL' has no exported method: NLASTKEY
Args:
[ 1] = U
Stack Calls
===========
Called from: => NLASTKEY(0)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:POSTEDIT(10883)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN:SHOWBTNLIST(10792)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LOSTFOCUS(2935)
Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL:TCONTROL(188)
Called from: => TCONTROL:LOSTFOCUS(0)
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:LOSTFOCUS(305)
Called from: .\source\classes\CONTROL.PRG => TLISTBOX:KILLFOCUS(1071)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1683)
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:HANDLEEVENT(576)
Called from: .\source\classes\WINDOW.PRG => _FWH(3443)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(277)
Called from: x_list1.prg => MAIN(56)
Regards MAurizio