xBrowse + Tree sample does not work.

xBrowse + Tree sample does not work.

Postby Horizon » Fri Jul 21, 2023 1:31 pm

Hi Mr. Rao,


I can't run the example you sent in the previous topics in the forum. I compiled this example using buildh32.bat in the example directory. . When I press the "Tree" button, the application exits without any errors. (fwh 23.04 + Harbour + msvc )

Can you please help?

Thanks.
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   RDDSETDEFAULT( "DBFCDX" )

   TestTree2()

return nil

function TestTree2()

   local oDlg, oFont, oBrw
   local aData, aTotal
   local aCols := { "1 AS State", "2 AS City", "3 AS Street", "4 AS Age", "5 AS Salary" }

   USE CUSTOMER NEW
   aData    := FW_DbfToArray( "STATE,TRIM(CITY),TRIM(STREET),AGE,SALARY" )
   CLOSE CUSTOMER
   aData    := FW_ArrGroupSum( aData, 1, , { 4, 5 } )
   ASORT( aData, , , { |x,y| If( x[ 1 ] == y[ 1 ], x[ 2 ] < y[ 2 ], x[ 1 ] < y[ 1 ] ) } )
   aTotal   := aData[ 1 ]
   ADel( aData, 1, .t. )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 800,400 PIXEL TRUEPIXEL FONT oFont

   @ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE aData COLUMNS aCols ;
      CELL LINES NOBORDER FOOTERS

   oBrw:cFooters := aTotal
   oBrw:CreateFromCode()

   @ 10, 20 BTNBMP PROMPT "TREE" SIZE 150,30 PIXEL OF oDlg FLAT ;
      WHEN oBrw:nDataType == DATATYPE_ARRAY ;
      ACTION ( oBrw:SetTree( nil, { 0x30082, 0x30084, 0x20097 } ) )

   @ 10,200 BTNBMP PROMPT "ARRAY" SIZE 150,30 PIXEL OF oDlg FLAT ;
      WHEN oBrw:nDataType != DATATYPE_ARRAY ;
      ACTION ( oBrw:SetArray( aData, nil, nil, aCols ), oBrw:cFooters := aTotal )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


changed : "Tree" instead of "Array".
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1289
Joined: Fri May 23, 2008 1:33 pm

Re: xBrowse + Tree sample does not work.

Postby Horizon » Sat Jul 22, 2023 5:41 pm

Hi,

Can anyone compile the above code and run it without errors?

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1289
Joined: Fri May 23, 2008 1:33 pm

Re: xBrowse + Tree sample does not work.

Postby nageswaragunupudi » Mon Jul 24, 2023 2:17 pm

The above program is a part of fwh\samples\xbrtree.prg
This was working till FWH2102 but failing in later versions,
We are looking into this.
Please give us a little more time.
Regards

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

Re: xBrowse + Tree sample does not work.

Postby Horizon » Tue Jul 25, 2023 8:18 pm

nageswaragunupudi wrote:The above program is a part of fwh\samples\xbrtree.prg
This was working till FWH2102 but failing in later versions,
We are looking into this.
Please give us a little more time.


Ok. thank you.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1289
Joined: Fri May 23, 2008 1:33 pm

Re: xBrowse + Tree sample does not work.

Postby nageswaragunupudi » Thu Jul 27, 2023 5:56 am

This is fixed in FWH2307, soon to be released.

We can also make it work with the following fix to METHOD SetTree(...) in XBrowse.prg

1) Please locate this line in METHOD SetTree(...) and delete or comment out this line:
Code: Select all  Expand view
  ::bOnSkip   := bOnSkip
 

2) Replace all occurrences of "::bOnSkip" with "bOnSkip" in the METHOD SetTree(...) Note: Only in this method

Then build and run
fwh\samples\xbrtree.prg
Regards

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

Re: xBrowse + Tree sample does not work.

Postby Silvio.Falconi » Fri Jul 28, 2023 3:46 pm

not only should xbrowse do it automatically but the settree() should set the field (of the array or db) to do the grouping,
maybe selecting it from a combobox "normal", "tree"


and also make the search work

with GET oGet VAR cSeek and COMBOBOX oBrw:oSortCbx

example in customer.dbf
field : state, city
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: xBrowse + Tree sample does not work.

Postby Silvio.Falconi » Sun Jul 30, 2023 6:33 pm

The new fwh 23.07 release resolved the first problem but I not understood how male the search Run as xbrowse search ( with get and combobox)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests