FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Fwh19.05 - New Class TDockPnel
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Tue Oct 06, 2020 05:47 PM
Use TScrollPanel in your control windows

Code (fw): Select all Collapse
#include "Fivewin.ch"

Static aRes 
Function Main()

   local oWnd
   local nRow := 2
   local nCol := 2
   local nWAlto  := 760
   local nWAncho := 1360
   local oPanel

   aRes := { GetSysMetrics(0), GetSysMetrics(1) }
   DEFINE WINDOW oWnd FROM nRow, nCol TO nWAlto + nRow, nWAncho + nCol ;
             PIXEL TITLE "Movimentos do Dia "+Dtoc( Date() ) ; //MENU oMenu ;
             COLOR CLR_WHITE, Rgb( 182, 182, 182 ) // VSCROLL //NOSYSMENU //NOZOOM //NOMINIMIZE
         
//         CreateDocks(oWnd)
        oPanel := TScrollPanel() : New( 1, 1, oWnd:nHeight, oWnd:nWidth, oWnd, .f. )
        oPanel:SetColor( , CLR_WHITE )

   
   ACTIVATE WINDOW oWnd MAXIMIZED ON INIT ( CreateDocks( oPanel ), oPanel:SetRange() )


Return nil

STATIC FUNCTION  CreateDocks(oWnd)
LOCAL aPos:={},oFnt,oDock[4]

    DEFINE FONT oFnt NAME "CALIBRI" SIZE 0,-16

    Aadd(aPos,{ 014, 005, 370, 278 } )
    Aadd(aPos,{ 014, 300, 360, aRes[1] - 10 } )
    Aadd(aPos,{ 390, 300, aRes[2]/3 + 390, aRes[1] - 10 + 300 } )

    oDock[1]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[1]
        :SetCoors( aPos[1,1], aPos[1,2], aPos[1,3], aPos[1,4] )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Calendário" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 1 ) } )
        :Activate()
    END
   
    oDock[2]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[2]
        :SetCoors( aPos[2,1], aPos[2,2], Int( aRes[ 1 ] / 6 ), aPos[2,4] - if( oWnd:WinStyle( WS_VSCROLL ), 20, 0 ) )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Autorizações" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 2 ) } )
        :Activate()
    END  

    oDock[3]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[3]
      :SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10, o ) }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nLeft, o ) }, ;// { | o | Int( 2 * aRes[ 1 ] / 6 ) + 20 }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nRight, o ) } )
      //  :SetCoors( aPos[3,1], aPos[3,2], aPos[3,3], aPos[3,4] )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Faturamento" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 3 ) } )
        :Activate()
    END  

   oDock[4]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[4]
         :SetCoors( { | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10, o ) }, ;        
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nLeft, o ) }, ; //  { | o | Int( 3 * aRes[ 1 ] / 6 ) + 30 }, ;
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nRight, o ) } )                  
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Baixas" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 4 ) } )
        :Activate()
    END
    oFnt:End()

RETURN nil

STATIC FUNCTION DefDialog( oP, nT, nL, nH, nW, nD )
   LOCAL oCol,k,oLbx[3]
   local aData := {  { "JAN", 1000, 1200,  900,  400,  700,  400 },  ;
                     { "FEB", 1100, 1300, 1000,  500,  800,  500 },  ;
                     { "MAR", 1050, 1800, 1900,  700, 1400, 1600 },  ;
                     { "APR", 1825, 1975, 1850,  675, 1100, 1425 },  ;
                     { "MAY", 2000, 1670, 1550,  675, 1100, 1425 },  ;
                     { "JUN", 0970, 1025, 1100,  675, 1100, 1425 },  ;
                     { "JUL", 1150, 1600, 1750,  675, 1100, 1425 },  ;
                     { "AUG", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "SEP", 1150, 1320, 1450,  675, 1100, 1425 },  ;
                     { "OCT", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "NOV", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "DEC", 1250, 1700, 1850,  675, 1100, 1425 }   ;
                  }

RETURN nil


Please wait, there is another additional possibility which is the one that I usually use.
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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Tue Oct 06, 2020 05:55 PM
vilian wrote:Did you reduce the height of tDockPnel 2,3 and 4 ? In can't reduce the height of Tdockpnel. I must scroll the windows to see those tdockpnel that doesn't fit in the window.
What is the screeen's resolution of your windows ? Please, decrease it and try again.


