oBrw:SetArray(), differences beetween TCBrwose and XBrowse
Posted: Thu Apr 03, 2008 4:06 pm
Hi,
I am testing XBrowse to evaluate a migration from the standard TcBrowse FWH class.
The first (and most important difference - and problem -) I found is this:
if I make an array browse and I need to add another element I already added it nto the array to do then a symply oBrw:SetArray(aUpdatedArray).
There are no problem to do this with TCBrowse but XBrowse delete all the header and size informations.
I'm using the November 2007 Xbrowse class,
is this changed with this lastest xBrowse's updates or is there any turn-around ?
Thanks.
This is a sample code that show the problem:
#include "FiveWin.ch"
#include "tcbrowse.ch"
static oWnd
static oBrw,aArray
//----------------------------------------------------------------------------//
function Main()
DEFINE WINDOW oWnd TITLE "Testing Keys";
MENU BuildMenu();
MDI
ACTIVATE WINDOW oWnd
return nil
Function Test()
aArray:={}
aadd(aArray,{1,"Henry"})
oBrw := TXBrowse():New( oWnd:oWndClient )
oBrw:SetArray( aArray)
oBrw:aCols[1]:cHeader := "Num"
oBrw:aCols[2]:cHeader := "Name"
oBrw:lRecordSelector := .f.
oBrw:nLastEditCol:=3
oBrw:nFreeze:=1
oBrw:CreateFromCode()
oBrw:Move(5,5,200,200)
@ 14, 4 BUTTON "&Add row" SIZE 100,80 OF OWND:oWndClient;
ACTION AddRow()
return nil
function BuildMenu()
local oMenu
local cAction
MENU oMenu
MENUITEM "TEST";
ACTION TEST()
ENDMENU
RETURN(OMENU)
Function AddRow()
aadd(aArray,{len(aArray)+1,"Henry"})
oBrw:SetArray(aArray)
oBrw:Refresh()
return
I am testing XBrowse to evaluate a migration from the standard TcBrowse FWH class.
The first (and most important difference - and problem -) I found is this:
if I make an array browse and I need to add another element I already added it nto the array to do then a symply oBrw:SetArray(aUpdatedArray).
There are no problem to do this with TCBrowse but XBrowse delete all the header and size informations.
I'm using the November 2007 Xbrowse class,
is this changed with this lastest xBrowse's updates or is there any turn-around ?
Thanks.
This is a sample code that show the problem:
#include "FiveWin.ch"
#include "tcbrowse.ch"
static oWnd
static oBrw,aArray
//----------------------------------------------------------------------------//
function Main()
DEFINE WINDOW oWnd TITLE "Testing Keys";
MENU BuildMenu();
MDI
ACTIVATE WINDOW oWnd
return nil
Function Test()
aArray:={}
aadd(aArray,{1,"Henry"})
oBrw := TXBrowse():New( oWnd:oWndClient )
oBrw:SetArray( aArray)
oBrw:aCols[1]:cHeader := "Num"
oBrw:aCols[2]:cHeader := "Name"
oBrw:lRecordSelector := .f.
oBrw:nLastEditCol:=3
oBrw:nFreeze:=1
oBrw:CreateFromCode()
oBrw:Move(5,5,200,200)
@ 14, 4 BUTTON "&Add row" SIZE 100,80 OF OWND:oWndClient;
ACTION AddRow()
return nil
function BuildMenu()
local oMenu
local cAction
MENU oMenu
MENUITEM "TEST";
ACTION TEST()
ENDMENU
RETURN(OMENU)
Function AddRow()
aadd(aArray,{len(aArray)+1,"Henry"})
oBrw:SetArray(aArray)
oBrw:Refresh()
return