Hi Daniel,
Thank you for replying. This is a self-contained sample to illustrate the problem. I am using FWH9.04
#include "fivewin.ch"
#include "xbrowse.ch"
#define BLK_ARR {space(5),space(50), 0.00, 0.00}
static oWnd, oDlg, oBrw
function main()
local aFiledbf
aFiledbf := { BLK_ARR, BLK_ARR}
define window oWnd
define dialog oDlg resource "journal" of oWnd
redefine xbrowse oBrw id 101 of oDlg ;
columns 1, 2, 3, 4 ;
headers "Account", "Description", "Debit", "Credit" ;
pictures "@!",,"@Z 999,999.99", "@Z 999,999.99" ;
array aFiledbf ;
fastedit lines cell update ;
aeval(oBrw:aCols,{|o| o:lAutoSave := .t., o:nEditType := EDIT_GET})
oBrw:lHScroll := .f.
oBrw:nStretchCol := 2
oBrw:bKeyDown := {| nKey | If( nKey == VK_F2, msginfo("Invoke picklist"), ) }
oBrw:lAutoAppend := .t.
oBrw:bPastEof := {|| aadd( oBrw:aArrayData, BLK_ARR ), ;
oBrw:GoLeftMost(), oBrw:GoDown(), oBrw:aCols[ 1 ]:edit() }
oBrw:aCols[1]:bEditValid := {|oGet, oCol| ChkAccn(oGet, oCol)}
oBrw:aCols[ 1 ]:nEditType := EDIT_GET_BUTTON
oBrw:aCols[ 1 ]:addResource( "down" )
oBrw:aCols[ 1 ]:nBtnBmp := 1
with object oBrw:Debit
:lTotal := .t.
:nTotal := 0 //::nDrTotal
end
with object oBrw:Credit
:lTotal := .t.
:nTotal := 0
end
activate dialog oDlg ;
nomodal valid (oWnd:end(), .t.)
oWnd:bGotFocus() := {|| oDlg:setFocus()}
ACTIVATE WINDOW oWnd ;
ON INIT ( ;
oWnd:bResized := {|| resize()} ;
) ;
MAXIMIZED
return nil
//----------------------------------------------------------------------
function ChkAccn(oGet, oCol)
local lRet
if left(oGet:value(),2) == "CA"
lRet := .t.
else
msgalert("Invalid prefix")
lRet := .f.
endif
return lRet
//----------------------------------------------------------------------
function resize()
#define SM_CXVSCROLL 2 // Width of arrow bitmap on a vertical scroll bar.
oDlg:nWidth := oWnd:nWidth
oDlg:nHeight := oWnd:nHeight //- oWnd:nHeight
oBrw:nWidth := oDlg:nWidth - GetSysMetrics(SM_CXVSCROLL)
return nil
//----------------------------------------------------------------------
The rc
journal DIALOG 0, 0, 440, 281
STYLE DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
CAPTION ""
FONT 10, "System"
{
CONTROL "", 101, "TXBrowse", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 0, 28, 364, 202
}
down BITMAP LOADONCALL MOVEABLE DISCARDABLE
{
'42 4D 06 01 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 10 00 00 00 12 00 00 00 01 00 04 00 00 00'
'00 00 90 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
'00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF'
'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
'00 00 FF FF FF 00 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'00 00 00 08 88 88 88 88 88 88 88 88 88 88 88 88'
'88 80 88 88 88 88 88 88 88 00 08 88 88 88 88 88'
'80 00 00 88 88 88 88 88 00 00 00 08 88 88 88 88'
'88 00 08 88 88 88 88 88 88 00 08 88 88 88 88 88'
'88 00 08 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88'
'88 88 88 88 88 88'
}
I was also wondering how to get the footer to appear. I'm sure I'll have more questions as I slowly starts to get more familiar with xBrowse.
TIA