Page 1 of 1

dialog with tree and other dialog

Posted: Thu Feb 17, 2022 12:10 pm
by Silvio.Falconi
Image

How I can make a dialog with a tree at left, one splitter and dialogs at right
when I select an item must open the dialog on the space right
as a configuration of a app

Re: dialog with tree and other dialog

Posted: Thu Feb 17, 2022 3:54 pm
by Antonio Linares
Dear Silvio,

Fully coded or using resources ?

Re: dialog with tree and other dialog

Posted: Thu Feb 17, 2022 5:52 pm
by Silvio.Falconi
i wish make on source code
can you make a little sample test?

Re: dialog with tree and other dialog

Posted: Thu Feb 17, 2022 6:13 pm
by Otto
Dear Antonio,
I think this would be a nice task tor webview.

I am working on a DMS with similar layout.

Best regards,
Otto

Image

Re: dialog with tree and other dialog

Posted: Fri Feb 18, 2022 9:12 am
by Silvio.Falconi
Otto wrote:Dear Antonio,
I think this would be a nice task tor webview.

I am working on a DMS with similar layout.

Best regards,
Otto

Image



I need on fwh and windows not on internet explorer ,

Re: dialog with tree and other dialog

Posted: Sat Feb 19, 2022 11:28 am
by Silvio.Falconi
I made a test but not run

Testree5.prg run on Windows but I need to use a dialog

Code: Select all | Expand

// Using a TreeView with checkboxes and checking their status

#include "FiveWin.ch"
#include "Splitter.ch"


function Main()
   local nHt      := Int( ScreenHeight() * 0.3 )
   local nWd      := 600
   local oDlg, oTree,oFont,oBold
   local oSplit
   local nSplit:=100
   local oExbar

  * DEFINE ICON oIcon RESOURCE "ICON1"
   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
   DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -12  BOLD

   DEFINE DIALOG oDlg SIZE  nWd,nHt   PIXEL ;
   COLOR CLR_BLACK,  nRgb( 245,244,234)  FONT oFont  ; //ICON oIcon
   TITLE "Configurazione"   STYLE nOr( WS_OVERLAPPEDWINDOW )

  oExBar := TPanel():New(0,0,oDlg:nBottom,nSplit, oDlg  )
  oExBar:SetColor(0,RGB(143,172,230))



   *   oTree:OnClick = { || CheckStatus( oTree, oTree:aItems ) }


      @ 0,nSplit SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oExBar ;
      HINDS CONTROLS oDlg ;
      SIZE 2,oDlg:nBottom  PIXEL ;
      LEFT MARGIN 20 ;
      RIGHT MARGIN 25 ;
      OF oDlg


        oDlg:bResized  := <||
        local oRect         := oDlg:GetCliRect()
                  oExbar:ntop          := oRect:nTop
                  oExBar:nBottom       := oRect:nheight
                  oSplit:nBottom       := oRect:nbottom

                  RETURN nil
                   >


                   ACTIVATE DIALOG oDlg CENTERED ;
                   ON INIT (oDlg:resize(),;
                            CreateTree(oExBar,oTree)  )

                   return nil
//-------------------------------------------------------------------//
Function CreateTree(oExBar,oTree)
   oTree := TTreeView():New( 0, 0, oExBar,,,,,oExbar:nWidth,oExbar:nBottom,,.t.)
   BuildTree( oTree )
   oExBar:oClient :=oTree
return oTree

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

function BuildTree( oTree )

   local oMenu := Array( 2 ), oSubMenu := Array( 3 )

   oMenu[ 1 ]:= oTree:Add( "Principal" )
      oSubMenu[ 1 ]:= oMenu[ 1 ]:Add( "Imprimir..." )
      oSubMenu[ 1 ]:SetCheck( .T. )

   oMenu[ 2 ]:= oTree:Add( "Proyectos" )
      oSubMenu[ 2 ]:= oMenu[ 2 ]:Add( "Definir Proyectos" )
      oSubmenu[ 3 ]:= oMenu[ 2 ]:Add( "Actualización datos" )

   oTree:Expand()

return nil

function CheckStatus( oTree, aItems )

   local n

   for n = 1 to Len( aItems )
      MsgInfo( oTree:GetCheck( aItems[ n ] ) )
      CheckStatus( oTree, aItems[ n ]:aItems )
   next

return nil      
   
   
 

Re: dialog with tree and other dialog

Posted: Sun Feb 20, 2022 5:10 pm
by Antonio Linares
Dear Silvio,

It seems as testtre2.prg is a better example to start with as a template

Image

Re: dialog with tree and other dialog

Posted: Sun Feb 20, 2022 5:34 pm
by Silvio.Falconi
Antonio,
it is on Window I think