Create a folder system

Create a folder system

Postby Silvio.Falconi » Tue Jan 26, 2016 9:52 am

how I can create a folder system on a window main as this :

Image

there is a owndMain, at left Explorer bar at right a system where the user can show many folders as childwnd and on each folder can show any solution as xbrowse, chart, rpreview or dialog for inser/modif

sometimes a folder can have horizontal splitter and have another xbrowse on bottom

each folder can be close from label ( see the red x on label)

how create it ?

I made a test but it make a adjclient error on resize

Code: Select all  Expand view

    #include "FiveWin.ch"


    static oWnd,oBar,oExit

    static oMsgItem3,oMsgItem2,cMsgBar

    static  FEATURES_YEAR


    static oDlgFatturas


//----------------------------------------------------------------------------//
    function Main()

       local oWnd

       cMsgBar:= "test"
       FEATURES_YEAR:= "2015"


       DEFINE WINDOW oWnd TITLE "Test" ;
        MENU BuildMenu()               ;
        COLOR CLR_BLACK, GetSysColor( 15 ) - Rgb( 30, 30, 30 )


      SET MESSAGE OF oWnd TO cMsgBar CENTER NOINSET 2015

      DEFINE MSGITEM oMsgItem2;
         OF oWnd:oMsgBar ;
         PROMPT cMsgBar      ;
         SIZE 100              ;
         BITMAPS "MSG_LOTUS", "MSG_LOTUS";
         TOOLTIP " " + i18n("Acerca de...") + " ";
         ACTION MsgInfo( "Test de Full Single Document Interface" )

      DEFINE MSGITEM oMsgItem3 OF oWnd:oMsgBar ;
         SIZE 132 ;
         TOOLTIP i18n( "Visitar la web de alanit en internet" ) ;
         PROMPT "www.alanit.com" ;
         COLOR CLR_HBLUE, GetSysColor(15)    ;
         ACTION NIL

      oWnd:oMsgBar:DateOn()



       BuildBtnBar(oWnd)



       ACTIVATE WINDOW oWnd  ;
       on resize ResizeWndMain(oWnd)

       return nil


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

  Function BuildBtnBar(oWnd)

   local oBtnTbl

   DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2015

      oBar:bRClicked := { || .t. }

   DEFINE BUTTON OF oBar ;
      RESOURCE "BB1"       ;
      TOOLTIP i18n( "Gestión de documentos" ) ;
      MESSAGE i18n( "Gestión de del fichero de documentos." ) ;
      ACTION test(oWnd)   ;
      NOBORDER


   RETURN nil


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


   Function  BuildMenu()

   local oMenu
   MENU oMenu FEATURES_YEAR //2015    try with 2015 or nothing...
      MENUITEM "&Archivo"
         MENU
         MENUITEM i18n( "Especificar impresora" ) ;
         RESOURCE "PRINTER" ;     // ON WINDOWS SEVEN IF NOT FOUND RESOURCEs IT  INSERT BLACK LINES
               ACTION PrinterSetup() ;
               MESSAGE i18n( " Establecer la Configuración de su impresora. " )
            SEPARATOR
            MENUITEM i18n( "Salir" ) ;
               ACTION oWnd:end() ;
               MESSAGE i18n( " Terminar la ejecución del programa. " )
         ENDMENU
   ENDMENU
RETURN oMenu

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


Function Test(oWnd)
  local  oPanel1
 
  Local nSplit := 400
  LOcal aClient := GetClientRect (oWnd:hWnd )

  DEFINE DIALOG oDlgFatturas

   oDlgFatturas:nTop    = oBar:nHeight + 4
   oDlgFatturas:nLeft   = 0
   oDlgFatturas:nBottom = aClient[3] - 1
   oDlgFatturas:nRight  = aClient[4]

   oDlgFatturas:nStyle  := nOR( WS_CHILD, 4 )


   oWnd:oClient := oDlgFatturas



    ACTIVATE DIALOG oDlgFatturas NOWAIT ;
              on init ( Explorerbar (oDlgFatturas,nSplit),;
                        Folder(oDlgFatturas,nSplit))


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

Function Explorerbar(oDlgFatturas,nSplit)
   oExBar = TExplorerBar():New( 0, 0, nSplit, oDlgFatturas:nBottom, oDlgFatturas )
   oPanel1 := oExBar:AddPanel( "Uno" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "enero" )
 return nil


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

Function Folder(oDlgFatturas,nSplit)
    Local aPrompts:= { "&Fatturas" }

   oFold :=Tfolder():New( 0, nSplit+5,aPrompts , , oDlgFatturas, , ,;
            , .t., , oDlgFatturas:nWidth, oDlgFatturas:nBottom )

    return nil


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

    Function ResizeWndMain(oWnd)
   local aClient

      aClient := GetClientRect ( oWnd:hWnd )

      IF  oDlgFatturas != NIL

         oDlgFatturas:SetSize( aClient[4], aClient[3] - oBar:nHeight - oWnd:oMsgBar:nHeight+1 )

       oWnd:oMsgBar:Refresh()
         SysRefresh()
   ENDIF
   return NIL

 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby cnavarro » Tue Jan 26, 2016 1:25 pm

Something like this example that I put in the forum?

viewtopic.php?f=6&t=31798&start=0#p186034
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Create a folder system

Postby joseluisysturiz » Wed Jan 27, 2016 3:20 am

Haber si te sirve, este es con MDI...saludos... :shock:

Code: Select all  Expand view

PROCEDURE ma_clientes()

   LOCAL oWnd, oDlg, oExpBar, aPanel[3], oBrw, oCol, oSplitV, aCampos ,;
      cQry, oQry, oError

   oWnd := oDatos:oWndPPAL

   IF oWndCli == NIL
      DEFINE WINDOW oWndCli ;
         TITLE oDatos:cTitDlg + " - VENTAS - Ficha de Clientes" ;
         BORDER SINGLE MDICHILD OF oWnd

      oExpBar = TExplorerBar():New( 00, 00, 200, oWndCli:nHeight, oWndCli )

      aPanel[1] = oExpBar:AddPanel( "CLIENTES", "Clientes32" )
      aPanel[1]:lSpecial = .t.
      aPanel[1]:AddLink( "Nuevo    ", {|| ficha_clientes( .t., oQry, oBrw ) }, "nuevo16" )
      aPanel[1]:AddLink( "Modificar", {|| ficha_clientes( .f., oQry, oBrw ) }, "modifi16" )
      aPanel[1]:AddLink( "Eliminar ", {|| IF( mbuscar( oQry, oBrw, "cliente_id" ) ,;
         eliminar( oQry, oBrw, "cliente_id" ), ) }, "elimi16" )
      aPanel[1]:AddLink( "Buscar   ", {|| msginfo("Buscar...") }, "buscar16" )
      aPanel[2] = oExpBar:AddPanel( "REPORTES", "print32" )
      aPanel[2]:AddLink( "Report-1", {|| Alert("en construccion") }, "repo1" )
      aPanel[3] = oExpBar:AddPanel( "SALIDA", "salir32" )
      aPanel[3]:AddLink( "Salir", {|| oWndCli:End() }, "salir16" )

      aCampos := {"cliente_id", "cliente_nombre", "cliente_telefono", "cliente_clasifi"}

      oBrw := TXBrowse():New( oWndCli )

      WITH OBJECT oBrw
         :SetDolphin( oQry, .t., .t., aCampos )
         :nMarqueeStyle    := MARQSTYLE_HIGHLROW
         :nColDividerStyle := LINESTYLE_BLACK
         :nStretchCol      := STRETCHCOL_LAST
         :lColDividerComplete := .t.
         :nHeaderHeight := 30
         :nLeft := 203
         :l2007 := .t.
         :lFooter := .f.
         :lRecordSelector := .t.
         :bClrStd := {|| IF( oQry:RecNo() % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203,226,254)} ) }
         :bLDblClick := {|| ficha_clientes( .f., oQry, oBrw ) }
         :bKeyDown := {|nKey| IF( nKey == VK_RETURN, ficha_clientes( .f., oQry, oBrw ), ) }
      END WITH

      oBrw:aCols[1]:cHeader       := "Código"
      oBrw:aCols[1]:bStrData      := {|| IIF( oQry:LastRec() == 0, SPACE(10) ,;
                                          oQry:cliente_id ) }
      oBrw:aCols[1]:nHeadStrAlign := AL_CENTER
      oBrw:aCols[1]:nDataStrAlign := AL_LEFT
      oBrw:aCols[1]:nWidth        := 150

      oBrw:CreateFromCode()

      @ 00,201 SPLITTER oSplitV VERTICAL ;
         PREVIOUS CONTROLS oExpBar ;
         HINDS CONTROLS oBrw ;
         SIZE 1, oWndCli:nHeight PIXEL ;
         OF oWndCli ;
         3DLOOK UPDATE

      oSplitV:lStatic:=.t.

      SET MESSAGE OF oWndCli TO oDatos:cTitDlg + " - Maestro de Clientes"

      oBrw:SetFocus()

      ACTIVATE WINDOW oWndCli MAXIMIZED ;
         ON RESIZE( oExpBar:AdjLeft(), oSplitV:AdjClient(), oSplitV:AdjRight() ) ;
         VALID( oWndCli := NIL, .t. )
   ELSE
      oWndCli:Restore()
      oWndCli:SetFocus()
   ENDIF

