FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour pudieron avanzar en ordenacion de un tree?
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
pudieron avanzar en ordenacion de un tree?
Posted: Mon Jul 26, 2021 09:10 PM

Eso

grcias.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Tue Jul 27, 2021 08:44 AM

Ordenación alfabética ?

Lo ideal sería usar un codeblock como se usa con la función ASort()

Aún no está listo

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Tue Jul 27, 2021 09:11 PM

claro,

Yo estoy aun peliandola, si logro ordenar voy a postearlo asi pueden aportar.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Tue Jul 27, 2021 10:29 PM

goosfancito, todavía no sé cómo usar el árbol de Fivewin, si no estoy pidiendo demasiado, ¿podrías enviarme un modelo básico para que pueda aprender cómo funciona? Me gustaría hacer un árbol usando los usuarios y sus contraseñas, ¿es posible? Inclusión, borrado e impresión de contraseñas. ¿Lo entiendes? Gracias.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Wed Jul 28, 2021 12:59 AM

dale, no hay drama.
Mañana cuelgo uno el github asi pueden acceder

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Wed Jul 28, 2021 01:57 PM
goosfancito wrote:dale, no hay drama.
Mañana cuelgo uno el github asi pueden acceder


Gracias. Hágalo lo más simple posible, porque la inteligencia no es mi punto fuerte. jajajajaja

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Re: pudieron avanzar en ordenacion de un tree? (xbrowse)
Posted: Mon Jul 10, 2023 12:18 PM

Hola gente...

retomo de vuelta este hilo.. hay forma de ordenar un tree de un xbrowse?

El AUTOSORT no funciona, hay alguna otra manera de realizarlo?

Muchas gracias!

Roberto

Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Mon Jul 10, 2023 04:01 PM

May we know your FWH version please?

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Mon Jul 10, 2023 04:01 PM

May we know your FWH version please?

Regards



G. N. Rao.

Hyderabad, India
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Mon Jul 10, 2023 06:32 PM

Mr. Nagues...

my version is year 2018... very old... maybe it could be solved from programming with my version...

Roberto

Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Tue Jul 11, 2023 01:32 PM
First, you need to modify the fwh program
fwh\source\classes\linklist.prg

In this program please replace the existing METHOD Sort() with this revised new method:
Code (fw): Select all Collapse
METHOD Sort( lAsc, lRecurs ) CLASS TLinkList

   local oPrev, oNext, n, aItems := {}
   local oItem
   local bSort

   DEFAULT lAsc   := .t., lRecurs := .f.
   if HB_ISBLOCK( lAsc )
      bSort := lAsc
      lAsc  := .t.
   else
      if HB_ISSTRING( lAsc )
         lAsc  := ( UPPER( LEFT( lAsc, 1 ) ) == "A" )
      else
         lAsc  := !Empty( lAsc )
      endif
      if lAsc
         bSort := { |x,y| Upper( x:cPrompt ) < Upper( y:cPrompt ) }
      else
         bSort := { |x,y| Upper( x:cPrompt ) > Upper( y:cPrompt ) }
      endif
   endif

   if ::oFirst == nil
      return nil
   endif
   oPrev          := ::oFirst:oPrev
   oNext          := ::oLast:oNext
   ::Eval( { |o| AAdd( aItems, o ) }, nil, nil, .f. )

   if lRecurs
      AEval( aItems, { |o| If( o:oTree == nil,, o:oTree:Sort( bSort, .t. ) ) } )
   endif

   ASort( aItems,,,bSort )

   ::oFirst       := aItems[ 1 ]
   ::oFirst:oPrev := oPrev
   for n := 2 to Len( aItems )
      aItems[ n ]:oPrev    := aItems[ n - 1 ]
      aItems[ n - 1 ]:SetNext( aItems[ n ] )
   next n
   ::oLast        := ATail( aItems )
   ::oLast:SetNext( oNext )

return nil
Please include the modified linklist.prg in your project link script.

Then you can sort the Tree as shown in this example program:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oTree

   oTree := MakeTree()

   XBROWSER oTree AUTOSORT SETUP ( ;
      oBrw:aCols[ 1 ]:cSortOrder := { |oCol| SetOrder( oCol ) } ;
      )

return nil

static function SetOrder( oCol )

   local cOrder   := If( oCol:cOrder == "A", "D", "A" )

   WITH OBJECT oCol:oBrw
      :oTree:Sort( cOrder, .t. )
      :GoTop()
   END

return cOrder

static function MakeTree()

   local oTree

   TREE oTree
      TREEITEM "DEF"
      TREE
         TREEITEM "222"
         TREEITEM "333"
         TREE
            TREEITEM "JAN"
            TREEITEM "FEB"
            TREEITEM "MAR"
         ENDTREE
         TREEITEM "111"
      ENDTREE
      TREEITEM "ABC"
      TREE
         TREEITEM "777"
         TREEITEM "333"
         TREEITEM "444"
      ENDTREE
      TREEITEM "CDE"
      TREE
         TREEITEM "SUN"
         TREEITEM "MON"
         TREEITEM "TUE"
      ENDTREE
   ENDTREE

   oTree:OpenAll()

return oTree
Regards



G. N. Rao.

Hyderabad, India
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Re: pudieron avanzar en ordenacion de un tree?
Posted: Tue Jul 11, 2023 02:48 PM

Thanks Mr.Rao!!!!!!!!!

Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar

Continue the discussion