Page 2 of 4

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Tue Jan 16, 2018 7:47 pm
by cnavarro
sygecom wrote:Cristobal Navarro,

Si no es pedir más. ¿Podría dar una ruta de ejemplo de UPLOAD?

Gracias


No es posible hacerlo sin las APIS
( Bueno, si es posible, enviando el fichero a la carpeta de DRIVE local del ordenador y sincronizando, pero no creo que eso sea lo que buscas )

Con mi lib de APIS de google, si se puede. A ver si tengo tiempo y pongo un ejemplo

sygecom wrote: Cristobal Navarro,

If it is not asking for more. Could you give a sample route of UPLOAD?

Thanks


It is not possible to do it without the APIs
(Well, it's possible, sending the file to the local DRIVE folder of the computer and synchronizing, but I do not think that's what you're looking for)

With my APIS lib of google, yes, you can. Let's see if I have time and I'll give an example

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Tue Jan 16, 2018 10:24 pm
by Xevi
Jejeje...

Y ya, puestos a pedir, una vez SI SE PUEDE subir un archivo, compartirlo y recoger el link de descarga, no??? Sería el NO VA MAS!!! y todo en "silencioso" jejeje

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Wed Jan 17, 2018 3:27 pm
by sygecom
Cristobal Navarro, Gracias.

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Thu Jan 18, 2018 3:05 pm
by cnavarro
Xevi wrote:Jejeje...

Y ya, puestos a pedir, una vez SI SE PUEDE subir un archivo, compartirlo y recoger el link de descarga, no??? Sería el NO VA MAS!!! y todo en "silencioso" jejeje


Done

viewtopic.php?f=6&t=34903&start=15#p209198

English

viewtopic.php?f=3&t=34904&start=15#p209197

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Jan 29, 2018 3:05 pm
by cnavarro
Bueno, no pongo el arbolito ya

Aqui pongo una forma de poder cambiar el ACTION de un menuitem o de un button de una button bar
Está aplicado a la button bar y menu de la pantalla del preview de un report, que me ha servido como ejemplo

Code: Select all  Expand view

#include "Fivewin.ch"
#include "report.ch"

static oWnd

Static bOldActionMnu
Static bOldActionBar
Static oRep

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

Function Main()

   Test()

Return nil

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

Function Test()

   local oWndEdit, oBar, oIcon, oImage
   local cName := "FiveWin: Sample of Change Action MenuItem and Button of ButtonBar ( C.Navarro - 27/01/2018 )"

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE cName + " - " + FWVERSION ; //      MDI ;
      MENU BuildMenu()

   SET MESSAGE OF oWnd TO cName

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

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

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Program"
      MENU
         MENUITEM "&Report" ACTION MyReport()
         SEPARATOR
         MENUITEM "&End..." ACTION oWnd:End()
      ENDMENU

   ENDMENU

return oMenu

//----------------------------------------------------------------------------//
// Guardamos la action que tenia el item seleccionado
//----------------------------------------------------------------------------//

Function SaveActionMnu( n, m )

   DEFAULT n  := 1   // Numero de orden del item del menu principal
   DEFAULT m  := 1   // Numero de orden del item dentro del menu 'n'  - Print

   // Guardamos la accion que tenia el menuitem
   bOldActionMnu := oRep:oDevice:oPreview:oWnd:oMenu:aMenuItems[ n ]:bAction:aMenuItems[ m ]:bAction
   oRep:oDevice:oPreview:oWnd:oMenu:aMenuItems[ n ]:bAction:aMenuItems[ m ]:bAction := { || ChangeActionMnu( n, m ) }

Return nil

//----------------------------------------------------------------------------//
// Nueva action en el item, ejecutando también la anterior action que tenía
//----------------------------------------------------------------------------//


Function ChangeActionMnu( n, m )

   // Cualquier accion que quieras ejecutar
   MsgInfo( oRep:oDevice:oPreview:oWnd:oMenu:aMenuItems[ n ]:bAction:aMenuItems[ m ]:cPrompt )
   // Ejecutar la accion que tenia por defecto
   // Para cerrar la ventana seria oRep:oDevice:oPreview:oWnd:End()
   Eval( bOldActionMnu )

Return nil

//----------------------------------------------------------------------------//
// Guardamos la action que tenia el button seleccionado
//----------------------------------------------------------------------------//

Function SaveActionBar( n )

   DEFAULT n  := 7  // Numero de orden del boton en el buttonbar - Print

   // Guardamos la accion que tenia el boton
   bOldActionBar   := oRep:oDevice:oPreview:oWnd:oBar:aControls[ n ]:bAction
   oRep:oDevice:oPreview:oWnd:oBar:aControls[ n ]:bAction := { || ChangeActionBar( n ) }

Return nil

//----------------------------------------------------------------------------//
// Nueva action en el button, ejecutando también la anterior action que tenía
//----------------------------------------------------------------------------//

Function ChangeActionBar( n )

   // Cualquier accion que quieras ejecutar
   // Para cerrar la ventana seria oRep:oDevice:oPreview:oWnd:End()
   //oRep:oDevice:oPreview:oWnd:End()
   MsgInfo( oRep:oDevice:oPreview:oWnd:oBar:aControls[ n ]:cTooltip )
   // Ejecutar la accion que tenia por defecto
   //Eval( bOldActionBar )

Return nil

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

Function MyReport()

   local aData, i, d, aTmp := {}

   aData    := { ;
      { Date() - 30, "Line-1", 1000 }, ;
      { Date() - 30, "Line-2", 1500 }, ;
      { Date(),      "Line-3", 2000 }, ;
      { Date(),      "Line-4", 2500 }  }
     
   For i := 1 to 240
      AAdd( aTmp, "Number: " + StrZero( i, 3 ) )
   Next i

   i := 1

   REPORT oRep PREVIEW

   COLUMN TITLE "Date"   DATA aData[ i, 1 ]
   COLUMN TITLE "Text"   DATA aData[ i, 2 ]
   COLUMN TITLE "Amount" DATA aData[ i, 3 ] PICTURE "99,999.99" TOTAL

   END REPORT

   WITH OBJECT oRep
      :bWhile        := { || i <= Len( aData ) }
      :bSkip         := { || i++ }
   END

   ACTIVATE REPORT oRep

return nil

//----------------------------------------------------------------------------//
// Tenemos que redefinir la function que tenemos en Fivewin
// Porque el objeto oPreview no se genera hasta que no se ha realizado el
// listado guardándolo en metafiles. Después ya se ejecuta esta function que es
// la que muestra estos metafiles en pantalla
// Mirar el metodo ACTIVATE del Report.
// Si se pudiera ejecutar esta function antes de crear el listado no haria falta
// redefinirla, pero eso crearia el problema de que los metafiles no han sido
// creados aún.
//----------------------------------------------------------------------------//

function RPreview( oDevice, oReport )

   local oPreview

   oDevice:oPreview := TPreview():New( oDevice, oReport )
   oDevice:oPreview:oWnd:bInit   := { || SaveActionMnu( 1, 3 ), SaveActionBar( 7 ) }
   oDevice:oPreview:Activate()

return oPreview

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

 

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Sat Mar 10, 2018 7:50 pm
by cnavarro
Un ejemplo de cómo convertir un menu en un Tree
En este ejemplo, pinto el menú, pero no es necesario, evidentemente
Se olvidó incluirlo en la versión actual
( Sólo funciona a partir de la versión 18.02 )

An example of how to convert a menu into a Tree
In this example, I paint the menu, but it's not necessary, obviously
He forgot to include it in the current version
(It only works from version 18.02)

Image

Image

Code: Select all  Expand view


//----------------------------------------------------------------------------//
// Test make tree from menu
// 28/01/2018
// Cristobal Navarro
//----------------------------------------------------------------------------//

#include "fivewin.ch"

Static oFont
Static oFontMenu
Static oWnd
Static nItCheck   := 2

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

function Main()

   Local cFont     := "Segoe UI"
   Local cFontH    := -12
   local oMnu
   local oBrw
   local oTreeMnu

   DEFINE FONT oFont NAME "Segoe UI SEMILIGHT" SIZE 0, -14
   DEFINE FONT oFontMenu NAME cFont SIZE 0, cFontH WEIGHT 300

   //oMnu   := MakeMenu()

   DEFINE WINDOW oWnd TITLE "Test Make Tree From Menu" FROM 0, 0 TO 600, 800 ;
      MENU MakeMenu() ;
      PIXEL //STYLE WS_POPUP
   oWnd:SetFont( oFont )
   oWnd:SetColor( CLR_WHITE, Rgb( 240, 240, 240 ) )

    oTreeMnu := oWnd:oMenu:MnuTree()
    //oTreeMnu := oMnu:MnuTree()

    @ 05, 05 XBROWSE oBrw SIZE 300, -10 OF oWnd ;
        DATASOURCE oTreeMnu CELL LINES NOBORDER PIXEL

        WITH OBJECT oBrw
           :nMarqueeStyle    := MARQSTYLE_HIGHLROW
           :lrecordselector  := .F.
           :lHeader          := .F.    
           :lFooter          := .F.
           :lHScroll         := .F.
           :lVScroll         := .F.
           :SetFont( oFont )
           :nRowHeight       := Int( Abs( oFont:nHeight * 2.4 ) )
           :nColDividerStyle := 0
           :nRowDividerStyle := 0      
           :bClrStd          := { || { Rgb( 255, 255, 255 ), Rgb( 88, 88, 88 ) } }
           :bClrSelFocus     := { || { Rgb( 255, 255, 255 ), Rgb( 000, 152, 218 ) } }
           :SetColor( Rgb( 255, 255, 255 ), Rgb( 88, 88, 88 ) )
           :aCols[ 1 ]:AddBitmap( { 0xe127, 0xe1D2, 0xe1F5 } )
           :CreateFromCode()
        END

   ACTIVATE WINDOW oWnd CENTERED

   RELEASE FONT oFont
   RELEASE FONT oFontMenu


return nil

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

function MakeMenu()

   local oMenu, oMnu1, oMnu11, oMnu2, oMnu3
   local oIt4

   MENU oMenu 2013 FONT oFontMenu COLORLEFT CLR_BLUE, Rgb( 248, 248, 240 ) ;
      COLORSELECT CLR_WHITE, CLR_WHITE, CLR_BROWN

      MENUITEM FWVERSION + ": " DISABLED  FILE "https://ssl.gstatic.com/gb/images/a/f420d06f66.png"
      MENUITEM "One"
      MENU oMnu1
         MENUITEM "Sunday"  CHECKED
         MENUITEM SEPARATOR Upper( "Select" )
         MENUITEM "Monday" + CRLF + "Other"  BOLD  RADIOCHECK 3, 2
         MENUITEM "Tuesday"  ACTION MsgInfo( "Hola" )
         MENUITEM "Wednesday"
         SEPARATOR
         MENUITEM "Thursday" FILE "https://ssl.gstatic.com/gb/images/a/dfbeb24785.png"
            MENU oMnu11
               MENUITEM "Saturday"
            ENDMENU
         SEPARATOR
         MENUITEM "Exit" ACTION WndMain():End()
      ENDMENU
      MENUITEM "Tree"
      MENU oMnu2
         MENUITEM "Dialog Tree" CHARICON 57699 ACTION MenuTree( oWnd:oMenu ) BOLD
         SEPARATOR
         MENUITEM "None" CHARICON 57698
      ENDMENU
      MENUITEM "Other"
      MENU oMnu3
         MENUITEM "Sunday" CHARICON 57696
         SEPARATOR
         MENUITEM "Monday" CHARICON 57697
      ENDMENU

      oMenu:AddHelp( , , , , , .F. )
      MENUITEM "&" FILE "https://ssl.gstatic.com/gb/images/a/f420d06f66.png" HELP
      MENU
         MENUITEM "Day" CHARICON 57696
         SEPARATOR
         MENUITEM "Month" CHARICON 57697
         SEPARATOR
         MENUITEM "Year" CHARICON 57697
      ENDMENU
      MENUITEM "&" FILE "https://www.gstatic.com/images/branding/product/1x/gmail_16dp.png"  HELP
      MENU
         MENUITEM "Sunday" CHARICON 57696
         SEPARATOR
         MENUITEM "Monday" CHARICON 57697
      ENDMENU
      MENUITEM "&" FILE "https://www.google.com/images/icons/product/calendar-16.png" HELP ACTION MsgInfo( FWVERSION )
      MENU
         MENUITEM "Sunday" CHARICON 57696
         SEPARATOR
         MENUITEM "Monday" CHARICON 57697
      ENDMENU
   ENDMENU

return oMenu

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

function MenuTree( oMenu )

   local oDlg, oTree
   
   DEFINE DIALOG oDlg SIZE 400, 400 TITLE "TreeView From Menu"
   oDlg:lTruePixel   := .T.
   
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oTree := oMenu:MnuToTreeV( oDlg, 1, 2, 370, 180 ), ;
                oTree:SetFont( oFont ) )

return oTree

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

 

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Sun Mar 18, 2018 1:59 am
by cnavarro
New method of making graphics
Class TGGraphics included in the latest version (18/03/2018) of Google.lib
Includes example and built exe

Nuevo método de realizar gráficos
Class TGGraphics incluida en la ultima version ( 18/03/2018 ) de Google.lib
Incluye ejemplo y exe construido

Image

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 09, 2018 5:52 pm
by cnavarro
Primera version para implementar la tecnica de BlockChain
Ejemplo desarrollado con hashs
Para entender bien el ejemplo, por favor vea este video antes.
Espero sus comentarios

First version to implement the BlockChain technique
Example developed with hashs
To understand the example well, please watch this video before.
I await your comments

https://youtu.be/_160oMzblY8

Image

EXE sample

https://bitbucket.org/fivetech/fivewin- ... OCKFUL.EXE

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 09, 2018 7:11 pm
by lucasdebeltran
Muchas gracias Cristóbal.

¿Está disponible el código fuente?.

La prueba más sencilla sería con un diálogo EDITVARS, editando el campo y que se muestre el hash original y cuando se altera.

¿Qué te parece?

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 09, 2018 7:20 pm
by cnavarro
lucasdebeltran wrote:Muchas gracias Cristóbal.

¿Está disponible el código fuente?.

La prueba más sencilla sería con un diálogo EDITVARS, editando el campo y que se muestre el hash original y cuando se altera.

¿Qué te parece?


Es una clase que hice el verano pasado, pero no he seguido desarrollando el siguiente paso, que es cómo aplicarlo a una base de datos
A ver si me pongo y con la ayuda y comentarios de todos, veo claro cómo aplicarlo con una funcionalidad adecuada.
En cuanto a lo que propones, un solo diálogo no te permitirá ver el efecto del cambio, como en el ejemplo que he puesto, ya que necesitarás ver el bloque anterior y sobre todo el posterior(es), o no he entendido bien lo que propones?

Code: Select all  Expand view


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

CLASS TBlockChain

   CLASSDATA cJson
   CLASSDATA aBlocks         INIT { => }
   CLASSDATA uIndex          INIT ""
   CLASSDATA uDifficulty     INIT "0000"
   CLASSDATA nIterations     INIT 0
   CLASSDATA lBlocks         INIT .T.
   CLASSDATA lRefresh        INIT .F.
   
   METHOD New() CONSTRUCTOR
   METHOD End()
   METHOD Init()
   METHOD AddNewBlock()
   METHOD BlockToHash()
   METHOD CountBlocks()
   METHOD GetAtBlock()
   METHOD GetLastBlock()
   METHOD GetAllBlocks()
   METHOD IsValidPrevious()
   METHOD IsValidHash()
   METHOD IsValidBlock()
   METHOD MineBlock()
   METHOD UpdateAllBlocks()
   METHOD LoadBlocks()        VIRTUAL
   METHOD SaveBlocks()        VIRTUAL

ENDCLASS

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

 

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 09, 2018 8:02 pm
by lucasdebeltran
Gracias Cristóbal, me refiero a un xbrowser con el diálogo, Para hacerlo más sencillo.

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 09, 2018 11:24 pm
by cnavarro
Y crees que con un xBrowse y los EDITVARS se pueden hacer las validaciones y actualizaciones necesarias en cada campo más fácilmente?
Bien, voy a mirar cuando tenga un rato otro formato

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Tue Apr 10, 2018 6:26 am
by Baxajaun
Muchas gracias Cristóbal !!!

Os dejo un enlace de Xataka en la que explican lo que es "blockchain".

https://www.xataka.com/especiales/que-es-blockchain-la-explicacion-definitiva-para-la-tecnologia-mas-de-moda

Reiterar nuevamente nuestro agradecimiento a Cristóbal por sus grandes contribuciones.

Saludos,

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Tue Apr 10, 2018 8:01 am
by hmpaquito
Reiterar nuevamente nuestro agradecimiento a Cristóbal por sus grandes contribuciones.

+1

Re: Decoremos el arbol de navidad de FWH - Decorate the FWH tree

PostPosted: Mon Apr 23, 2018 5:58 pm
by cdmmaui
Dear Cristóbal,

Great work! When will this class be part of FWH FTDN?

Thank you,