RETURN
 
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Create a folder system

Postby Silvio.Falconi » Fri Jan 29, 2016 7:49 am

joseluisysturiz,
can you send me a test sample complete please ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby joseluisysturiz » Fri Jan 29, 2016 4:12 pm

Silvio.Falconi wrote:joseluisysturiz,
can you send me a test sample complete please ?


Probastes lo que publique.? ese es con la TExplorer y con un Browse, solo le falta agregar el MENU y la MENUBAR, que parte te falta o necesitas.? saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Create a folder system

Postby Silvio.Falconi » Sat Jan 30, 2016 11:17 am

I tried to compiling the test adding a window main but I have problem and errors

Code: Select all  Expand view
#include "fivewin.ch"

Static oWnd

Function Main()

DEFINE WINDOW oWnd MDI

ACTIVATE WINDOW oWnd ;
ON INIT ma_clientes()

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


    PROCEDURE ma_clientes()

       LOCAL oWnd, oDlg, oExpBar, aPanel[3], oBrw, oCol, oSplitV, aCampos ,;
          cQry, oQry, oError

       oWnd := oDatos:oWndPPAL

       IF oWndCli == NIL
          DEFINE WINDOW oWndCli ;
             TITLE oDatos:cTitDlg + " - VENTAS - Ficha de Clientes" ;
             BORDER SINGLE MDICHILD OF oWnd

          oExpBar = TExplorerBar():New( 00, 00, 200, oWndCli:nHeight, oWndCli )

          aPanel[1] = oExpBar:AddPanel( "CLIENTES", "Clientes32" )
          aPanel[1]:lSpecial = .t.
          aPanel[1]:AddLink( "Nuevo    ", {|| ficha_clientes( .t., oQry, oBrw ) }, "nuevo16" )
          aPanel[1]:AddLink( "Modificar", {|| ficha_clientes( .f., oQry, oBrw ) }, "modifi16" )
          aPanel[1]:AddLink( "Eliminar ", {|| IF( mbuscar( oQry, oBrw, "cliente_id" ) ,;
             eliminar( oQry, oBrw, "cliente_id" ), ) }, "elimi16" )
          aPanel[1]:AddLink( "Buscar   ", {|| msginfo("Buscar...") }, "buscar16" )
          aPanel[2] = oExpBar:AddPanel( "REPORTES", "print32" )
          aPanel[2]:AddLink( "Report-1", {|| Alert("en construccion") }, "repo1" )
          aPanel[3] = oExpBar:AddPanel( "SALIDA", "salir32" )
          aPanel[3]:AddLink( "Salir", {|| oWndCli:End() }, "salir16" )

          aCampos := {"cliente_id", "cliente_nombre", "cliente_telefono", "cliente_clasifi"}

          oBrw := TXBrowse():New( oWndCli )

          WITH OBJECT oBrw
             :SetDolphin( oQry, .t., .t., aCampos )
             :nMarqueeStyle    := MARQSTYLE_HIGHLROW
             :nColDividerStyle := LINESTYLE_BLACK
             :nStretchCol      := STRETCHCOL_LAST
             :lColDividerComplete := .t.
             :nHeaderHeight := 30
             :nLeft := 203
             :l2007 := .t.
             :lFooter := .f.
             :lRecordSelector := .t.
             :bClrStd := {|| IF( oQry:RecNo() % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203,226,254)} ) }
             :bLDblClick := {|| ficha_clientes( .f., oQry, oBrw ) }
             :bKeyDown := {|nKey| IF( nKey == VK_RETURN, ficha_clientes( .f., oQry, oBrw ), ) }
          END WITH

          oBrw:aCols[1]:cHeader       := "Código"
          oBrw:aCols[1]:bStrData      := {|| IIF( oQry:LastRec() == 0, SPACE(10) ,;
                                              oQry:cliente_id ) }
          oBrw:aCols[1]:nHeadStrAlign := AL_CENTER
          oBrw:aCols[1]:nDataStrAlign := AL_LEFT
          oBrw:aCols[1]:nWidth        := 150

          oBrw:CreateFromCode()

          @ 00,201 SPLITTER oSplitV VERTICAL ;
             PREVIOUS CONTROLS oExpBar ;
             HINDS CONTROLS oBrw ;
             SIZE 1, oWndCli:nHeight PIXEL ;
             OF oWndCli ;
             3DLOOK UPDATE

          oSplitV:lStatic:=.t.

          SET MESSAGE OF oWndCli TO oDatos:cTitDlg + " - Maestro de Clientes"

          oBrw:SetFocus()

          ACTIVATE WINDOW oWndCli MAXIMIZED ;
             ON RESIZE( oExpBar:AdjLeft(), oSplitV:AdjClient(), oSplitV:AdjRight() ) ;
             VALID( oWndCli := NIL, .t. )
       ELSE
          oWndCli:Restore()
          oWndCli:SetFocus()
       ENDIF

    RETURN
     
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby Silvio.Falconi » Sat Jan 30, 2016 11:29 am

with these correction now the test run
Code: Select all  Expand view
#include "fivewin.ch"
#include "Splitter.ch"

Static oWnd

Function Main()

DEFINE WINDOW oWnd MDI

ACTIVATE WINDOW oWnd ;
ON INIT ma_clientes()

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


    PROCEDURE ma_clientes()

       LOCAL oWnd, oDlg, oExpBar, aPanel[3], oBrw, oCol, oSplitV, aCampos ,;
          cQry, oQry, oError,oWndCli

      * oWnd := oDatos:oWndPPAL

       IF oWndCli == NIL
          DEFINE WINDOW oWndCli ;
             TITLE  " - VENTAS - Ficha de Clientes" ;
             BORDER SINGLE MDICHILD OF oWnd

          oExpBar = TExplorerBar():New( 00, 00, 200, oWndCli:nHeight, oWndCli )

          aPanel[1] = oExpBar:AddPanel( "CLIENTES", "Clientes32" )
          aPanel[1]:lSpecial = .t.
          aPanel[1]:AddLink( "Nuevo    ", {|| ficha_clientes( .t., oQry, oBrw ) }, "nuevo16" )
          aPanel[1]:AddLink( "Modificar", {|| ficha_clientes( .f., oQry, oBrw ) }, "modifi16" )
          aPanel[1]:AddLink( "Eliminar ", {|| IF( mbuscar( oQry, oBrw, "cliente_id" ) ,;
             eliminar( oQry, oBrw, "cliente_id" ), ) }, "elimi16" )
          aPanel[1]:AddLink( "Buscar   ", {|| msginfo("Buscar...") }, "buscar16" )
          aPanel[2] = oExpBar:AddPanel( "REPORTES", "print32" )
          aPanel[2]:AddLink( "Report-1", {|| Alert("en construccion") }, "repo1" )
          aPanel[3] = oExpBar:AddPanel( "SALIDA", "salir32" )
          aPanel[3]:AddLink( "Salir", {|| oWndCli:End() }, "salir16" )

          aCampos := {"cliente_id", "cliente_nombre", "cliente_telefono", "cliente_clasifi"}

          oBrw := TXBrowse():New( oWndCli )

          WITH OBJECT oBrw
            * :SetDolphin( oQry, .t., .t., aCampos )
             :nMarqueeStyle    := MARQSTYLE_HIGHLROW
             :nColDividerStyle := LINESTYLE_BLACK
             :nStretchCol      := STRETCHCOL_LAST
             :lColDividerComplete := .t.
             :nHeaderHeight := 30
             :nLeft := 203
             :l2007 := .t.
             :lFooter := .f.
             :lRecordSelector := .t.
             :bClrStd := {|| IF( oQry:RecNo() % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203,226,254)} ) }
             :bLDblClick := {|| ficha_clientes( .f., oQry, oBrw ) }
             :bKeyDown := {|nKey| IF( nKey == VK_RETURN, ficha_clientes( .f., oQry, oBrw ), ) }
          END WITH
      /*
          oBrw:aCols[1]:cHeader       := "Código"
          oBrw:aCols[1]:bStrData      := {|| IIF( oQry:LastRec() == 0, SPACE(10) ,;
                                              oQry:cliente_id ) }
          oBrw:aCols[1]:nHeadStrAlign := AL_CENTER
          oBrw:aCols[1]:nDataStrAlign := AL_LEFT
          oBrw:aCols[1]:nWidth        := 150
         */

          oBrw:CreateFromCode()

          @ 00,201 SPLITTER oSplitV VERTICAL ;
             PREVIOUS CONTROLS oExpBar ;
             HINDS CONTROLS oBrw ;
             SIZE 1, oWndCli:nHeight PIXEL ;
             OF oWndCli ;
             3DLOOK UPDATE

          oSplitV:lStatic:=.t.

          SET MESSAGE OF oWndCli TO " - Maestro de Clientes"

          oBrw:SetFocus()

          ACTIVATE WINDOW oWndCli MAXIMIZED ;
             ON RESIZE( oExpBar:AdjLeft(), oSplitV:AdjClient(), oSplitV:AdjRight() ) ;
             VALID( oWndCli := NIL, .t. )
       ELSE
          oWndCli:Restore()
          oWndCli:SetFocus()
       ENDIF

       RETURN