Vilian, I know this, not worry
They were an example of how to fit several dockpnels to the container window. I know it has nothing to do with the problem you were asking me
My sample is run in 1365 x 768
Wait
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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 10:02 AM
Look my sample

Code (fw): Select all Collapse
#include "Fivewin.ch"

Static aRes 
Static oDock0

Function Main()

   local oWnd
   local nRow := 2
   local nCol := 2
   local nWAlto  := 760
   local nWAncho := 1360
   local oPanel

   aRes := { GetSysMetrics(0), GetSysMetrics(1) }
   DEFINE WINDOW oWnd FROM nRow, nCol TO nWAlto + nRow, nWAncho + nCol ;
             PIXEL TITLE "Movimentos do Dia "+Dtoc( Date() ) ;
             COLOR CLR_WHITE, Rgb( 182, 182, 182 ) STYLE WS_POPUP
         
   ACTIVATE WINDOW oWnd MAXIMIZED ON INIT ( CreaDocks0( oWnd ) )


Return nil

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

Function CreaDocks0( oWnd )

   oDock0  := TDockPnel():New( oWnd )
   WITH OBJECT oDock0

      :SetHeightCaption( 40 )
      :SetBorderSize( 1 )
      :SetCoors( { | o | 2 }, ;
                 { | o | 2 }, ;
                 { | o | o:oWnd:nBottom - o:oWnd:nTop  - 2 }, ;
                 { | o | o:oWnd:nRight  - o:oWnd:nLeft - 2 } )
      :SetCaption( { | o | "Test TDockPanel Class  - " + FWVERSION + " -" } )
      //:SetPosTitle( .T. )  // Title at bottom
      :SetStyle( 30 )
      :SetModeHorz( 2 )  // TScrollPanel
      :SetImgsFiles( { { 57678, { | o | MyPopupMnu( o ) }, } } )
      :SetCtrlsPnel( { | o, nT, nL, nH, nW | CreateDocks( o ) } )

      :Activate()
   END

Return oDock0

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

Function MyPopupMnu( o )

   local oMnu
   local nRow  := o:nTop  + Int( o:nHeight / 2 ) 
   local nCol  := o:nLeft + Int( o:nWidth / 2 ) 

   MENU oMnu POPUP 2013 ;
      COLORSELECT METRO_STEEL, METRO_STEEL, CLR_WHITE ;
      COLORMENU CLR_WHITE, CLR_BLUE ;
      COLORSEPARATOR METRO_STEEL ;
      COLORLEFT CLR_WHITE

      MENUITEM "Info" ACTION MsgInfo( o:ClassName() )
      MENUITEM "Exit" ACTION o:oWnd:oWnd:End()

   ENDMENU
   ACTIVATE MENU oMnu AT nRow, nCol OF o:oWnd

Return oMnu

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

STATIC FUNCTION  CreateDocks(oWnd)
    LOCAL aPos:={},oFnt,oDock[4]

    DEFINE FONT oFnt NAME "CALIBRI" SIZE 0,-16

    Aadd(aPos,{ 014, 005, 370, 278 } )
    Aadd(aPos,{ 014, 300, 360, aRes[1] - 10 } )
    Aadd(aPos,{ 390, 300, aRes[2]/3 + 390, aRes[1] - 10 + 300 } )

    oDock[1]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[1]
        :SetCoors( aPos[1,1], aPos[1,2], aPos[1,3], aPos[1,4] )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Calendário" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 1 ) } )
        :Activate()
    END
   
    oDock[2]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[2]
        :SetCoors( aPos[2,1], aPos[2,2], Int( aRes[ 1 ] / 6 ), aPos[2,4] - if( oWnd:WinStyle( WS_VSCROLL ), 20, 0 ) )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Autorizações" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 2 ) } )
        :Activate()
    END  

    oDock[3]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[3]
      :SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10, o ) }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nLeft, o ) }, ;// { | o | Int( 2 * aRes[ 1 ] / 6 ) + 20 }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
                 { | o | XEval( o:oWnd:aControls[ 2 ]:nRight, o ) } )
      //  :SetCoors( aPos[3,1], aPos[3,2], aPos[3,3], aPos[3,4] )
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Faturamento" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 3 ) } )
        :Activate()
    END  

   oDock[4]  := TDockPnel():New( oWnd )
    WITH OBJECT oDock[4]
         :SetCoors( { | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10, o ) }, ;        
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nLeft, o ) }, ; //  { | o | Int( 3 * aRes[ 1 ] / 6 ) + 30 }, ;
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
                    { | o | XEval( o:oWnd:aControls[ 3 ]:nRight, o ) } )                  
        :SetHeightCaption( 40 )
        :SetBorderSize( 4 )
        :SetCaption( "Baixas" )
        :SetColors( CLR_WHITE, METRO_OLIVE, , )
        :SetFont( oFnt )
        :cAlignText  := "CC"
        :SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog(  o, nT, nL, nH, nW, 4 ) } )
        :Activate()
    END

    oFnt:End()

RETURN nil


STATIC FUNCTION DefDialog( oP, nT, nL, nH, nW, nD )
   LOCAL oCol,k,oLbx[3]
   local aData := {  { "JAN", 1000, 1200,  900,  400,  700,  400 },  ;
                     { "FEB", 1100, 1300, 1000,  500,  800,  500 },  ;
                     { "MAR", 1050, 1800, 1900,  700, 1400, 1600 },  ;
                     { "APR", 1825, 1975, 1850,  675, 1100, 1425 },  ;
                     { "MAY", 2000, 1670, 1550,  675, 1100, 1425 },  ;
                     { "JUN", 0970, 1025, 1100,  675, 1100, 1425 },  ;
                     { "JUL", 1150, 1600, 1750,  675, 1100, 1425 },  ;
                     { "AUG", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "SEP", 1150, 1320, 1450,  675, 1100, 1425 },  ;
                     { "OCT", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "NOV", 1250, 1700, 1850,  675, 1100, 1425 },  ;
                     { "DEC", 1250, 1700, 1850,  675, 1100, 1425 }   ;
                  }

RETURN nil
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 10:39 AM

Cristobal,
When I try your sample there is happening this error: Error BASE/1004 Message not found: TDOCKPNEL:SETMODEHORZ
I'm Using FWH May/2020.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 11:37 AM
vilian wrote:Cristobal,
When I try your sample there is happening this error: Error BASE/1004 Message not found: TDOCKPNEL:SETMODEHORZ
I'm Using FWH May/2020.


Ok, look your mail, and tell me what you think of this version.
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 11:50 AM

Now it's almost perfect :)
I need only one more thing. How could I add a button/option to minimize the oDock0 ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 03:14 PM
In function MenuPopup add


//
MENUITEM "Minimize" ACTION o:Minimize() // oWindow:Minimize // So oWindow is object window principal and static variable
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 04:57 PM
is possible add Images on the right side, like the bellow?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 11:06 PM

Puedes poner uno o varios botones a la izquierda o a la derecha pero no en ambos ( de momento )

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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Wed Oct 07, 2020 11:59 PM

How could I do this ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Thu Oct 08, 2020 12:13 AM
vilian wrote:How could I do this ?


Code (fw): Select all Collapse
      //:SetImgsFiles( { { "..\bitmaps\16x16\min.bmp", { | o | MyPopupMnu( o ) }, }, { "..\bitmaps\16x16\max.bmp", { | o | MsgInfo( "Otro" ) }, } } )
      :SetImgsFiles( { { 57678, { | o | MyPopupMnu( o ) }, }, { 57656, { | o | MsgInfo( "Otro" ) }, } } )
      // :lLeftImgs  := .F.       // Align to right
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Thu Oct 08, 2020 10:47 AM

Thank you Cristobal ;)

Where could I know the list of these image codes ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Thu Oct 08, 2020 12:32 PM
vilian wrote:Thank you Cristobal :-)

Where could I know the list of these image codes ?


Look UISYMBOL.PRG in SAMPLES folder
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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Fwh19.05 - New Class TDockPnel
Posted: Thu Oct 08, 2020 12:55 PM

Thank You Very Much!

TDockPnel is amazing and your support too.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: Fwh19.05 - New Class TDockPnel
Posted: Thu Nov 04, 2021 11:48 PM

hola
Como hago para que los paneles no se puedan mover? si adaptar a la ventana pero no moverse por toda la ventana

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/