Regards
(sorry my english)
this a little contribution
we have encountered the difficulty of not being able to use empty arrays with xbrowse
By having an empty array there is no possibility of "create" browse properly, because the indices that serve as an indicator of columns do not exist.
Start
this link is EXE, if you want to try first before making any changes ...
http://www.sitasoft.com/fivewin/test/testarra.rar
we can not build the browser with an empty array, then .... certainly there to initialize an array, but we must keep hidden that row as we want the idea is to create a data that allows us to visualize whether or not that line (s) (init array)
METHOD TO CHANGE...
Pain() (TXBrowse)
KeyDown() (TXBrowse)
KeyChar() (TXBrowse)
GoDown() (TXBrowse)
LButtonDown() (TXBrowse)
RButtonDown() (TXBrowse)
Select() (TXBrowse)
PainData() (TXBrwColumn)
FIND
ADD BEFORE
FIND INTO METHOD PAINT
ADD AFTER
FIND INTO METHOD KEYDOWN
ADD AFTER
FIND INTO METHOD KEYDOWN
ADD AFTER
FIND INTO METHOD KEYDOWN
ADD AFTER
FIND INTO METHOD KEYCHAR
ADD AFTER
FIND INTO METHOD GODOWN
INLINE ADD (END OF LINE)
FIND INTO METHOD LBUTTONDOWN
ADD AFTER
FIND INTO METHOD RBUTTONDOWN
ADD AFTER
FIND INTO METHOD SELECT
INLINE ADD (END OF LINE)
FIND INTO METHOD PAINDATA
ADD BEFORE
SAMPLE...
(sorry my english)
this a little contribution
we have encountered the difficulty of not being able to use empty arrays with xbrowse
By having an empty array there is no possibility of "create" browse properly, because the indices that serve as an indicator of columns do not exist.
Start
this link is EXE, if you want to try first before making any changes ...
http://www.sitasoft.com/fivewin/test/testarra.rar
we can not build the browser with an empty array, then .... certainly there to initialize an array, but we must keep hidden that row as we want the idea is to create a data that allows us to visualize whether or not that line (s) (init array)
METHOD TO CHANGE...
Pain() (TXBrowse)
KeyDown() (TXBrowse)
KeyChar() (TXBrowse)
GoDown() (TXBrowse)
LButtonDown() (TXBrowse)
RButtonDown() (TXBrowse)
Select() (TXBrowse)
PainData() (TXBrwColumn)
FIND
DATA lHeader,; // Browse has header, if this value is nil then is initialized automatically on the Adjust methodADD BEFORE
DATA lEmptyArray AS LOGICAL INIT .F.FIND INTO METHOD PAINT
/*
Paint cols data
*/ADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
::DispEnd( aInfo )
return 0
endifFIND INTO METHOD KEYDOWN
case nKey == VK_UPADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD KEYDOWN
case nKey == VK_LEFTADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD KEYDOWN
case nKey == VK_RIGHTADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD KEYCHAR
otherwiseADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD GODOWN
if ::nLen == 0 .or. ::Eof()INLINE ADD (END OF LINE)
.or. ( ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY )FIND INTO METHOD LBUTTONDOWN
local nOldCol := ::nColSelADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD RBUTTONDOWN
local nOldCol := ::nColSelADD AFTER
if ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY
return 0
endifFIND INTO METHOD SELECT
if ::nMarqueeStyle != MARQSTYLE_HIGHLROWMSINLINE ADD (END OF LINE)
.or. ( ::lEmptyArray .and. ::nDataType == DATATYPE_ARRAY )FIND INTO METHOD PAINDATA
if ! Empty( cData )ADD BEFORE
if ::oBrw:lEmptyArray .and. ::oBrw:nDataType == DATATYPE_ARRAY
return nil
endifSAMPLE...
#include "fivewin.ch"
#include "xbrowse.ch"
function TestMain()
local oWnd
local oBrw
local oBar
local lEmpty := .f.
local aArray := {}
DEFINE WINDOW oWnd TITLE "Testing Empty Array xBrowse"
DEFINE buttonbar oBar of oWnd
define button of oBar action ( oBrw:lEmptyArray := .f., oBrw:Refresh() )
define button of oBar action ( oBrw:lEmptyArray := .t., oBrw:Refresh() )
define button of oBar action ( oWnd:end() )
if empty( aArray )
aArray := {{" "," "," "," "}}
lEmpty := .t.
endif
@ 0,0 XBROWSE oBrw OF oWnd ;
COLUMNS {1,2,3,4} ;
HEADERS {"uno","dos","tres","cuatro"} ;
array aArray LINES CELL fastedit
oBrw:lEmptyArray := lEmpty
oBrw:bPastEof := {|| if ( oBrw:lEmptyArray, ;
oBrw:lEmptyArray:= .f., ;
( aadd( oBrw:aArrayData,{" "," "," "," "} ), oBrw:GoDown()) ),;
oBrw:Refresh() }
oBrw:bKeyDown := {| nKey | EraseRow( oBrw, nKey ) }
aeval( oBrw:aCols, { |oCols| oCols:nEditType := EDIT_GET } )
oWnd:oClient := oBrw
oBrw:createfromcode()
activate window oWnd
return nil
procedure EraseRow( oBrw, nKey )
if nKey == VK_DELETE .and. !oBrw:lEmptyArray
#ifdef __XHARBOUR__
aDel( oBrw:aArraydata, oBrw:nArrayAt,.t. )
#else
aDel( oBrw:aArraydata, oBrw:nArrayAt )
ASize( oBrw:aArraydata, len( oBrw:aArraydata ) - 1 )
#endif
if empty( oBrw:aArraydata )
oBrw:aArraydata := {{" "," "," "," "}}
oBrw:lEmptyArray := .t.
endif
endif
oBrw:refresh()
returnour best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5Njk4MDc1OQ?src=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5Njk4MDc1OQ?src=global9