Function ficha_clientes()
   return nil

Function mbuscar()
   return nil
  Function eliminar()
   return ni
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby Silvio.Falconi » Sat Jan 30, 2016 11:31 am

but I mean and I'm searching other....structure see the link I sent you on private mail pls
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby joseluisysturiz » Sun Jan 31, 2016 12:26 am

Silvio.Falconi wrote:but I mean and I'm searching other....structure see the link I sent you on private mail pls


Que necesitas en si...? para enviartelo, aca te copie todo el codigo, lo que no hay es los modulos que llaman los links, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Create a folder system

Postby Silvio.Falconi » Mon Feb 01, 2016 11:44 am

I saw this feature on application
you can download it from http://www.-.com/download?en&file=14


when I open a procedure it create an explorer class at left and a folder with one label at right

if I open another procedure it show the explorer changed and add another label on folder

if I close on x on folder it close the label of folder and recall the old label and explorer menu



I sent u a message on joseluisy@hotmail.com
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a folder system

Postby joseluisysturiz » Mon Feb 01, 2016 6:31 pm

Silvio.Falconi wrote:I saw this feature on application
you can download it from http://www.-.com/download?en&file=14


when I open a procedure it create an explorer class at left and a folder with one label at right

if I open another procedure it show the explorer changed and add another label on folder

if I close on x on folder it close the label of folder and recall the old label and explorer menu



I sent u a message on joseluisy@hotmail.com


Silvio, estoy descargando y revisando la aplicacion que me enviastes, si puedes por favor escribeme en Español o Ingles, asi puedo usar traductor...usa el correo joseluisysturiz@yahoo.com, te respondere por alli, estamos contacto, gracias...saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests