FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse + Tree sample does not work.
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
xBrowse + Tree sample does not work.
Posted: Fri Jul 21, 2023 01: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 (fw): Select all Collapse
#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.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: xBrowse + Tree sample does not work.
Posted: Sat Jul 22, 2023 05:41 PM

Hi,

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

Thanks.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse + Tree sample does not work.
Posted: Mon Jul 24, 2023 02: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
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: xBrowse + Tree sample does not work.
Posted: Tue Jul 25, 2023 08: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.06
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse + Tree sample does not work.
Posted: Thu Jul 27, 2023 05: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 (fw): Select all Collapse
   ::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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xBrowse + Tree sample does not work.
Posted: Fri Jul 28, 2023 03: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 March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xBrowse + Tree sample does not work.
Posted: Sun Jul 30, 2023 06: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 March-April 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

Continue the discussion