#include "fivewin.ch"
function Main()
local oDlg, oBrw, oFont, aStates
USE STATES
aStates := FW_DbfToArray( "CODE,NAME" )
CLOSE STATES
USE CUSTOMER
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 700,500 PIXEL TRUEPIXEL FONT oFont
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" ;
COLUMNS "ID", "FIRST", "LAST", "STREET", "CITY", "STATE", "ZIP", "AGE", "MARRIED", "SALARY" ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:Married:SetCheck()
WITH OBJECT :State
:nEditType := EDIT_LISTBOX
:aEditListTxt := aStates
END
:aCols[ 2 ]:SetColsAsRows( { 2, 3 } )
:aCols[ 4 ]:SetColsAsRows( { 4, 5, 6, 7 } )
:aCols[ 8 ]:SetColsAsRows( { 8, 9, 10 } )
/*
// With new xbrowse, you do not need this anymore
:aCols[ 2 ]:bLDClickData := { || oBrw:EditBrowse( .f., "FIRST,LAST", .f. ) }
:aCols[ 2 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "FIRST,LAST", .f. ), 0 ), nil ) }
:aCols[ 4 ]:bLDClickData := { || oBrw:EditBrowse( .f., "STREET,CITY,STATE,ZIP", .f. ) }
:aCols[ 4 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "STREET,CITY,STATE,ZIP", .f. ), 0 ), nil ) }
:aCols[ 8 ]:bLDClickData := { || oBrw:EditBrowse( .f., "AGE,MARRIED,SALARY", .f. ) }
:aCols[ 8 ]:bKeyChar := { |k| If( k == 13, ( oBrw:EditBrowse( .f., "AGE,MARRIED,SALARY", .f. ), 0 ), nil ) }
*/
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil