Harbour 3.0

Re: Harbour 3.0

Postby Patricio Avalos Aguirre » Thu Sep 08, 2011 8:13 pm

Estimados

Estoy pasandome a harbour bajado de las utilidades de fw
Code: Select all  Expand view

Harbour Build Info
---------------------------
Version: Harbour 3.1.0dev (Rev. 17025)
Compiler: Borland C++ 5.8.2 (32-bit)
Platform: Windows 7 6.1.7601 Service Pack 1
PCode version: 0.3
ChangeLog last entry: 2011-08-30 12:30 UTC+0200 Przemyslaw Czerpak (druzus/at
iv.onet.pl)
ChangeLog ID: ChangeLog 17025 2011-08-30 10:30:47Z druzus
Built on: Aug 31 2011 13:19:44
Build options: (Clipper 5.3b) (Clipper 5.x undoc)
---------------------------


estoy tratando de compilar twbrowse1.5 de hernan pero me arroja errorres

lo estoy haciendo de esta manera
Code: Select all  Expand view
%bcdir%\bcc32 -O2 -c -D__HARBOUR__ -Lc:\fwh\lib;c:\harbour\lib;c:\borland\bcc582\lib -Ic:\borland\bcc582\include;c:\fwh\include;c:\harbour\include source\wbrwline.c > comp.log


Code: Select all  Expand view
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
source\WBRWLINE.C:
Error E2451 source\WBRWLINE.C 387: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 399: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 412: Undefined symbol 'hb_symEval' in function PaintTheLine
Warning W8065 source\WBRWLINE.C 748: Call to function 'ISLOG' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 758: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 770: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 822: Call to function 'ISARRAY' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 825: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 826: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 828: Call to function 'ISNUM' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 830: Call to function 'ISLOG' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 831: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 832: Call to function 'ISLOG' with no prototype in function HB_FUN_WBRWLINE
Warning W8065 source\WBRWLINE.C 900: Call to function 'ISNUM' with no prototype in function HB_FUN_WBRWRECT
Warning W8065 source\WBRWLINE.C 1021: Call to function 'ISARRAY' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1029: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1037: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1169: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1170: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1172: Call to function 'ISNUM' with no prototype in function HB_FUN_WBRWPANE
Warning W8065 source\WBRWLINE.C 1174: Call to function 'ISBLOCK' with no prototype in function HB_FUN_WBRWPANE
 


esta es la linea 382

Code: Select all  Expand view
          else  // Si es Numerico Bmp no Tree, o , es Character !!!!
           {

               if ( pBkColor )  // Bloque de Color Fondo Celda
               {
                  _PutSym( _SymEval );
                  _xPushM( pBkColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lBkColorOld = SetBkColor( hDC, hb_parnl( - 1 ) ) ;
               }

               if( pTextColor ) // Bloque de Color Texto Celda
               {
                  _PutSym( _SymEval );
                  _xPushM( pTextColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lTextColorOld = SetTextColor( hDC, hb_parnl( - 1 ) ) ;
               }

               hFont = 0 ;
               if( pFont )      // Bloque de Font Celda
 



pd: es bastante trabajo cambiarse de compilador :-(
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: Harbour 3.0

Postby Antonio Linares » Thu Sep 08, 2011 11:01 pm

Patricio,

Cambia todas las llamadas a funciones IS... por HB_IS... (por ejemplo: HB_ISLOG(...) en vez de ISLOG(...)) y además añade despues de los includes:

#include "hbstack.h"
#include "hbvm.h"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.0

Postby Patricio Avalos Aguirre » Fri Sep 09, 2011 1:46 pm

Gracias antonio ahora tengo 3 errores..

Code: Select all  Expand view
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
source\WBRWLINE.C:
Error E2451 source\WBRWLINE.C 387: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 399: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 412: Undefined symbol 'hb_symEval' in function PaintTheLine
*** 3 errors in Compile ***



_PutSym( _SymEval ); LINE 387
_PutSym( _SymEval ); LINE 399
_PutSym( _SymEval ); LINE 412

Voy a colocar el archivo desde el inicio hasta el error
Code: Select all  Expand view

void * __conArrayGet( void *, void *, ... );
long __conGetNL( void *, long * );
long __conRelease( void * );

#include <Windows.h>
#ifdef __HARBOUR__
   #include <hbapi.h>
   #include <hbapiitm.h>
   #include <hbstack.h>
   #include <hbvm.h>
   // #include <hbfast.h>
   #define MoveTo( hDC, x, y ) MoveToEx( hDC, x, y, NULL )
   #define _PutSym( _SymEval ) hb_vmPushSymbol( &hb_symEval )
   #define _xPushM  hb_vmPush
   #define _PutLN   hb_vmPushLong
   #define _xEval   hb_vmDo
   #define _cEval0  hb_vmEvalBlock
   #define _Get_Sym hb_dynsymFindName
#endif

#define LOGICAL   HB_IT_LOGICAL
#define NUMERIC   HB_IT_NUMERIC
#define CHARACTER HB_IT_STRING
#define BLOCK     HB_IT_BLOCK

#define HA_LEFT    0  // by CeSoTech Alineaciones Horizontales y Verticales
#define HA_RIGHT   1
#define HA_CENTER  2
#define VA_TOP     4
#define VA_BOTTOM  8
#define VA_CENTER  32

#ifdef __FLAT__
#undef  PCLIPVAR
#define PCLIPVAR PHB_ITEM
#endif

#ifdef __XHARBOUR__
   void hb_storvni( int iValue, int iParam, int iIndex );
   long hb_parvnl( int iParam, int iIndex );
   int hb_parvni( int iParam, int iIndex );
   void hb_storvnl( LONG lValue, int iParam, int iIndex );
#endif


static far BOOL bAdjLastCol  ; // CeSoTech
static far BOOL bAdjBrowse   ; // CeSoTech
static far BOOL bDrawHeaders ; // CeSoTech
static far BOOL bDrawFooters ; // CeSoTech
static far WORD wHeaderHeight; // CeSoTech
static far WORD wFooterHeight; // CeSoTech
static far WORD wLineHeight  ; // CeSoTech

static far BOOL bWorking;

WORD WBrwRowsC( HWND hWnd, HDC hDC, HFONT hFont ); // CeSoTech

static void FW_DrawText( HDC hDC, RECT * rct, LPCSTR pText,
                         WORD wAlign, int iLen, HFONT hFont,
                         BOOL bHeadFoot ) ; // CeSoTech
static void FW_DrawBitmapCenter( HDC hDC, HBITMAP hBmp, RECT * rct, WORD nStyle, BOOL bFocused ) ;

void MaskRegion( HDC hDC, RECT * rct, COLORREF cTrColor,
                 COLORREF cBackColor );

FrameDot( HDC hDC, RECT * pRect );

extern void WndDrawBox( HDC, LPRECT, HPEN, HPEN );
extern void DrawBitmap( HDC, HBITMAP, WORD wCol, WORD wRow, WORD wWidth,
                        WORD wHeight, DWORD dwRaster );


static void near PaintTheLine( HDC hDC, RECT * rct, WORD wIndex,
                               PCLIPVAR pAtext, PCLIPVAR pAsizes,
                               HPEN hWhitePen, HPEN hGrayPen, BOOL bTree,
                               PCLIPVAR pAJustify, WORD wPressed,
                               BOOL bHeader, WORD nStyle,
                               WORD nFocus, BOOL bFocused,
                               PCLIPVAR pTextColor, PCLIPVAR pBkColor,
                               WORD wRowPos, WORD nHeightCtrl,
                               LONG nClrLine, BOOL bFooter,
                               BOOL bSelect, PCLIPVAR pFont,
                               BOOL bDrawFocusRect ) ;



void DrawMasked( HDC, HBITMAP, WORD wCol, WORD wRow );
                  // LOW    HIGH
extern int _dvtoi( DWORD, DWORD );
void MsgStr( long l );
LPSTR Str( WORD w );

#ifndef __FLAT__
   static int near GetInt( PCLIPVAR Array, WORD wIndex );
   static far PCLIPSYMBOL pSkip = 0;
#else
   static long near GetInt( void * Array, WORD wIndex );
   PHB_DYNS pSkip = NULL;
#endif

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

static void MaskRegion( HDC hdc, RECT * rct, COLORREF cTransparentColor,
                        COLORREF cBackgroundColor )

{
   HDC        hdcTemp, hdcObject, hdcBack, hdcMem;
   POINT      ptSize;
   COLORREF   cColor;
   HBITMAP    bmAndObject, bmAndBack, bmBackOld, bmObjectOld,
              bmAndTemp, bmTempOld, bmAndMem, bmMemOld;
   HBRUSH     hBrush, hBrOld;

   ptSize.x = rct->right - rct->left + 1;
   ptSize.y = rct->bottom - rct->top + 1;

   hBrush      = CreateSolidBrush(cBackgroundColor);

   hdcTemp     = CreateCompatibleDC(hdc);
   hdcObject   = CreateCompatibleDC(hdc);
   hdcBack     = CreateCompatibleDC(hdc);
   hdcMem      = CreateCompatibleDC(hdc);

   bmAndTemp   = CreateCompatibleBitmap(hdc, ptSize.x, ptSize.y);
   bmAndMem    = CreateCompatibleBitmap(hdc, ptSize.x, ptSize.y);
   bmAndObject = CreateBitmap(ptSize.x, ptSize.y, 1, 1, NULL);
   bmAndBack   = CreateBitmap(ptSize.x, ptSize.y, 1, 1, NULL);

   bmTempOld   = SelectObject(hdcTemp, bmAndTemp);
   bmMemOld    = SelectObject(hdcMem, bmAndMem);
   bmBackOld   = SelectObject(hdcBack, bmAndBack);
   bmObjectOld = SelectObject(hdcObject, bmAndObject);

   hBrOld      = SelectObject(hdcMem, hBrush);

   BitBlt(hdcTemp, 0, 0, ptSize.x, ptSize.y, hdc, rct->left, rct->top, SRCCOPY);

   SetMapMode(hdcTemp, GetMapMode(hdc));

   cColor = SetBkColor(hdcTemp, cTransparentColor);

   BitBlt(hdcObject, 0, 0, ptSize.x, ptSize.y, hdcTemp, 0, 0, SRCCOPY);

   SetBkColor(hdcTemp, cColor);

   BitBlt(hdcBack, 0, 0, ptSize.x, ptSize.y, hdcObject, 0, 0, NOTSRCCOPY);
   PatBlt(hdcMem, 0,0, ptSize.x, ptSize.y, PATCOPY);
   BitBlt(hdcMem, 0, 0, ptSize.x, ptSize.y, hdcObject, 0, 0, SRCAND);
   BitBlt(hdcTemp, 0, 0, ptSize.x, ptSize.y, hdcBack, 0, 0, SRCAND);
   BitBlt(hdcMem, 0, 0, ptSize.x, ptSize.y, hdcTemp, 0, 0, SRCPAINT);
   BitBlt(hdc, rct->left, rct->top, ptSize.x, ptSize.y, hdcMem, 0, 0, SRCCOPY);

   DeleteObject(SelectObject(hdcMem, hBrOld));
   DeleteObject(SelectObject(hdcTemp, bmTempOld));
   DeleteObject(SelectObject(hdcMem, bmMemOld));
   DeleteObject(SelectObject(hdcBack, bmBackOld));
   DeleteObject(SelectObject(hdcObject, bmObjectOld));
   DeleteDC(hdcMem);
   DeleteDC(hdcBack);
   DeleteDC(hdcObject);
   DeleteDC(hdcTemp);
}

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

#ifdef __CLIPPER__
static int near GetInt( PCLIPVAR Array, WORD wIndex )
{
    int iRet = 0;
    _cAt( Array, wIndex, -1, ++_tos );

    if( _tos->wType & NUMERIC )
        iRet = (int) _tos->pPointer1;

    else if( _tos->wType & NUM_FLOAT )
        iRet = _dvtoi( (DWORD) _tos->pPointer1, (DWORD) _tos->pPointer2 );

    --_tos;

    return iRet;
}
#endif

#ifdef __XPP__
static long GetInt( void * Array, WORD wIndex )
{
   void * chItem = 0;
   long l;

   __conArrayGet( Array, chItem, wIndex, 0 );
   __conGetNL( chItem, &l );
   __conRelease( chItem );

   return l;
}
#endif

#ifdef __HARBOUR__
   #define GetInt( Array, wIndex )  hb_arrayGetNL( Array, wIndex )
#endif

//-----------------------------------------------------------------------=
                                                        // ÚÄ1ra Col.a Pintar
                                                        // ³
static void near PaintTheLine( HDC hDC, RECT * rct, WORD wIndex,
                               PCLIPVAR pAtext, PCLIPVAR pAsizes,
                               HPEN hWhitePen, HPEN hGrayPen, BOOL bTree,
                               PCLIPVAR pAJustify, WORD wPressed,
                               BOOL bHeader, WORD nStyle,
                               WORD wFocus, BOOL bFocused,
                               PCLIPVAR pTextColor, PCLIPVAR pBkColor,
                               WORD wRowPos, WORD nHeightCtrl,
                               LONG nClrLine, BOOL bFooter,
                               BOOL bSelect, PCLIPVAR pFont,
                               BOOL bDrawFocusRect )
{
   RECT box, wholebox, rctadj;
   int iMaxRight = rct->right;

   WORD wLenJust = 0 ;
   #ifndef __HARBOUR__
   WORD wLen     = _VARRAYLEN( pAtext );
   CLV_WORD lJustify;
   #else
   WORD wLen     = hb_arrayLen( pAtext );
   PHB_ITEM uElem = hb_itemNew( NULL );
   #endif
   WORD wType, wcLen;
   LONG lValue;
   char * cValue;
   HPEN hOldPen, hPen;
   BITMAP bmp;
   WORD wRow, wCol;
   LONG lColor ;
   HBRUSH hBrush;
   LONG lTextColorOld = -1 ; // CeSoTech
   LONG lBkColorOld   = -1 ; // CeSoTech
   PCLIPVAR pEvalOld ;
   HFONT hFont ; // CeSoTech
   WORD wAlign ; // CeSoTech

   // CeSoTech
   LONG nClrLineC = ( nStyle == 2 || nStyle == 6 || nStyle == 8 ||
                      nStyle == 10 ) ? GetSysColor( COLOR_BTNSHADOW ) : 0 ;

   // CeSoTech
   if ( nClrLine >= 0 )   // Desde Clipper manda color especifico linea
      nClrLineC = nClrLine ;

   if ( ! bDrawHeaders )
      bHeader = FALSE ;

   if ( bFooter )
      bHeader = TRUE ; //-> Para que lo pinte con similar aspecto

   //CeSoTech
   // Si es un estilo sin separadores horizontales, pintar uno mas arriba
   //CeSoTech para que que bien completa el area !!!
   if ( ! (bHeader) && (nStyle == 0 || nStyle == 5 || nStyle == 6 ||
                        nStyle == 9 || nStyle == 10) )
      rct->top--       ;

   wholebox.top    = rct->top+1;
   wholebox.left   = rct->left;
   wholebox.bottom = rct->bottom;
   wholebox.right  = rct->right;

   rct->right  = 0;

   box.top    = rct->top ;
   box.bottom = rct->bottom - 1;

   if( !wIndex | wIndex > wLen )
       wIndex = 1;

   if ( pAJustify )
      #ifndef __HARBOUR__
         wLenJust = _VARRAYLEN( pAJustify );
      #else
         wLenJust = hb_arrayLen( pAJustify );
      #endif

   while( wIndex <= wLen )
   {

        rct->left   = rct->right;

        rct->right  = ( wIndex == wLen ? iMaxRight
                                      : rct->left + GetInt( pAsizes, wIndex ) );
        // CeSoTech // Cuando estoy estoy en la ultima celda, NO pintar hasta
                    // el final si no existe ajuste de ultima columna.
        if ( ( wIndex == wLen ) && ( ! bAdjLastCol )  )
        {
           rct->right  = rct->left + GetInt( pAsizes, wIndex ) +(bHeader ? 1: 0) ;
           if ( !bAdjBrowse )
              wholebox.right = rct->right ; // Tambien ajusto el borde focus

        }
        // CeSoTech //


        wAlign = HA_LEFT | VA_CENTER ;  // Alineacion por defecto
        wcLen = 0;
        ///////// INICIO Toma de datos celda !!!

        #ifndef __HARBOUR__
           if ( wIndex <= wLenJust )
           {
             _cAt( pAJustify, wIndex, 0xFFFF, ( PCLIPVAR ) &lJustify );
             wAlign = lJustify.wWord ;
           }
           _cAt( pAtext, wIndex, 0xFFFF, ++_tos );
           wType = _tos->wType;
           if ( wType & NUMERIC )
              lValue = (LONG) _tos->pPointer1;
           if ( wType & CHARACTER )
           {
              cValue = _VSTR( _tos );
              wcLen = _tos->w2;
           }
        #else

           if ( wIndex <= wLenJust )
           {
              hb_arrayGet( pAJustify, wIndex, uElem );
              if ( ( hb_itemType( uElem ) & LOGICAL ) && hb_itemGetL( uElem ) )
                 wAlign = HA_RIGHT | VA_CENTER ;
              else
                 wAlign = hb_itemGetNL( uElem );

                    hb_itemClear( uElem );
           }

           // uElem.type = HB_IT_NIL;
           hb_arrayGet( pAtext, wIndex, uElem );
           wType = hb_itemType( uElem );
           if ( wType & NUMERIC )
              lValue = hb_itemGetNL( uElem );
           if ( wType & CHARACTER )
           {
//              cValue = hb_itemGetC( uElem );
                cValue = ( char * ) hb_itemGetCPtr( uElem );
                wcLen = strlen( cValue );
           }

        #endif
        ///////// FIN Toma de datos celda !!!



        if( wFocus > 0 && wIndex != wFocus )
        {
           #ifndef __HARBOUR__
              _tos--;
           #endif

           if( rct->right >= iMaxRight )
           {
               wIndex = wLen + 1;   // ya no pintamos m s
           }
           else
              ++wIndex;
           continue;
        }

        if( bTree ||
            (GetInt( pAsizes, wIndex ) > 0) ) //Si NO es columna oculta (x Freeze)
        {                                     //(Es lo mismo no hacer esto,
                                              // pero es para evitar hacer trabajar
                                              // al codigo sin sentido !!! )

           if( (wType & NUMERIC) && bTree )
           {
               if( lValue )
               {
                  FillRect( hDC, rct, hBrush = CreateSolidBrush( GetPixel( hDC, rct->left, rct->top ) ) );
                  DrawMasked( hDC, (HBITMAP) lValue, rct->top, rct->left );
                  DeleteObject( hBrush );
               }

           }
           else  // Si es Numerico Bmp no Tree, o , es Character !!!!
           {

               if ( pBkColor )  // Bloque de Color Fondo Celda
               {
                  _PutSym( _SymEval ); //line 387
                  _xPushM( pBkColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lBkColorOld = SetBkColor( hDC, hb_parnl( - 1 ) ) ;
               }

               if( pTextColor ) // Bloque de Color Texto Celda
               {
                  _PutSym( _SymEval ); //linr 399
                  _xPushM( pTextColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lTextColorOld = SetTextColor( hDC, hb_parnl( - 1 ) ) ;
               }

               hFont = 0 ;
               if( pFont )      // Bloque de Font Celda
               {
                  _PutSym( _SymEval ); //line 412
                  _xPushM( pFont );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                     hFont = (HFONT) hb_parnl( - 1 ) ;
               }
 
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: Harbour 3.0

Postby ruben Dario » Fri Sep 09, 2011 5:04 pm

Trato de Compilar con Harbour 3.1 y me da estos Errores.

Gracias de Antemano.



Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
DRAWVBOX.C:
Error E2238 k:\Harbour\include\clipdefs.h 84: Multiple declaration for 'WORD'
Error E2344 c:\bcc582\include\windef.h 155: Earlier declaration of 'WORD'
Error E2238 k:\Harbour\include\clipdefs.h 86: Multiple declaration for 'PWORD'
Error E2344 c:\bcc582\include\windef.h 164: Earlier declaration of 'PWORD'
Error E2238 k:\Harbour\include\clipdefs.h 106: Multiple declaration for 'BOOL'
Error E2344 c:\bcc582\include\windef.h 153: Earlier declaration of 'BOOL'
Error E2238 k:\Harbour\include\clipdefs.h 109: Multiple declaration for 'PBOOL'
Error E2344 c:\bcc582\include\windef.h 158: Earlier declaration of 'PBOOL'
Error E2238 k:\Harbour\include\clipdefs.h 118: Multiple declaration for 'HANDLE'
Error E2344 c:\bcc582\include\winnt.h 335: Earlier declaration of 'HANDLE'
Warning W8019 DRAWVBOX.C 71: Code has no effect in function BoxDegrade
Error E2379 DRAWVBOX.C 71: Statement missing ; in function BoxDegrade
Error E2140 DRAWVBOX.C 72: Declaration is not allowed here in function BoxDegrade
Error E2140 DRAWVBOX.C 73: Declaration is not allowed here in function BoxDegrade
Error E2140 DRAWVBOX.C 74: Declaration is not allowed here in function BoxDegrade
Error E2451 DRAWVBOX.C 76: Undefined symbol 'nLenTex' in function BoxDegrade
Error E2451 DRAWVBOX.C 101: Undefined symbol 'nAltura' in function BoxDegrade
Error E2451 DRAWVBOX.C 104: Undefined symbol 'nLargura' in function BoxDegrade
Error E2314 DRAWVBOX.C 104: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 117: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 121: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 164: Call of nonfunction in function BoxDegrade
Error E2451 DRAWVBOX.C 185: Undefined symbol 'nPosTex' in function BoxDegrade
Warning W8004 DRAWVBOX.C 441: 'dwExtent' is assigned a value that is never used in function BoxDegrade
*** 22 errors in Compile ***


fUENTE DRAWVBOX.C

Code: Select all  Expand view

// Developed by Vagner Wirts
//
// Pequeñas modificaciones por Vikthor y Daniel Andrade [AD2K]
//
// ULTIMA MODIFICACION: 05/mar/2003
// ruben ago 19 2010 carbiar linea LPSTR cTexto   =          _parc(  3 );;LPSTR cTexto   = (LPSTR)   _parc(  3 );
// cuando se compilar con bcc82
//
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>
#include <StdLib.h>


void BoxDegrade(HDC hDC, RECT * rOrig, LPSTR cTexto, COLORREF cCorT, COLORREF cCor1, COLORREF cCor2, int nAlinha ,BOOL lRaised,BOOL lTransp) ;

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

// By Vikthor
// Llamado a Clipper
#ifndef __HARBOUR__
   CLIPPER DrawVBox( PARAMS ) // hWnd, hDC, cTexto,cCorT , cCor1, cCor2, nAlinha,
                              // lRaised, hFont, lTransp
                              //   nClrTo, lDegrad, hBrush )
#else
// Ahora para Harbour
   HARBOUR HB_FUN_DRAWVBOX( PARAMS )    //  ¡¡ A fuerzas deben ser mayusculas  !!


#endif

{
    HWND hWnd      = ( HWND ) _parni( 1 );
    HDC hDC        = ( HDC )  _parni( 2 );
    LPSTR cTexto   = (LPSTR)   _parc(  3 );
    COLORREF cCorT =          _parnl( 4 );
    COLORREF cCor1 =          _parnl( 5 );
    COLORREF cCor2 =          _parnl( 6 );
  char nAlinha   =          _parni( 7 );  // char nAlinha   =          _parni( 7 );
    BOOL lRaised   =          _parl(  8 );
  HFONT hFont    = (HFONT)  _parni( 9 );  // By Vikthor
    BOOL lTransp   =          _parl( 10 );
    HFONT hFontOld;
    RECT rct;

    /*------------- Tipos de Molduras --------------*/
    /* nAlinha == 1 - Escrita na Esquerda (default) */
    /*         == 2 - Escrita no Centro             */
    /*         == 3 - Escrita na Direita            */
    /*----------------------------------------------*/
    nAlinha = (nAlinha < 1 || nAlinha > 3 ? 1 : nAlinha) ;

    GetClientRect( hWnd, &rct );
  rct.bottom ++;                    // [AD2K]

    if(hFont) hFontOld = SelectObject(hDC,hFont) ;

    BoxDegrade( hDC, &rct, cTexto, cCorT ,cCor1, cCor2, nAlinha, lRaised, lTransp );

    if(hFont) SelectObject(hDC,hFontOld) ;

}

void BoxDegrade(HDC hDC, RECT * rOrig, LPSTR cTexto , COLORREF cCorT, COLORREF cCor1, COLORREF cCor2, int nAlinha ,BOOL lRaised,BOOL lTransp )
{
    int nColoR1,nColoG1,nColoB1,nColoR2,nColoG2,nColoB2;
    RECT rct,rcti,rctOri,rctTem;
    HBRUSH hBrush;
    signed int nSomaR,nSomaG,nSomaB,nSoma;
    int nStep , nFor;
    WORD nPosTex ,nAltura,nLargura,nLenTex;
    DWORD dwExtent;
    SIZE sz;                            // By Vikthor
    TEXTMETRIC tm;                      // By Vikthor

    nLenTex    = _parclen(3);
    rct.top    = rOrig->top ;
    rct.left   = rOrig->left ;
    rct.bottom = rOrig->bottom ;
    rct.right  = rOrig->right ;

    rctOri = rcti = rct;

    /*---- Sempre subtrai metade do tamanho do texto ----*/
  //dwExtent = GetTextExtent(hDC, (LPCSTR) cTexto,lstrlen(cTexto));

  /*
   * By Vikthor
   */

  #ifndef __FLAT__
    dwExtent = GetTextExtent( hDC, (LPCSTR) cTexto, strlen(cTexto) );
  #else
    GetTextExtentPoint32( hDC, (LPCSTR) cTexto , strlen(cTexto) , &sz );
    dwExtent = sz.cx;
  #endif

  /*
   * Para Obtener correctamente la Altura del Texto
   */

  GetTextMetrics( hDC, &tm );         // By Vikthor
  nAltura  = tm.tmHeight ;            // By Vikthor

//  nAltura  = LOWORD(dwExtent);      // No funciona correctamente
  nLargura = LOWORD(dwExtent);

    if(!strlen(cTexto) >= 1)   // By Vikthor
        {
        rct.top  += 6;
        rcti.top  = rct.top;
    rct.bottom += 6;              // [AD2K]
    rcti.bottom = rct.bottom;     // [AD2K]
        }

    if(!lTransp)
        {
        nColoR1 = GetRValue(cCor1);
        nColoG1 = GetGValue(cCor1);
        nColoB1 = GetBValue(cCor1);

        nColoR2 = GetRValue(cCor2);
        nColoG2 = GetGValue(cCor2);
        nColoB2 = GetBValue(cCor2);

        nSomaR = abs( nColoR2 - nColoR1 ) ;
        nSomaG = abs( nColoG2 - nColoG1 ) ;
        nSomaB = abs( nColoB2 - nColoB1 ) ;

        nStep = ((rct.bottom/2) - rct.top + 1) ;  // [AD2K]

        nSoma = nStep/100 ;
    nSoma = max(nSoma,1) ;   // Vikthor
                             // En Mayusculas da error , asi que se declara en minusculas

        nSomaR = ( nSomaR <= 0 ? 0 : ( nSomaR / (nStep*2) ) ) ; // [AD2K]
        nSomaG = ( nSomaG <= 0 ? 0 : ( nSomaG / (nStep*2) ) ) ; // [AD2K]
        nSomaB = ( nSomaB <= 0 ? 0 : ( nSomaB / (nStep*2) ) ) ; // [AD2K]

    nSomaR = max(nSomaR,1);         // Vikthor
    nSomaG = max(nSomaG,1);         // Vikthor
    nSomaB = max(nSomaB,1);         // Vikthor

        rct.bottom = rct.top;

        for( nFor = 0; nFor <= (nStep*2) ; nFor++ )
            {
        rct.bottom += nSoma;
            if(strlen(cTexto) >= 1 && nFor <= (nAltura/2))
                {
                if(nAlinha==1)  //left
                    rct.right = rct.left+nLargura;
                if(nAlinha==2)  //Center
                    {
                    rct.left  = ((rcti.right-rcti.left)-nLargura)/2 ;
                    rct.right = rct.left+nLargura ;
                    }
                if(nAlinha==3)  //right
                    rct.left  = rct.right-nLargura;
                }
            else
            {
                rct.left  = rcti.left;
                rct.right = rcti.right;
            }
            hBrush = CreateSolidBrush(RGB(nColoR1, nColoG1, nColoB1));

      FillRect( hDC, &rct, hBrush );

            DeleteObject(hBrush);

            rct.top  += nSoma;

            nColoR1 = (nColoR2 > nColoR1 ? nColoR1 + nSomaR : nColoR1 - nSomaR ) ;
            nColoG1 = (nColoG2 > nColoG1 ? nColoG1 + nSomaG : nColoG1 - nSomaG ) ;
            nColoB1 = (nColoB2 > nColoB1 ? nColoB1 + nSomaB : nColoB1 - nSomaB ) ;

            nColoR1 = (nColoR1 < 0 ? 0 : nColoR1 > 255 ? 255 : nColoR1);
            nColoG1 = (nColoG1 < 0 ? 0 : nColoG1 > 255 ? 255 : nColoG1);
            nColoB1 = (nColoB1 < 0 ? 0 : nColoB1 > 255 ? 255 : nColoB1);

            }
        }

    if(strlen(cTexto) >= 1)
        {
        nPosTex = (nAlinha == 1 ? DT_LEFT : nAlinha == 2 ? DT_CENTER : DT_RIGHT ) ;

        SetBkMode(hDC,TRANSPARENT);
        /*---- Escrita ----*/
        SetTextColor( hDC, cCorT);
        rcti.top += 1;
        rcti.bottom = rcti.top+nAltura;
        DrawText( hDC, cTexto, nLenTex, &rcti, nPosTex+DT_VCENTER);
        }

    /*----------------------- Monta a Moldura ----------------------*/
    /* Montei com Brush ao inves de LineTo para nao perder recursos */
    /*--------------------------------------------------------------*/

    rctOri.top += (strlen(cTexto) >= 1 ? nAltura/2 : 6) ;
    rctOri.top ++;

    /*---- 1¦ Moldura ----*/
    hBrush = CreateSolidBrush(GetSysColor((!lRaised ? 20 : 16)));

    /*- Linha Superior -*/
    if(strlen(cTexto) >= 1)
        {
        if(nAlinha==1)  //Left
            {
            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-1 ;
            rctTem.left   = rctOri.left                  ;
            rctTem.bottom = rctOri.top                   ;
            rctTem.right  = rctOri.left               +1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top           +1 ;
            rctTem.right  = rctOri.left+nLargura +1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right  -1 ;
            rctTem.bottom = rctOri.top       ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==2)  //Center
            {
            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctOri.top-1                              ;
            rctTem.left   = rctOri.left                               ;
            rctTem.bottom = rctOri.top                                ;
            rctTem.right  = (((rctOri.right-rctOri.left)-nLargura)/2) ;
            FillRect( hDC, &rctTem, hBrush )                          ;

            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2)) -1 ;
            rctTem.left   = rctTem.right                  ;
            rctTem.right  ++                              ;
            FillRect( hDC, &rctTem, hBrush )              ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = (rctOri.top - (nAltura/2))   ;
            rctTem.right  += nLargura                 -1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==3)  //Right
            {
            /*---- Inferior Direita do Texto ----*/
            rctTem.top    = rctOri.top         -1 ;
            rctTem.left   = rctOri.left           ;
            rctTem.bottom = rctOri.top            ;
            rctTem.right  = rctOri.right-nLargura ;
            FillRect( hDC, &rctTem, hBrush )      ;

            /*---- Lateral Direita do Texto ----*/
            rctTem.top    -= (nAltura/2)     ;
            rctTem.left   = rctTem.right  -1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top    +1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }
        }
    else
    {
        rctTem.top    = rctOri.top    -1 ;
        rctTem.left   = rctOri.left   +1 ;
        rctTem.bottom = rctOri.top       ;
        rctTem.right  = rctOri.right  +1 ;
        FillRect( hDC, &rctTem, hBrush ) ;
    }

    /*- Linha Lateral Esquerda -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctOri.right  +1 ;
    rctTem.bottom = rctOri.bottom +2 ;
    rctTem.right  = rctOri.right  +2 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Inferior -*/
    rctTem.top    = rctTem.bottom    ;
    rctTem.left   = rctOri.left   +1 ;
    rctTem.bottom ++                 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Lateral Direita -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctTem.left   -1 ;  // --                 ; // [AD2K] 16
    rctTem.right  = rctTem.left   +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    DeleteObject(hBrush);

    /*---- 2¦ Moldura ----*/
    hBrush = CreateSolidBrush(GetSysColor((!lRaised ? 16 : 20)));

    if(strlen(cTexto) >= 1)
        {
        if(nAlinha==1)  //Left
            {
            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-2 ;
            rctTem.left   = rctOri.left               -1 ;
            rctTem.bottom = rctOri.top                -1 ;
            rctTem.right  = rctOri.left                  ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top           +1 ;
            rctTem.right  = rctOri.left+nLargura -1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.right  ++                 ;
            rctTem.bottom = rctOri.top    -1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==2)  //Center
            {
            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctOri.top                               -2 ;
            rctTem.left   = rctOri.left                              -1 ;
            rctTem.bottom = rctOri.top                               -1 ;
            rctTem.right  = (((rctOri.right-rctOri.left)-nLargura)/2)-1 ;
            FillRect( hDC, &rctTem, hBrush )                            ;

            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-2 ;
            rctTem.left   = rctTem.right                 ;
            rctTem.right  ++                             ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = (rctOri.top - (nAltura/2))-1 ;
            rctTem.right  += nLargura                 -1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top    -1 ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.bottom = rctOri.top-1     ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==3)  //Right
            {
            /*---- Inferior Direita do Texto ----*/
            rctTem.top    = rctOri.top           -2 ;
            rctTem.left   = rctOri.left          -1 ;
            rctTem.bottom = rctOri.top           -1 ;
            rctTem.right  = rctOri.right-nLargura-1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Lateral Direita do Texto ----*/
            rctTem.top    -= (nAltura/2)     ;
            rctTem.left   = rctTem.right-1   ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top    +1 ;
            rctTem.right  = rctOri.right     ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top    -1 ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }
        }
    else
    {
        rctTem.top    = rctOri.top    -2 ;
        rctTem.left   = rctOri.left   -1 ;
        rctTem.bottom = rctOri.top    -1 ;
        rctTem.right  = rctOri.right     ;
        FillRect( hDC, &rctTem, hBrush ) ;
    }

    /*- Linha Lateral Esquerda -*/
    rctTem.top    = rctOri.top    -2 ;
    rctTem.left   = rctOri.right     ;
    rctTem.bottom = rctOri.bottom +1 ;
    rctTem.right  = rctOri.right  +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Inferior -*/
    rctTem.top    = rctTem.bottom    ;
    rctTem.left   = rctOri.left      ;
    rctTem.bottom ++                 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Lateral Direita -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctTem.left   -1 ; // --                 ;  // [AD2K] 16
    rctTem.right  = rctTem.left   +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    DeleteObject(hBrush);
}

 
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1061
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Harbour 3.0

Postby Antonio Linares » Fri Sep 09, 2011 7:11 pm

Patricio,

Antes de los #includes añade este define:

#define _HB_API_INTERNAL_

Patricio Avalos Aguirre wrote:Gracias antonio ahora tengo 3 errores..

Code: Select all  Expand view
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
source\WBRWLINE.C:
Error E2451 source\WBRWLINE.C 387: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 399: Undefined symbol 'hb_symEval' in function PaintTheLine
Error E2451 source\WBRWLINE.C 412: Undefined symbol 'hb_symEval' in function PaintTheLine
*** 3 errors in Compile ***



_PutSym( _SymEval ); LINE 387
_PutSym( _SymEval ); LINE 399
_PutSym( _SymEval ); LINE 412

Voy a colocar el archivo desde el inicio hasta el error
Code: Select all  Expand view

void * __conArrayGet( void *, void *, ... );
long __conGetNL( void *, long * );
long __conRelease( void * );

#include <Windows.h>
#ifdef __HARBOUR__
   #include <hbapi.h>
   #include <hbapiitm.h>
   #include <hbstack.h>
   #include <hbvm.h>
   // #include <hbfast.h>
   #define MoveTo( hDC, x, y ) MoveToEx( hDC, x, y, NULL )
   #define _PutSym( _SymEval ) hb_vmPushSymbol( &hb_symEval )
   #define _xPushM  hb_vmPush
   #define _PutLN   hb_vmPushLong
   #define _xEval   hb_vmDo
   #define _cEval0  hb_vmEvalBlock
   #define _Get_Sym hb_dynsymFindName
#endif

#define LOGICAL   HB_IT_LOGICAL
#define NUMERIC   HB_IT_NUMERIC
#define CHARACTER HB_IT_STRING
#define BLOCK     HB_IT_BLOCK

#define HA_LEFT    0  // by CeSoTech Alineaciones Horizontales y Verticales
#define HA_RIGHT   1
#define HA_CENTER  2
#define VA_TOP     4
#define VA_BOTTOM  8
#define VA_CENTER  32

#ifdef __FLAT__
#undef  PCLIPVAR
#define PCLIPVAR PHB_ITEM
#endif

#ifdef __XHARBOUR__
   void hb_storvni( int iValue, int iParam, int iIndex );
   long hb_parvnl( int iParam, int iIndex );
   int hb_parvni( int iParam, int iIndex );
   void hb_storvnl( LONG lValue, int iParam, int iIndex );
#endif


static far BOOL bAdjLastCol  ; // CeSoTech
static far BOOL bAdjBrowse   ; // CeSoTech
static far BOOL bDrawHeaders ; // CeSoTech
static far BOOL bDrawFooters ; // CeSoTech
static far WORD wHeaderHeight; // CeSoTech
static far WORD wFooterHeight; // CeSoTech
static far WORD wLineHeight  ; // CeSoTech

static far BOOL bWorking;

WORD WBrwRowsC( HWND hWnd, HDC hDC, HFONT hFont ); // CeSoTech

static void FW_DrawText( HDC hDC, RECT * rct, LPCSTR pText,
                         WORD wAlign, int iLen, HFONT hFont,
                         BOOL bHeadFoot ) ; // CeSoTech
static void FW_DrawBitmapCenter( HDC hDC, HBITMAP hBmp, RECT * rct, WORD nStyle, BOOL bFocused ) ;

void MaskRegion( HDC hDC, RECT * rct, COLORREF cTrColor,
                 COLORREF cBackColor );

FrameDot( HDC hDC, RECT * pRect );

extern void WndDrawBox( HDC, LPRECT, HPEN, HPEN );
extern void DrawBitmap( HDC, HBITMAP, WORD wCol, WORD wRow, WORD wWidth,
                        WORD wHeight, DWORD dwRaster );


static void near PaintTheLine( HDC hDC, RECT * rct, WORD wIndex,
                               PCLIPVAR pAtext, PCLIPVAR pAsizes,
                               HPEN hWhitePen, HPEN hGrayPen, BOOL bTree,
                               PCLIPVAR pAJustify, WORD wPressed,
                               BOOL bHeader, WORD nStyle,
                               WORD nFocus, BOOL bFocused,
                               PCLIPVAR pTextColor, PCLIPVAR pBkColor,
                               WORD wRowPos, WORD nHeightCtrl,
                               LONG nClrLine, BOOL bFooter,
                               BOOL bSelect, PCLIPVAR pFont,
                               BOOL bDrawFocusRect ) ;



void DrawMasked( HDC, HBITMAP, WORD wCol, WORD wRow );
                  // LOW    HIGH
extern int _dvtoi( DWORD, DWORD );
void MsgStr( long l );
LPSTR Str( WORD w );

#ifndef __FLAT__
   static int near GetInt( PCLIPVAR Array, WORD wIndex );
   static far PCLIPSYMBOL pSkip = 0;
#else
   static long near GetInt( void * Array, WORD wIndex );
   PHB_DYNS pSkip = NULL;
#endif

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

static void MaskRegion( HDC hdc, RECT * rct, COLORREF cTransparentColor,
                        COLORREF cBackgroundColor )

{
   HDC        hdcTemp, hdcObject, hdcBack, hdcMem;
   POINT      ptSize;
   COLORREF   cColor;
   HBITMAP    bmAndObject, bmAndBack, bmBackOld, bmObjectOld,
              bmAndTemp, bmTempOld, bmAndMem, bmMemOld;
   HBRUSH     hBrush, hBrOld;

   ptSize.x = rct->right - rct->left + 1;
   ptSize.y = rct->bottom - rct->top + 1;

   hBrush      = CreateSolidBrush(cBackgroundColor);

   hdcTemp     = CreateCompatibleDC(hdc);
   hdcObject   = CreateCompatibleDC(hdc);
   hdcBack     = CreateCompatibleDC(hdc);
   hdcMem      = CreateCompatibleDC(hdc);

   bmAndTemp   = CreateCompatibleBitmap(hdc, ptSize.x, ptSize.y);
   bmAndMem    = CreateCompatibleBitmap(hdc, ptSize.x, ptSize.y);
   bmAndObject = CreateBitmap(ptSize.x, ptSize.y, 1, 1, NULL);
   bmAndBack   = CreateBitmap(ptSize.x, ptSize.y, 1, 1, NULL);

   bmTempOld   = SelectObject(hdcTemp, bmAndTemp);
   bmMemOld    = SelectObject(hdcMem, bmAndMem);
   bmBackOld   = SelectObject(hdcBack, bmAndBack);
   bmObjectOld = SelectObject(hdcObject, bmAndObject);

   hBrOld      = SelectObject(hdcMem, hBrush);

   BitBlt(hdcTemp, 0, 0, ptSize.x, ptSize.y, hdc, rct->left, rct->top, SRCCOPY);

   SetMapMode(hdcTemp, GetMapMode(hdc));

   cColor = SetBkColor(hdcTemp, cTransparentColor);

   BitBlt(hdcObject, 0, 0, ptSize.x, ptSize.y, hdcTemp, 0, 0, SRCCOPY);

   SetBkColor(hdcTemp, cColor);

   BitBlt(hdcBack, 0, 0, ptSize.x, ptSize.y, hdcObject, 0, 0, NOTSRCCOPY);
   PatBlt(hdcMem, 0,0, ptSize.x, ptSize.y, PATCOPY);
   BitBlt(hdcMem, 0, 0, ptSize.x, ptSize.y, hdcObject, 0, 0, SRCAND);
   BitBlt(hdcTemp, 0, 0, ptSize.x, ptSize.y, hdcBack, 0, 0, SRCAND);
   BitBlt(hdcMem, 0, 0, ptSize.x, ptSize.y, hdcTemp, 0, 0, SRCPAINT);
   BitBlt(hdc, rct->left, rct->top, ptSize.x, ptSize.y, hdcMem, 0, 0, SRCCOPY);

   DeleteObject(SelectObject(hdcMem, hBrOld));
   DeleteObject(SelectObject(hdcTemp, bmTempOld));
   DeleteObject(SelectObject(hdcMem, bmMemOld));
   DeleteObject(SelectObject(hdcBack, bmBackOld));
   DeleteObject(SelectObject(hdcObject, bmObjectOld));
   DeleteDC(hdcMem);
   DeleteDC(hdcBack);
   DeleteDC(hdcObject);
   DeleteDC(hdcTemp);
}

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

#ifdef __CLIPPER__
static int near GetInt( PCLIPVAR Array, WORD wIndex )
{
    int iRet = 0;
    _cAt( Array, wIndex, -1, ++_tos );

    if( _tos->wType & NUMERIC )
        iRet = (int) _tos->pPointer1;

    else if( _tos->wType & NUM_FLOAT )
        iRet = _dvtoi( (DWORD) _tos->pPointer1, (DWORD) _tos->pPointer2 );

    --_tos;

    return iRet;
}
#endif

#ifdef __XPP__
static long GetInt( void * Array, WORD wIndex )
{
   void * chItem = 0;
   long l;

   __conArrayGet( Array, chItem, wIndex, 0 );
   __conGetNL( chItem, &l );
   __conRelease( chItem );

   return l;
}
#endif

#ifdef __HARBOUR__
   #define GetInt( Array, wIndex )  hb_arrayGetNL( Array, wIndex )
#endif

//-----------------------------------------------------------------------=
                                                        // ÚÄ1ra Col.a Pintar
                                                        // ³
static void near PaintTheLine( HDC hDC, RECT * rct, WORD wIndex,
                               PCLIPVAR pAtext, PCLIPVAR pAsizes,
                               HPEN hWhitePen, HPEN hGrayPen, BOOL bTree,
                               PCLIPVAR pAJustify, WORD wPressed,
                               BOOL bHeader, WORD nStyle,
                               WORD wFocus, BOOL bFocused,
                               PCLIPVAR pTextColor, PCLIPVAR pBkColor,
                               WORD wRowPos, WORD nHeightCtrl,
                               LONG nClrLine, BOOL bFooter,
                               BOOL bSelect, PCLIPVAR pFont,
                               BOOL bDrawFocusRect )
{
   RECT box, wholebox, rctadj;
   int iMaxRight = rct->right;

   WORD wLenJust = 0 ;
   #ifndef __HARBOUR__
   WORD wLen     = _VARRAYLEN( pAtext );
   CLV_WORD lJustify;
   #else
   WORD wLen     = hb_arrayLen( pAtext );
   PHB_ITEM uElem = hb_itemNew( NULL );
   #endif
   WORD wType, wcLen;
   LONG lValue;
   char * cValue;
   HPEN hOldPen, hPen;
   BITMAP bmp;
   WORD wRow, wCol;
   LONG lColor ;
   HBRUSH hBrush;
   LONG lTextColorOld = -1 ; // CeSoTech
   LONG lBkColorOld   = -1 ; // CeSoTech
   PCLIPVAR pEvalOld ;
   HFONT hFont ; // CeSoTech
   WORD wAlign ; // CeSoTech

   // CeSoTech
   LONG nClrLineC = ( nStyle == 2 || nStyle == 6 || nStyle == 8 ||
                      nStyle == 10 ) ? GetSysColor( COLOR_BTNSHADOW ) : 0 ;

   // CeSoTech
   if ( nClrLine >= 0 )   // Desde Clipper manda color especifico linea
      nClrLineC = nClrLine ;

   if ( ! bDrawHeaders )
      bHeader = FALSE ;

   if ( bFooter )
      bHeader = TRUE ; //-> Para que lo pinte con similar aspecto

   //CeSoTech
   // Si es un estilo sin separadores horizontales, pintar uno mas arriba
   //CeSoTech para que que bien completa el area !!!
   if ( ! (bHeader) && (nStyle == 0 || nStyle == 5 || nStyle == 6 ||
                        nStyle == 9 || nStyle == 10) )
      rct->top--       ;

   wholebox.top    = rct->top+1;
   wholebox.left   = rct->left;
   wholebox.bottom = rct->bottom;
   wholebox.right  = rct->right;

   rct->right  = 0;

   box.top    = rct->top ;
   box.bottom = rct->bottom - 1;

   if( !wIndex | wIndex > wLen )
       wIndex = 1;

   if ( pAJustify )
      #ifndef __HARBOUR__
         wLenJust = _VARRAYLEN( pAJustify );
      #else
         wLenJust = hb_arrayLen( pAJustify );
      #endif

   while( wIndex <= wLen )
   {

        rct->left   = rct->right;

        rct->right  = ( wIndex == wLen ? iMaxRight
                                      : rct->left + GetInt( pAsizes, wIndex ) );
        // CeSoTech // Cuando estoy estoy en la ultima celda, NO pintar hasta
                    // el final si no existe ajuste de ultima columna.
        if ( ( wIndex == wLen ) && ( ! bAdjLastCol )  )
        {
           rct->right  = rct->left + GetInt( pAsizes, wIndex ) +(bHeader ? 1: 0) ;
           if ( !bAdjBrowse )
              wholebox.right = rct->right ; // Tambien ajusto el borde focus

        }
        // CeSoTech //


        wAlign = HA_LEFT | VA_CENTER ;  // Alineacion por defecto
        wcLen = 0;
        ///////// INICIO Toma de datos celda !!!

        #ifndef __HARBOUR__
           if ( wIndex <= wLenJust )
           {
             _cAt( pAJustify, wIndex, 0xFFFF, ( PCLIPVAR ) &lJustify );
             wAlign = lJustify.wWord ;
           }
           _cAt( pAtext, wIndex, 0xFFFF, ++_tos );
           wType = _tos->wType;
           if ( wType & NUMERIC )
              lValue = (LONG) _tos->pPointer1;
           if ( wType & CHARACTER )
           {
              cValue = _VSTR( _tos );
              wcLen = _tos->w2;
           }
        #else

           if ( wIndex <= wLenJust )
           {
              hb_arrayGet( pAJustify, wIndex, uElem );
              if ( ( hb_itemType( uElem ) & LOGICAL ) && hb_itemGetL( uElem ) )
                 wAlign = HA_RIGHT | VA_CENTER ;
              else
                 wAlign = hb_itemGetNL( uElem );

                    hb_itemClear( uElem );
           }

           // uElem.type = HB_IT_NIL;
           hb_arrayGet( pAtext, wIndex, uElem );
           wType = hb_itemType( uElem );
           if ( wType & NUMERIC )
              lValue = hb_itemGetNL( uElem );
           if ( wType & CHARACTER )
           {
//              cValue = hb_itemGetC( uElem );
                cValue = ( char * ) hb_itemGetCPtr( uElem );
                wcLen = strlen( cValue );
           }

        #endif
        ///////// FIN Toma de datos celda !!!



        if( wFocus > 0 && wIndex != wFocus )
        {
           #ifndef __HARBOUR__
              _tos--;
           #endif

           if( rct->right >= iMaxRight )
           {
               wIndex = wLen + 1;   // ya no pintamos m s
           }
           else
              ++wIndex;
           continue;
        }

        if( bTree ||
            (GetInt( pAsizes, wIndex ) > 0) ) //Si NO es columna oculta (x Freeze)
        {                                     //(Es lo mismo no hacer esto,
                                              // pero es para evitar hacer trabajar
                                              // al codigo sin sentido !!! )

           if( (wType & NUMERIC) && bTree )
           {
               if( lValue )
               {
                  FillRect( hDC, rct, hBrush = CreateSolidBrush( GetPixel( hDC, rct->left, rct->top ) ) );
                  DrawMasked( hDC, (HBITMAP) lValue, rct->top, rct->left );
                  DeleteObject( hBrush );
               }

           }
           else  // Si es Numerico Bmp no Tree, o , es Character !!!!
           {

               if ( pBkColor )  // Bloque de Color Fondo Celda
               {
                  _PutSym( _SymEval ); //line 387
                  _xPushM( pBkColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lBkColorOld = SetBkColor( hDC, hb_parnl( - 1 ) ) ;
               }

               if( pTextColor ) // Bloque de Color Texto Celda
               {
                  _PutSym( _SymEval ); //linr 399
                  _xPushM( pTextColor );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                    lTextColorOld = SetTextColor( hDC, hb_parnl( - 1 ) ) ;
               }

               hFont = 0 ;
               if( pFont )      // Bloque de Font Celda
               {
                  _PutSym( _SymEval ); //line 412
                  _xPushM( pFont );
                  _PutLN( wRowPos );
                  _PutLN( wIndex );
                  _PutLN( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xEval( 3 ) ;
                  if ( hb_parinfo( -1 ) & NUMERIC )
                     hFont = (HFONT) hb_parnl( - 1 ) ;
               }
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.0

Postby Antonio Linares » Fri Sep 09, 2011 7:13 pm

Ruben,

Cambia estas líneas:
Code: Select all  Expand view
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>


por:
Code: Select all  Expand view
#include <Windows.h>
#include <hbapi.h>


ruben Dario wrote:Trato de Compilar con Harbour 3.1 y me da estos Errores.

Gracias de Antemano.



Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
DRAWVBOX.C:
Error E2238 k:\Harbour\include\clipdefs.h 84: Multiple declaration for 'WORD'
Error E2344 c:\bcc582\include\windef.h 155: Earlier declaration of 'WORD'
Error E2238 k:\Harbour\include\clipdefs.h 86: Multiple declaration for 'PWORD'
Error E2344 c:\bcc582\include\windef.h 164: Earlier declaration of 'PWORD'
Error E2238 k:\Harbour\include\clipdefs.h 106: Multiple declaration for 'BOOL'
Error E2344 c:\bcc582\include\windef.h 153: Earlier declaration of 'BOOL'
Error E2238 k:\Harbour\include\clipdefs.h 109: Multiple declaration for 'PBOOL'
Error E2344 c:\bcc582\include\windef.h 158: Earlier declaration of 'PBOOL'
Error E2238 k:\Harbour\include\clipdefs.h 118: Multiple declaration for 'HANDLE'
Error E2344 c:\bcc582\include\winnt.h 335: Earlier declaration of 'HANDLE'
Warning W8019 DRAWVBOX.C 71: Code has no effect in function BoxDegrade
Error E2379 DRAWVBOX.C 71: Statement missing ; in function BoxDegrade
Error E2140 DRAWVBOX.C 72: Declaration is not allowed here in function BoxDegrade
Error E2140 DRAWVBOX.C 73: Declaration is not allowed here in function BoxDegrade
Error E2140 DRAWVBOX.C 74: Declaration is not allowed here in function BoxDegrade
Error E2451 DRAWVBOX.C 76: Undefined symbol 'nLenTex' in function BoxDegrade
Error E2451 DRAWVBOX.C 101: Undefined symbol 'nAltura' in function BoxDegrade
Error E2451 DRAWVBOX.C 104: Undefined symbol 'nLargura' in function BoxDegrade
Error E2314 DRAWVBOX.C 104: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 117: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 121: Call of nonfunction in function BoxDegrade
Error E2314 DRAWVBOX.C 164: Call of nonfunction in function BoxDegrade
Error E2451 DRAWVBOX.C 185: Undefined symbol 'nPosTex' in function BoxDegrade
Warning W8004 DRAWVBOX.C 441: 'dwExtent' is assigned a value that is never used in function BoxDegrade
*** 22 errors in Compile ***


fUENTE DRAWVBOX.C

Code: Select all  Expand view

// Developed by Vagner Wirts
//
// Pequeñas modificaciones por Vikthor y Daniel Andrade [AD2K]
//
// ULTIMA MODIFICACION: 05/mar/2003
// ruben ago 19 2010 carbiar linea LPSTR cTexto   =          _parc(  3 );;LPSTR cTexto   = (LPSTR)   _parc(  3 );
// cuando se compilar con bcc82
//
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>
#include <StdLib.h>


void BoxDegrade(HDC hDC, RECT * rOrig, LPSTR cTexto, COLORREF cCorT, COLORREF cCor1, COLORREF cCor2, int nAlinha ,BOOL lRaised,BOOL lTransp) ;

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

// By Vikthor
// Llamado a Clipper
#ifndef __HARBOUR__
   CLIPPER DrawVBox( PARAMS ) // hWnd, hDC, cTexto,cCorT , cCor1, cCor2, nAlinha,
                              // lRaised, hFont, lTransp
                              //   nClrTo, lDegrad, hBrush )
#else
// Ahora para Harbour
   HARBOUR HB_FUN_DRAWVBOX( PARAMS )    //  ¡¡ A fuerzas deben ser mayusculas  !!


#endif

{
    HWND hWnd      = ( HWND ) _parni( 1 );
    HDC hDC        = ( HDC )  _parni( 2 );
    LPSTR cTexto   = (LPSTR)   _parc(  3 );
    COLORREF cCorT =          _parnl( 4 );
    COLORREF cCor1 =          _parnl( 5 );
    COLORREF cCor2 =          _parnl( 6 );
  char nAlinha   =          _parni( 7 );  // char nAlinha   =          _parni( 7 );
    BOOL lRaised   =          _parl(  8 );
  HFONT hFont    = (HFONT)  _parni( 9 );  // By Vikthor
    BOOL lTransp   =          _parl( 10 );
    HFONT hFontOld;
    RECT rct;

    /*------------- Tipos de Molduras --------------*/
    /* nAlinha == 1 - Escrita na Esquerda (default) */
    /*         == 2 - Escrita no Centro             */
    /*         == 3 - Escrita na Direita            */
    /*----------------------------------------------*/
    nAlinha = (nAlinha < 1 || nAlinha > 3 ? 1 : nAlinha) ;

    GetClientRect( hWnd, &rct );
  rct.bottom ++;                    // [AD2K]

    if(hFont) hFontOld = SelectObject(hDC,hFont) ;

    BoxDegrade( hDC, &rct, cTexto, cCorT ,cCor1, cCor2, nAlinha, lRaised, lTransp );

    if(hFont) SelectObject(hDC,hFontOld) ;

}

void BoxDegrade(HDC hDC, RECT * rOrig, LPSTR cTexto , COLORREF cCorT, COLORREF cCor1, COLORREF cCor2, int nAlinha ,BOOL lRaised,BOOL lTransp )
{
    int nColoR1,nColoG1,nColoB1,nColoR2,nColoG2,nColoB2;
    RECT rct,rcti,rctOri,rctTem;
    HBRUSH hBrush;
    signed int nSomaR,nSomaG,nSomaB,nSoma;
    int nStep , nFor;
    WORD nPosTex ,nAltura,nLargura,nLenTex;
    DWORD dwExtent;
    SIZE sz;                            // By Vikthor
    TEXTMETRIC tm;                      // By Vikthor

    nLenTex    = _parclen(3);
    rct.top    = rOrig->top ;
    rct.left   = rOrig->left ;
    rct.bottom = rOrig->bottom ;
    rct.right  = rOrig->right ;

    rctOri = rcti = rct;

    /*---- Sempre subtrai metade do tamanho do texto ----*/
  //dwExtent = GetTextExtent(hDC, (LPCSTR) cTexto,lstrlen(cTexto));

  /*
   * By Vikthor
   */

  #ifndef __FLAT__
    dwExtent = GetTextExtent( hDC, (LPCSTR) cTexto, strlen(cTexto) );
  #else
    GetTextExtentPoint32( hDC, (LPCSTR) cTexto , strlen(cTexto) , &sz );
    dwExtent = sz.cx;
  #endif

  /*
   * Para Obtener correctamente la Altura del Texto
   */

  GetTextMetrics( hDC, &tm );         // By Vikthor
  nAltura  = tm.tmHeight ;            // By Vikthor

//  nAltura  = LOWORD(dwExtent);      // No funciona correctamente
  nLargura = LOWORD(dwExtent);

    if(!strlen(cTexto) >= 1)   // By Vikthor
        {
        rct.top  += 6;
        rcti.top  = rct.top;
    rct.bottom += 6;              // [AD2K]
    rcti.bottom = rct.bottom;     // [AD2K]
        }

    if(!lTransp)
        {
        nColoR1 = GetRValue(cCor1);
        nColoG1 = GetGValue(cCor1);
        nColoB1 = GetBValue(cCor1);

        nColoR2 = GetRValue(cCor2);
        nColoG2 = GetGValue(cCor2);
        nColoB2 = GetBValue(cCor2);

        nSomaR = abs( nColoR2 - nColoR1 ) ;
        nSomaG = abs( nColoG2 - nColoG1 ) ;
        nSomaB = abs( nColoB2 - nColoB1 ) ;

        nStep = ((rct.bottom/2) - rct.top + 1) ;  // [AD2K]

        nSoma = nStep/100 ;
    nSoma = max(nSoma,1) ;   // Vikthor
                             // En Mayusculas da error , asi que se declara en minusculas

        nSomaR = ( nSomaR <= 0 ? 0 : ( nSomaR / (nStep*2) ) ) ; // [AD2K]
        nSomaG = ( nSomaG <= 0 ? 0 : ( nSomaG / (nStep*2) ) ) ; // [AD2K]
        nSomaB = ( nSomaB <= 0 ? 0 : ( nSomaB / (nStep*2) ) ) ; // [AD2K]

    nSomaR = max(nSomaR,1);         // Vikthor
    nSomaG = max(nSomaG,1);         // Vikthor
    nSomaB = max(nSomaB,1);         // Vikthor

        rct.bottom = rct.top;

        for( nFor = 0; nFor <= (nStep*2) ; nFor++ )
            {
        rct.bottom += nSoma;
            if(strlen(cTexto) >= 1 && nFor <= (nAltura/2))
                {
                if(nAlinha==1)  //left
                    rct.right = rct.left+nLargura;
                if(nAlinha==2)  //Center
                    {
                    rct.left  = ((rcti.right-rcti.left)-nLargura)/2 ;
                    rct.right = rct.left+nLargura ;
                    }
                if(nAlinha==3)  //right
                    rct.left  = rct.right-nLargura;
                }
            else
            {
                rct.left  = rcti.left;
                rct.right = rcti.right;
            }
            hBrush = CreateSolidBrush(RGB(nColoR1, nColoG1, nColoB1));

      FillRect( hDC, &rct, hBrush );

            DeleteObject(hBrush);

            rct.top  += nSoma;

            nColoR1 = (nColoR2 > nColoR1 ? nColoR1 + nSomaR : nColoR1 - nSomaR ) ;
            nColoG1 = (nColoG2 > nColoG1 ? nColoG1 + nSomaG : nColoG1 - nSomaG ) ;
            nColoB1 = (nColoB2 > nColoB1 ? nColoB1 + nSomaB : nColoB1 - nSomaB ) ;

            nColoR1 = (nColoR1 < 0 ? 0 : nColoR1 > 255 ? 255 : nColoR1);
            nColoG1 = (nColoG1 < 0 ? 0 : nColoG1 > 255 ? 255 : nColoG1);
            nColoB1 = (nColoB1 < 0 ? 0 : nColoB1 > 255 ? 255 : nColoB1);

            }
        }

    if(strlen(cTexto) >= 1)
        {
        nPosTex = (nAlinha == 1 ? DT_LEFT : nAlinha == 2 ? DT_CENTER : DT_RIGHT ) ;

        SetBkMode(hDC,TRANSPARENT);
        /*---- Escrita ----*/
        SetTextColor( hDC, cCorT);
        rcti.top += 1;
        rcti.bottom = rcti.top+nAltura;
        DrawText( hDC, cTexto, nLenTex, &rcti, nPosTex+DT_VCENTER);
        }

    /*----------------------- Monta a Moldura ----------------------*/
    /* Montei com Brush ao inves de LineTo para nao perder recursos */
    /*--------------------------------------------------------------*/

    rctOri.top += (strlen(cTexto) >= 1 ? nAltura/2 : 6) ;
    rctOri.top ++;

    /*---- 1¦ Moldura ----*/
    hBrush = CreateSolidBrush(GetSysColor((!lRaised ? 20 : 16)));

    /*- Linha Superior -*/
    if(strlen(cTexto) >= 1)
        {
        if(nAlinha==1)  //Left
            {
            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-1 ;
            rctTem.left   = rctOri.left                  ;
            rctTem.bottom = rctOri.top                   ;
            rctTem.right  = rctOri.left               +1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top           +1 ;
            rctTem.right  = rctOri.left+nLargura +1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right  -1 ;
            rctTem.bottom = rctOri.top       ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==2)  //Center
            {
            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctOri.top-1                              ;
            rctTem.left   = rctOri.left                               ;
            rctTem.bottom = rctOri.top                                ;
            rctTem.right  = (((rctOri.right-rctOri.left)-nLargura)/2) ;
            FillRect( hDC, &rctTem, hBrush )                          ;

            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2)) -1 ;
            rctTem.left   = rctTem.right                  ;
            rctTem.right  ++                              ;
            FillRect( hDC, &rctTem, hBrush )              ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = (rctOri.top - (nAltura/2))   ;
            rctTem.right  += nLargura                 -1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==3)  //Right
            {
            /*---- Inferior Direita do Texto ----*/
            rctTem.top    = rctOri.top         -1 ;
            rctTem.left   = rctOri.left           ;
            rctTem.bottom = rctOri.top            ;
            rctTem.right  = rctOri.right-nLargura ;
            FillRect( hDC, &rctTem, hBrush )      ;

            /*---- Lateral Direita do Texto ----*/
            rctTem.top    -= (nAltura/2)     ;
            rctTem.left   = rctTem.right  -1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top    +1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top       ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }
        }
    else
    {
        rctTem.top    = rctOri.top    -1 ;
        rctTem.left   = rctOri.left   +1 ;
        rctTem.bottom = rctOri.top       ;
        rctTem.right  = rctOri.right  +1 ;
        FillRect( hDC, &rctTem, hBrush ) ;
    }

    /*- Linha Lateral Esquerda -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctOri.right  +1 ;
    rctTem.bottom = rctOri.bottom +2 ;
    rctTem.right  = rctOri.right  +2 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Inferior -*/
    rctTem.top    = rctTem.bottom    ;
    rctTem.left   = rctOri.left   +1 ;
    rctTem.bottom ++                 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Lateral Direita -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctTem.left   -1 ;  // --                 ; // [AD2K] 16
    rctTem.right  = rctTem.left   +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    DeleteObject(hBrush);

    /*---- 2¦ Moldura ----*/
    hBrush = CreateSolidBrush(GetSysColor((!lRaised ? 16 : 20)));

    if(strlen(cTexto) >= 1)
        {
        if(nAlinha==1)  //Left
            {
            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-2 ;
            rctTem.left   = rctOri.left               -1 ;
            rctTem.bottom = rctOri.top                -1 ;
            rctTem.right  = rctOri.left                  ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top           +1 ;
            rctTem.right  = rctOri.left+nLargura -1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.right  ++                 ;
            rctTem.bottom = rctOri.top    -1 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==2)  //Center
            {
            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctOri.top                               -2 ;
            rctTem.left   = rctOri.left                              -1 ;
            rctTem.bottom = rctOri.top                               -1 ;
            rctTem.right  = (((rctOri.right-rctOri.left)-nLargura)/2)-1 ;
            FillRect( hDC, &rctTem, hBrush )                            ;

            /*---- Linha Lateral Direita do Texto ----*/
            rctTem.top    = (rctOri.top - (nAltura/2))-2 ;
            rctTem.left   = rctTem.right                 ;
            rctTem.right  ++                             ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = (rctOri.top - (nAltura/2))-1 ;
            rctTem.right  += nLargura                 -1 ;
            FillRect( hDC, &rctTem, hBrush )             ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top    -1 ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Inferior do Texto Esquerda ----*/
            rctTem.top    = rctTem.bottom -1 ;
            rctTem.bottom = rctOri.top-1     ;
            rctTem.right  = rctOri.right  +1 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }

        if(nAlinha==3)  //Right
            {
            /*---- Inferior Direita do Texto ----*/
            rctTem.top    = rctOri.top           -2 ;
            rctTem.left   = rctOri.left          -1 ;
            rctTem.bottom = rctOri.top           -1 ;
            rctTem.right  = rctOri.right-nLargura-1 ;
            FillRect( hDC, &rctTem, hBrush )        ;

            /*---- Lateral Direita do Texto ----*/
            rctTem.top    -= (nAltura/2)     ;
            rctTem.left   = rctTem.right-1   ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Superior do Texto ----*/
            rctTem.bottom = rctTem.top    +1 ;
            rctTem.right  = rctOri.right     ;
            FillRect( hDC, &rctTem, hBrush ) ;

            /*---- Linha Lateral Esquerda do Texto ----*/
            rctTem.left   = rctTem.right     ;
            rctTem.bottom = rctOri.top    -1 ;
            rctTem.right  ++                 ;
            FillRect( hDC, &rctTem, hBrush ) ;
            }
        }
    else
    {
        rctTem.top    = rctOri.top    -2 ;
        rctTem.left   = rctOri.left   -1 ;
        rctTem.bottom = rctOri.top    -1 ;
        rctTem.right  = rctOri.right     ;
        FillRect( hDC, &rctTem, hBrush ) ;
    }

    /*- Linha Lateral Esquerda -*/
    rctTem.top    = rctOri.top    -2 ;
    rctTem.left   = rctOri.right     ;
    rctTem.bottom = rctOri.bottom +1 ;
    rctTem.right  = rctOri.right  +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Inferior -*/
    rctTem.top    = rctTem.bottom    ;
    rctTem.left   = rctOri.left      ;
    rctTem.bottom ++                 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    /*- Linha Lateral Direita -*/
    rctTem.top    = rctOri.top    -1 ;
    rctTem.left   = rctTem.left   -1 ; // --                 ;  // [AD2K] 16
    rctTem.right  = rctTem.left   +1 ;
    FillRect( hDC, &rctTem, hBrush ) ;

    DeleteObject(hBrush);
}

 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.0

Postby ruben Dario » Fri Sep 09, 2011 8:49 pm

Gracias Antonio Funciono
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1061
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Harbour 3.0

Postby Patricio Avalos Aguirre » Fri Sep 09, 2011 9:03 pm

Gracias Antonio, funciono perfect

ahora continuando con las otras librerias :-)
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: Harbour 3.0

Postby lucasdebeltran » Sat Sep 10, 2011 9:20 am

Antonio,

Code: Select all  Expand view
Vamos a intentar publicar aqui la lista de novedades sustanciales.
 


Hay algún avance?.

Gracias.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Harbour 3.0

Postby Carlos Mora » Sat Sep 10, 2011 5:58 pm

Paco,

Francisco Horta wrote:Antonio,,
La migracion de xHarbour a Harbour pudiera ser en unos dias, pero la conversion de las clases que unicamente son soportadas por xHarbour como TMySql y mas... tambien funcionarian con Harbour 3.1?

Hay una TMySql en las contribs de Harbour, supongo (no estoy seguro) que deben ser muy parecidas. Al recopilarla ¿Te da algún fallo?

Un saludo
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: Harbour 3.0

Postby Antonio Linares » Sat Sep 10, 2011 6:01 pm

Lucas,

Lo hemos pedido a la lista de desarrollo pero nadie se ha arrancado a hacer dicho resumen:

http://groups.google.com/group/harbour-devel/msg/22676fad08ee4fae
http://groups.google.com/group/harbour-devel/msg/5d9138f26028d493
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.0

Postby lucasdebeltran » Sun Sep 11, 2011 10:04 am

Antonio,

Muchas gracias por tus esfuerzos.

Quízás podría hacerse únicamente señalando las 10-15 novedades más importantes y que seguro conoces al seguir la evolución del producto.

También me gustaría señalar que mientras con las nuevas versiones pasadas de Harbour no hay prácticamente problemas, lo contrario sucede con xHarbour, que sigue en la versión 1.20. Quizás podría explicarse a los usuarios de xHarbour las ventajas de pasarse también a Harbour.

Finalmente, me gustaría preguntarte dos cosas:

¿Qué compilador y qué versión usa Microsoft para construir Windows 7?.
¿Qué compilador se usa para construir MinGc?.

Gracias Maestro.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Harbour 3.0

Postby Antonio Linares » Sun Sep 11, 2011 11:35 am

Lucas,

Es casi imposible resumir todo lo hecho en esta nueva version. Los cambios más interesantes, en mi opinion, son los realizados por Przemek.

Aqui esta el changelog, haced una busqueda por Przemyslaw y os aparecen un montón de cambios realmente importantes:
http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/ChangeLog?revision=17036&view=markup

No se que compilador se usa para construir Windows, ni MinGc :-) Posiblemente en http://stackoverflow.com te puedan decir algo
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests