pudieron avanzar en ordenacion de un tree?

pudieron avanzar en ordenacion de un tree?

Postby goosfancito » Mon Jul 26, 2021 9:10 pm

Eso

grcias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: pudieron avanzar en ordenacion de un tree?

Postby Antonio Linares » Tue Jul 27, 2021 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: pudieron avanzar en ordenacion de un tree?

Postby goosfancito » Tue Jul 27, 2021 9: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/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: pudieron avanzar en ordenacion de un tree?

Postby karinha » 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
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: pudieron avanzar en ordenacion de un tree?

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

Re: pudieron avanzar en ordenacion de un tree?

Postby karinha » Wed Jul 28, 2021 1: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
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

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

Postby TOTOVIOTTI » 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.edu.ar
User avatar
TOTOVIOTTI
 
Posts: 387
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina

Re: pudieron avanzar en ordenacion de un tree?

Postby nageswaragunupudi » Mon Jul 10, 2023 4:01 pm

May we know your FWH version please?
Regards

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

Re: pudieron avanzar en ordenacion de un tree?

Postby nageswaragunupudi » Mon Jul 10, 2023 4:01 pm

May we know your FWH version please?
Regards

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

Re: pudieron avanzar en ordenacion de un tree?

Postby TOTOVIOTTI » Mon Jul 10, 2023 6: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.edu.ar
User avatar
TOTOVIOTTI
 
Posts: 387
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina

Re: pudieron avanzar en ordenacion de un tree?

Postby nageswaragunupudi » Tue Jul 11, 2023 1: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: Select all  Expand view
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 view
#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
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: pudieron avanzar en ordenacion de un tree?

Postby TOTOVIOTTI » Tue Jul 11, 2023 2:48 pm

Thanks Mr.Rao!!!!!!!!!
Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.edu.ar
User avatar
TOTOVIOTTI
 
Posts: 387
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 76 guests