XBROWSE bug and question

XBROWSE bug and question

Postby byte-one » Fri Apr 19, 2013 12:07 pm

In the past this code was correct:
Code: Select all  Expand view  RUN
REDEFINE COLUMN XBROWSE oList OF oDlg ID 102 MESSAGE "Auswahlliste" ;
 ON CHANGE msginfo("Change")
oList:Setarray(aArray)


In 13.3 only this code is correct (with clausula ARRAY). If i use the above code, the ON CHANGE are NOT transformed in bChange and not executed!? If i use obrw:bChange := {||....} it is ok.
Code: Select all  Expand view  RUN
REDEFINE COLUMN XBROWSE oList OF oDlg ID 102 MESSAGE "Auswahlliste"  ARRAY aArray;
 ON CHANGE msginfo("Change")
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: XBROWSE bug and question

Postby Antonio Linares » Fri Apr 19, 2013 4:52 pm

Günther,

I just compiled fine this example (it crashes on runtime, obviously) with 13.03

Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oList, oDlg

   REDEFINE COLUMN XBROWSE oList OF oDlg ID 102 MESSAGE "Auswahlliste" ;
      ON CHANGE msginfo("Change")

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XBROWSE bug and question

Postby byte-one » Fri Apr 19, 2013 5:48 pm

Antonio, please add this:
Code: Select all  Expand view  RUN
local aArray := {"A","b"}
...
...
oList:Setarray(aArray)


It seems to be a preprocessor-problem. If i use the source from 12.4 and the xbrowse-header from 13.03 the same bug is present.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: XBROWSE bug and question

Postby Antonio Linares » Fri Apr 19, 2013 5:59 pm

Günther,

This keeps compiling fine:

Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oList, oDlg
   local aArray := {"A","b"}

   REDEFINE COLUMN XBROWSE oList OF oDlg ID 102 MESSAGE "Auswahlliste" ;
      ON CHANGE msginfo("Change")
   oList:SetArray( aArray )  

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XBROWSE bug and question

Postby byte-one » Fri Apr 19, 2013 6:14 pm

Antonio, compiling is OK without Errors in both cases!
All XBROWSES with the definition from the array in clausula ARRAY are functioning. XBROWSES there are with oBrw:setarray(aArray) assigning the array, the ON CHANGE clausula not transfered to oBrw:bChange(). Valtype() from oBrw:bChange() is in this case "U"
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: XBROWSE bug and question

Postby nageswaragunupudi » Sat Apr 20, 2013 12:50 am

Mr Günther

You are right. bChange is assigned now only when DATASOURCE is specified as a part of the command.

We shall correct this in the next version.

For now, you may please add the line:
oBrw:bChange := bChange
after the line
Code: Select all  Expand view  RUN
  XbrwSetDataSource( oBrw, cDataSrc, lAddCols, lAutoSort, ;
      If( aCols == nil, nil, aCols[ 1 ] ), aRows, aHeaders, bChange  )
 

in the function XBrowseNew(....) in xbrowse.prg.

Anyway we recommend specifying the datasource in the command itself.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests