FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TCFOLDEREX
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
TCFOLDEREX
Posted: Mon Oct 06, 2014 06:58 AM

Hello
when I compile I have this error.

Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_TCFOLDEREX' referenced from C:\EASYREPORT4\OBJ\ERTOOLS.OBJ

Regards
MAurizio

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TCFOLDEREX
Posted: Mon Oct 06, 2014 07:14 AM
Look de repository
.\source\TCFoldex.prg

Add in ereport.mak

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

//
// TCFolderEx -> Cristobal Navarro:   - 28/09/2014 -  Primera implementacion
//

#define CLRTEXT           RGB(  21,  66, 139 )
#define DEFAULT_GUI_FONT  17
#define COLOR_GRAYTEXT    17
#define LAYOUT_TOP        1
#define LAYOUT_LEFT       2
#define LAYOUT_BOTTOM     3
#define LAYOUT_RIGHT      4

/*
#define CLRTEXT             RGB(  21,  66, 139 )
#define WM_MOUSELEAVE       0x2A3 //675
#define TME_LEAVE           0x2   //2
#define DEFAULT_GUI_FONT    17

#define TXTLPAD              15
#define TXTRPAD               5
#define COLOR_GRAYTEXT       17
#define DT_VCENTER            4
#define DT_SINGLELINE        32
#define DT_CENTER             1
#define VTA_BASELINE         24
#define VTA_CENTER            6


#define LAYOUT_TOP     1
#define LAYOUT_LEFT    2
#define LAYOUT_BOTTOM  3
#define LAYOUT_RIGHT   4
/*
#define AL_LEFT   0
#defiNE AL_RIGHT  1
#define AL_CENTER 2
*/
/*
#define BMP_HANDLE 1
#define BMP_WIDTH  2
#define BMP_HEIGHT 3
*/

static aLayouts := { "TOP", "LEFT", "BOTTOM", "RIGHT" }


CLASS TCFolderEx FROM TFolderEx

   CLASSDATA lRegistered AS LOGICAL

   METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, aBitmaps, lPixel,;
               lDesign, aPrompts, nFolderHeight, ;
               aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
               lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
               cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont,;
               lTransparent, aDialogs ) CONSTRUCTOR

ENDCLASS


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

METHOD New( nTop, nLeft, nWidth, nHeight, oWnd, aBitmaps, lPixel,;
            lDesign, aPrompts, nFolderHeight, ;
            aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
            lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
            cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont,;
            lTransparent, aDialogs  ) CLASS TCFolderEx

   LOCAL n, oDlg, nLastRow, nLen, aRect, hRgn, aFontINfo

   DEFAULT nTop     := 0, nLeft := 0,;
           oWnd     := GetWndDefault(),;
           lPixel   := .F.,;
           lDesign  := .f.,;
           nWidth   := 300, nHeight := 200,;
           aPrompts := { { "One", "Two", "Three" } },;
           nFolderHeight := 25,;
           nRound   := 3,;
           bClrTabs := {| o, n | ::SetFldColors( o, n ) },;
           bClrText := {| o, n | If( ::aEnable[ n ], CLRTEXT, GetSysColor( COLOR_GRAYTEXT ) ) },;
           lAdjust  := .F.,;
           nSeparator := 3,;
           nOption  := 1,;
           lStretch := .F.,;
           cLayout  := "TOP",;
           nBright  := 0,;
           lAnimate := .F.,;
           nSpeed   := round( 30 / ( GetCPUSpeed() / 3000 ), 0 ),;
           oFont    := NIL,;      //-->> byte-one 2010
           lTransparent := .F.,;
           aDialogs := {}

   ::nStyle    = nOR( WS_CHILD, WS_VISIBLE, WS_CLIPCHILDREN, WS_TABSTOP )
   ::nId       = ::GetNewId()
   ::oWnd      = oWnd
   ::nTop      = If( lPixel, nTop, nTop * SAY_CHARPIX_H )
   ::nLeft     = If( lPixel, nLeft, nLeft * SAY_CHARPIX_W )
   ::nBottom   = ::nTop + nHeight - 1
   ::nRight    = ::nLeft + nWidth - 1
   ::lDrag     = lDesign
   ::lCaptured = .f.
   ::nSeparator = nSeparator
   ::nLastOver = 0
   ::nOption   = nOption
   ::nOver     = 0
   ::nFolderHeight = nFolderHeight
   ::nRound   = nRound
   ::lWorking = .F.
   ::lAdjust  = lAdjust
   ::lStretch = lStretch
   ::nBright  = nBright
   ::lAnimation = lAnimate
   ::nSpeed     = nSpeed
   ::nBmpTopMargin = 0
   ::nOverBmp = 0
   ::bAction  = bAction
   ::bBmpAction = bBmpAction
//   ::oFont = oFont      //-->> byte-one 2010
   ::nLayOut = AScan( aLayouts, cLayout )
   ::lTransparent = lTransparent

   ::SetDefColors()

   ::Register()

   if ! Empty( oWnd:hWnd )
      ::Create()
      oWnd:AddControl( Self )
   else
      oWnd:DefControl( Self )
   endif

   if lDesign
      ::CheckDots()
   endif

   ::aDialogs    = {}
   ::aEnable     = {}
   ::aPos        = {}
   ::aVisible    = {}
   ::aPrompts    = CheckArr( aPrompts )
   ::aOrder      = {}
   ::aLines      = {}

   nLen = Max( Len( ::aPrompts ), Len( aDialogs ) )

   if aAlign == NIL
      aAlign = Array( nLen )
   endif

   if aHelps == NIL
      aHelps = Array( nLen )
   endif

   if aBitmaps == NIL
      aHelps = Array( nLen )
   endif

   ::aVisible   = Array( nLen )
   ::aEnable    = Array( nLen )

   AFill( ::aVisible, .T. )
   AFill( ::aEnable, .T. )


//#ifdef OLDCODE   // upto FWH 14.06 : Modified on 2014-07-25
   if !OldCode( 14.06 )

      // verify font by user
      if oFont == nil
         // verify font by parent
         if ::oWnd:oFont == nil
            oFont := TFont():New()
            oFont:hFont := GetStockObject( DEFAULT_GUI_FONT )
            aFontInfo = GetFontInfo( oFont:hFont )
          else
            aFontInfo := GetFontInfo( ::oWnd:oFont:hFont )
          endif
      else
          aFontInfo := GetFontInfo( oFont:hFont )
      endif

      if ::nLayOut == LAYOUT_RIGHT .OR. ::nLayOut == LAYOUT_LEFT
         if hb_isObject( oFont ) // oFont is external and user provided
            oFont:end()          // This font should not :End() here  2014-07-25
         endif
         DEFINE FONT oFont NAME aFontInfo[ 4 ] ;
             SIZE aFontInfo[ 2 ], aFontInfo[ 1 ] NESCAPEMENT 900 * If( ::nLayOut == LAYOUT_RIGHT, -1, 1 )
      else
         DEFINE FONT oFont NAME aFontInfo[ 4 ] ;
             SIZE aFontInfo[ 2 ], aFontInfo[ 1 ]
      endif

      ::SetFont( oFont )
      oFont:End()
   else
//#else

      if oFont == nil
         ::GetFont()
      else
         ::SetFont( oFont )
      endif
      if ::nLayOut == LAYOUT_RIGHT .OR. ::nLayOut == LAYOUT_LEFT
         oFont    := ::oFont:Escapement( If( ::nLayOut == LAYOUT_RIGHT, 2700, 900 ) )
         ::SetFont( oFont )
         oFont:End()
      endif

   endif
//#endif

   if ::lTransparent
      if ::oWnd:oBrush != NIL
         ::SetBrush( ::oWnd:oBrush )
      else
         ::oBrush = TBrush():New( , ::oWnd:nClrPane )
      endif
   else
      ::oBrush = TBrush():New( , CLR_WHITE )
   endif

   ::nFolderHeight := max( ::nFolderHeight, ::oFont:nHeight * 1.2 )

   ::bClrTabs  = bClrTabs
   ::bClrText  = bClrText
   ::aAlign    = CheckArr( aAlign )
   ::aHelps    = CheckArr( aHelps )
   ::bPopUp    = bPopUp

   ::aDialogs = Array( nLen )
   ::aBitmaps = {}
   ::aBrightBmp = {}
   ::LoadBitmaps( aBitmaps )

   if empty( aDialogs )

      for n = 1 to nLen

         DEFINE DIALOG oDlg OF Self ;
         STYLE nOR( WS_CHILD, ;
         If( (!::oWnd:IsKindOf( "TDIALOG") .and. !::oWnd:IsKindOf( "TPANEL")),;
         WS_CLIPCHILDREN, 0 ) );
         FROM 0, 1 TO ::nHeight(), ::nWidth() PIXEL ;
         FONT ::oWnd:oFont ;
         HELPID If( Len( ::aHelps ) >= n , ::aHelps[ n ] , NIL )

         oDlg:SetBrush( ::oBrush )
         ::aDialogs[ n ] := oDlg

         oDlg:cVarName := "Page" + AllTrim( Str( n ) )
         oDlg:Hide()
         oDlg:lTransparent := .T.

      next n

   else
      // Usar Dialogos en RC en un Folder creado por c�digo
      // En pruebas

      ::aDialogs  = CheckArr( aDialogs )

      for n = 1 to len( ::aDialogs )
         DEFINE DIALOG oDlg OF Self RESOURCE ::aDialogs[ n ] PIXEL;
            FONT ::oWnd:oFont ;
            HELPID If( Len( ::aHelps ) >= n , ::aHelps[ n ] , NIL ) ;
            BRUSH ::oBrush // STYLE WS_CHILD

         ::aDialogs[ n ] := oDlg

         oDlg:cVarName := "Page" + AllTrim( Str( n ) )
         oDlg:Hide()
         oDlg:lTransparent := .T.

      next n

   endif

   if ::hWnd != 0
      ::UpdateRegion()
   endif

   if ! Empty( oWnd:hWnd )
     ::Default()
   endif

   if lDesign
      ::CheckDots()
   endif

   SetWndDefault( oWnd )

return Self

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

Static Function OldCode( nVersion )
RETURN IF(  nFwVersion() <  nVersion, .F., .T. )

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

static function CheckArr( aArray )

   if ValType( aArray ) == 'A' .and. ;
      Len( aArray ) == 1 .and. ;
      ValType( aArray[ 1 ] ) == 'A'

      aArray   := aArray[ 1 ]
   endif

return aArray

//----------------------------------------------------------------------------//
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: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: TCFOLDEREX
Posted: Mon Oct 06, 2014 10:30 AM

Thanks
Maurizio

Posts: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: TCFOLDEREX
Posted: Thu Oct 09, 2014 06:48 AM

Cristobal,

¿Que problema querías solucionar con tus cambios?

Es que como sabrás, he modificado la clase para que refresque bien con resize y puede que tenga algo que ver con lo tuyo.

Un Saludo,

Joaquín Martínez
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TCFOLDEREX
Posted: Thu Oct 09, 2014 04:09 PM

Joaquin, es posible que estén relacionados
No he tenido tiempo de valorarlo
Ya te comento

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: TCFOLDEREX
Posted: Thu Oct 09, 2014 08:38 PM
jmartial wrote:Cristobal,

¿Que problema querías solucionar con tus cambios?

Es que como sabrás, he modificado la clase para que refresque bien con resize y puede que tenga algo que ver con lo tuyo.


Joaquin, entiendo el objetivo de tus cambios pero no soluciona el problema al que nos enfrentamos para adoptar esta solucion
En el desarrollo de Easyreport al crear los FolderEx en la pantalla inicial, si pruebas los siguiente lo comprobaras (line 167 Function Main de EReport.prg)
Estado actual
Code (fw): Select all Collapse
      if lValidFwh()

       @ 0.2, 1 CFOLDEREX oER:oFldI ;
       PROMPT GL("&Report Settings"), GL("&Items"), GL("Colors"), GL("Fonts") ;
       OF oEr:oPanelI ; //oEr:oMainWnd ;
       SIZE Int(GetSysMetrics( 0 )/4), GetSysMetrics( 1 ) - 138 ;    //326  
       OPTION 2 ;
       TAB HEIGHT 34 ;
       BITMAPS { "B_EDIT16", "B_ITEMLIST16", "B_ITEMLIST16", "B_EDIT2" } ;
       PIXEL ;
       SEPARATOR 0

.../...


Pruebalo con la clase original o con tus modificaciones

Code (fw): Select all Collapse
      if lValidFwh()

       @ 0.2, 1 FOLDEREX oER:oFldI ;
       PROMPT GL("&Report Settings"), GL("&Items"), GL("Colors"), GL("Fonts") ;
       OF oEr:oPanelI ; //oEr:oMainWnd ;
       SIZE Int(GetSysMetrics( 0 )/4), GetSysMetrics( 1 ) - 138 ;    //326   //       OPTION 2 ;
       TAB HEIGHT 34 ;
       BITMAPS { "B_EDIT16", "B_ITEMLIST16", "B_ITEMLIST16", "B_EDIT2" } ;
       PIXEL ;
       SEPARATOR 0

     .../...


Comprobarás que los controles (Gets, etc) no aparecen completamente hasta no pasar el raton por encima (quita la claúsula OPTION 2).
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: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: TCFOLDEREX
Posted: Thu Oct 09, 2014 09:28 PM

Hola Cristobal,

No entiendo muy bien a qué te refieres.

¿Has probado mis cambios sin quitar OPTION 2 a ver si te funciona?

Creo que el repintado que hago, debería solucionar tú problema.

No obstante, mis modificaciones hacen un parpadeo del diálogo, cuando pasas el ratón desde una pestaña al diálogo, es decir, movimiento de la pestaña hacia abajo.

Este tema me tiene desesperado.

Un Saludo,

Joaquín Martínez
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TCFOLDEREX
Posted: Thu Oct 09, 2014 09:35 PM

Si, lo he probado con tus modificaciones tal cual, y no funciona en mi caso (he de añadir el "TPANEL" en esa linea de la clase)
Lo has probado tu segun las indicaciones que te he comentado?
Lo del parpadeo, lo he notado

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: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: TCFOLDEREX
Posted: Thu Oct 09, 2014 10:27 PM

Cristobal,

¿ Para qué sirve y por qué necesitas TPanel ?

Un Saludo,

Joaquín Martínez
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TCFOLDEREX
Posted: Fri Oct 10, 2014 08:45 PM

Una de las "Manías" que cada uno tiene?, puede ser (por cierto, estaría bien abrir un hilo en el que comentar estas manías que cada uno tenemos)
Bueno, te comento: no me gusta diseñar sobre la ventana directamente o sobre dialogos por si, sobre todo en tiempo de diseño y pruebas, tengo que hacer cambios. Sólo cambio el oParent del TPanel y como mucho las coordenadas del mismo, sin tener que modificar las coordenadas de los controles ( o sea, me gusta usarlos como "contenedor").
Ah! y que también existe la clase TScrollPanel
No me gustan los diálogos (titulos y demas), como ves, "manias"

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: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: TCFOLDEREX
Posted: Fri Oct 10, 2014 11:13 PM

Hola Cristobal,

Me podrías poner un trozo de còdigo de ejemplo del uso de tpanel como contenedor?

Gracias,

Un Saludo,

Joaquín Martínez
Posts: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: TCFOLDEREX
Posted: Fri Oct 10, 2014 11:15 PM

Por cierto, se me ovidaba.

Como lo redimensionas para ajustarte a los diferentes monitores actuales?

Un Saludo,

Joaquín Martínez
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TCFOLDEREX
Posted: Sat Oct 11, 2014 05:23 AM
jmartial wrote:Hola Cristobal,

Me podrías poner un trozo de còdigo de ejemplo del uso de tpanel como contenedor?

Gracias,


En la funcion Main de EasyReport lo estamos usando ( a la derecha y a la izquierda )

Aqui podrás ver como los uso
viewtopic.php?f=17&t=28974&start=15#p163429
y una imagen vale mas que mil palabras
viewtopic.php?f=17&t=28974#p163056

En esas clases (de los ejemplos de los enlaces anteriores) hay dos funciones que utilizo para tomar referencias del Tipo de monitor y resolucion
En el foro he visto una funcion Display que creo que realiza esta tarea de redimensionamiento adecuadamente.

-------------------------------- EDITADO --------------------------------
Sin olvidar la magnifica clase TLayout de Daniel
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

Continue the discussion