pudieron avanzar en ordenacion de un tree?

Post Reply
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

pudieron avanzar en ordenacion de un tree?

Post by goosfancito »

Eso

grcias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by Antonio Linares »

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
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

Re: pudieron avanzar en ordenacion de un tree?

Post by goosfancito »

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/
User avatar
karinha
Posts: 7940
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by karinha »

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
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

Re: pudieron avanzar en ordenacion de un tree?

Post by goosfancito »

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/
User avatar
karinha
Posts: 7940
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by karinha »

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
User avatar
TOTOVIOTTI
Posts: 430
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina
Has thanked: 5 times

Re: pudieron avanzar en ordenacion de un tree? (xbrowse)

Post by TOTOVIOTTI »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by nageswaragunupudi »

May we know your FWH version please?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by nageswaragunupudi »

May we know your FWH version please?
Regards

G. N. Rao.
Hyderabad, India
User avatar
TOTOVIOTTI
Posts: 430
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina
Has thanked: 5 times

Re: pudieron avanzar en ordenacion de un tree?

Post by TOTOVIOTTI »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: pudieron avanzar en ordenacion de un tree?

Post by nageswaragunupudi »

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: Select all | Expand

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: Select all | Expand

#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
 
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
TOTOVIOTTI
Posts: 430
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina
Has thanked: 5 times

Re: pudieron avanzar en ordenacion de un tree?

Post by TOTOVIOTTI »

Thanks Mr.Rao!!!!!!!!!
Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.ar
Post Reply