Create a dialog with section

Create a dialog with section

Postby Silvio.Falconi » Sat Apr 08, 2017 3:15 pm

I wish create a dialog as this with 5 section

Image

I tried to create 4 tpanel but not run ok
Someone can help me 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: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a dialog with section

Postby cnavarro » Sat Apr 08, 2017 3:51 pm

Silvio
In samples: Fivedit.prg you have sample

Image
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: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Create a dialog with section

Postby Silvio.Falconi » Sat Apr 08, 2017 4:20 pm

Cristobal I made it many year ago and not was as fiveedit prg
I remember there was 5 tpanel and 3 splitter
But I not remember where I put the test
it was simply
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: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a dialog with section

Postby Silvio.Falconi » Sun Apr 09, 2017 10:27 am

I made a small test
But I not Understood How make the 4th section at right because I not Understood with parameter I can set
for this sample I use customer.dbf and test.dbf you can found on samples folder

What I wish :
2 exploerbar one at left and one at right
on the middle 2 xbrowse one on top and one on down

the test

Code: Select all  Expand view

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




STATIC  oWnd,oBar,oDlg
static oSplit1,oSplit2,oSplit3
static oExBar,oExBar1

function Main()


   DEFINE WINDOW oWnd TITLE "Simply Test ExplorerBar  two browse, tab, and splitters"  ;
      MENU BuildMenu()

    DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2007

   oWnd:bResized := {|| ResizeWndMain() }

   ACTIVATE WINDOW oWnd maximized on init Test()

return nil




function BuildMenu()

   local oMenu

   MENU oMenu  2007
      MENUITEM "Test"
      MENU
         MENUITEM "Go Test "
      ENDMENU
      oMenu:AddMdi()
   ENDMENU

   return oMenu




function test()
Local oDlg
Local oGrid2
Local oGrid3
Local nSplit :=220
local aClient

lOCAL nGridBottom, nGridRight

local oTab



// create the dialog into oWnd
 aClient := GetClientRect (oWnd:hWnd )


 DEFINE DIALOG oDlg

  oDlg:nTop    = oBar:nHeight-1
  oDlg:nLeft   = 0
  oDlg:nBottom = aClient[3] - 1
  oDlg:nRight  = aClient[4]
  oDlg:nStyle  = nOR( WS_CHILD, 4 )
  nGridBottom := (oDlg:nBottom / 2) - oBar:nHeight
  nGridRight  := (oDlg:nRight / 2 )

   // oWnd:oClient := oDlg



  @0,0 EXPLORERBAR oExBar of  oDlg  SIZE nSplit-2, oDlg:nBottom


// open first xbrowse


  SELECT 1

   USE Customer ALIAS CU



   oGrid2 := TXBrowse():New( oDlg )
   oGrid2:nTop    := 00
   oGrid2:nLeft   := nSplit+2
   oGrid2:nBottom := 200
   oGrid2:nRight  :=600// nGridRight



   oCol = oGrid2:AddCol()
   oCol:bStrData = { || CU->First }
   oCol:cHeader = "First"




   oGrid2:cAlias :=CU->(Alias())
   oGrid2:SetRDD()
   oGrid2:CreateFromCode()



   //create the Tabs

     @  oGrid2:nBottom, oGrid2:nLeft TABS oTab ;
     OPTION 1 SIZE oWnd:nWidth()-80, 12 PIXEL OF oDlg ;
     ITEMS ' First ', ' Last ';
     ACTION ( nOrder := oTab:nOption  ,;
              CU->(DbSetOrder(nOrder)),;
              CU->(DbGoTop())         ,;
              oGrid2:Refresh(.t.)    )







   // open second xbrowse


SELECT 2
USE TEST ALIAS TEST

   oGrid3 := TXBrowse():New( oDlg )
  // oGrid3:nTop    :=   oGrid2:nBottom+5
   oGrid3:nTop    :=   oTab:nbottom+5
   oGrid3:nLeft   :=   nSplit+2
   oGrid3:nBottom :=    nGridBottom
   oGrid3:nRight  := 600//nGridRight

   oGrid3:cAlias :=TEST->(Alias())
   oGrid3:SetRDD()
   oGrid3:CreateFromCode()



       // the secon explorerbar at right
      @ 0,oGrid3:nright EXPLORERBAR oExBar1 of  oDlg  SIZE nSplit-2, oDlg:nBottom




//First splitter

  @ oTab:nbottom+2, nSplit SPLITTER oSplit2 ;
                 HORIZONTAL  ;
                  COLOR CLR_RED ;
                   PREVIOUS CONTROLS oGrid2,oTab ;
                   HINDS CONTROLS oGrid3 ;
                    SIZE  oGrid3:nRight, 2 PIXEL ;
                   OF oDlg ;
                   _3DLOOK ;
                 UPDATE





// second  Splitter

   @ 00, nSplit SPLITTER oSplit1 ;
      VERTICAL ;
       COLOR CLR_BLUE ;
      PREVIOUS CONTROLS oExBar;
      HINDS CONTROLS oGrid2, oGrid3, oSplit2,oTab;
      SIZE 1, nGridBottom PIXEL ;
      OF oDlg ;
      _3DLOOK ;
      UPDATE


     @ 00,oGrid2:nright SPLITTER oSplit3 ;
      VERTICAL ;
       COLOR CLR_BLUE ;
      PREVIOUS CONTROLS oGrid2, oGrid3, oSplit1,oTab;
      HINDS CONTROLS oExBar1;
      SIZE 1, nGridBottom PIXEL ;
      OF oDlg ;
      _3DLOOK ;
      UPDATE






   ACTIVATE DIALOG oDlg NOWAIT;
   ON INIT (ExplBarInit( oExBar ),;
            ExplBarInit( oExBar1 )) ;
   ON PAINT ( oSplit1:AdjClient())//,oSplit2:AdjClient(),oSplit3:AdjClient() )   //???



return nil






Function ResizeWndMain()
   local aClient
   if oDlg != NIL
      aClient := GetClientRect (oWnd:hWnd )
      oDlg:SetSize( aClient[4], aClient[3] - oWnd:oBar:nHeight - oWnd:oMsgBar:nHeight )
      // oApp():oDlg:Move(oApp():oDlg:nYMove,)
      oDlg:Refresh()
      SysRefresh()
   endif
return NIL






function ExplBarInit( oExBar )

   local oPanel1, oPanel2, oPanel3, oPanel4
   local bClick := { | o | MsgInfo( o:GetText() ) }

   oPanel1 = oExBar:AddPanel( "One", "people" )
   oPanel1:lSpecial = .T.
   oPanel1:AddLink( "First item", bClick, "additem" )
   oPanel1:AddLink( "Second item", bClick, "copy" )
     
   oPanel2 = oExBar:AddPanel( "Two", "case" )
   oPanel2:AddLink( "First item", bClick, "adddbf" )
   oPanel2:AddLink( "Second item", bClick, "delete" )
   oPanel2:AddLink( "Third item", bClick, "envelope" )
   oPanel2:AddLink( "Fourth item", bClick, "envelope" )

   oPanel3 = oExBar:AddPanel( "Three", "graphics" )
   oPanel3:AddLink( "First item", bClick, "adddbf" )
   
   oPanel4 = oExBar:AddPanel( "Four" )
   oPanel4:AddLink( "First item", bClick, "copy" )
   oPanel4:AddLink( "Second item", bClick, "additem" )

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: 6768
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests