CLIPPER FWDISPBEGI( PARAMS ) // ( hWnd, hDC ) #endif { HWND hWnd = ( HWND ) _parnl( 1 ); HDC hDC = ( HDC ) _parnl( 2 ); HDC hDC2 ; HBITMAP hBmp, hBmpOld ; RECT rct; GetClientRect( hWnd, &rct ); hDC2 = CreateCompatibleDC( hDC ); hBmp = CreateCompatibleBitmap( hDC, rct.right - rct.left, rct.bottom - rct.top ); hBmpOld = SelectObject( hDC2, hBmp ); BitBlt( hDC2, 0, 0, rct.right, rct.bottom, hDC, 0, 0, SRCCOPY ); _reta( 5 ); _stornl( (LONG) hWnd , -1, 1 ); _stornl( (LONG) hDC , -1, 2 ); _stornl( (LONG) hDC2 , -1, 3 ); _stornl( (LONG) hBmp , -1, 4 ); _stornl( (LONG) hBmpOld, -1, 5 ); return; }
//---------------------------------------------------------------------------// CLIPPER AWBRWROWDIM( void ) { HWND hWnd = (HWND) _parnl( 1 ); WORD wRow = (WORD) _parnl( 2 ); HFONT hFont = (HFONT) _parnl( 3 ); HFONT hOldFont; HDC hDC = GetDC( hWnd ); TEXTMETRIC tm; if( hFont ) hOldFont = SelectObject( hDC, hFont ); GetTextMetrics( hDC, &tm ); tm.tmHeight += 1; if( hFont ) SelectObject( hDC, hOldFont ); ReleaseDC( hWnd, hDC ); _reta( 2 ); _storni( tm.tmHeight * wRow++, -1, 1 ); _storni( tm.tmHeight * wRow, -1, 2 ); }
// Interfaz CLIPPER ALIBOFFSET( void ){ WORD i; if (wLib!=0xffff){ _reta(wModules); for (i=0;i<wModules;i++){ _stornl(alOffsets[i],-1,i+1); } return; } _ret(); return; }
CLIPPER aLibSizes( void ) { WORD i, wPrev; if ( wLib != 0xffff ) { _reta( wModules ); i = 0; do { _stornl( alOffsets[i+1] - alOffsets[i],-1,i+1); } while( ++i < wModules ); } }
CLIPPER AMODPUBLIC( void ){ WORD wModule,i,wPublics; if ((PCOUNT() >= 1) && ISNUM(1) && (wLib != 0xffff) && ((wModule=_parni(1)-1) < wModules)){ wPublics=ScanModPublics(wModule); if (wPublics > 0){ _reta(wPublics); for(i=0;i <= wPublics; i++){ _storc(pcStrings[i],-1,i+1); } FreeStrings(wPublics); return; } _ret(); return; } }
CLIPPER AMODEXTERN( void ){ WORD wModule,i,wExternals; if ((PCOUNT() >= 1) && ISNUM(1) && (wLib != 0xffff) && ((wModule=_parni(1)-1) < wModules)){ wExternals=ScanModExternals(wModule); if (wExternals > 0){ _reta(wExternals); for(i=0;i <= wExternals; i++){ _storc(pcStrings[i],-1,i+1); } FreeStrings(wExternals); return; } _ret(); return; } }
CLIPPER ALIBMODULE( void ){ BYTE acBuffer[300]; WORD i; if (wLib!=0xffff){ _reta(wModules); _tlseek(wLib,0,0); for (i=0;i<wModules;i++){ _tlseek(wLib,alOffsets[i],0); if (ReadByte() == THEADR){ if (ReadHdrRecord(acBuffer)){ _storc(acBuffer,-1,i+1); } }else{ _ret(); return; } } return; } _ret(); return; }
//---------------------------------------------------------------------------// CLIPPER WBRWRECT( void ) // ( hWnd, nRow, aSizes, nFirstItem, nCol, // nLineStyle, nWidthVScroll ) { HWND hWnd = ( HWND ) _parnl( 1 ); HDC hDC = GetDC( hWnd ); WORD wRow = _parni( 2 ); WORD wHeight ; RECT rct; WORD nStyle = ISNUM( 6 ) ? _parni( 6 ) : -1 ; // CeSoTech void * paSizes = _param( 3, S_ARRAY ); WORD wLen = _VARRAYLEN( paSizes ); WORD wIndex = _parni( 4 ); WORD wCol = _parni( 5 ); WORD wMaxRight; LONG l; if( !wCol || wCol > wLen ) return; GetWindowRect( hWnd, &rct ); wMaxRight = rct.right - 2; wHeight = wLineHeight + 1 ; rct.top = rct.top + ( bDrawHeaders ? wHeaderHeight+1 : 0 ) + (wHeight * (wRow-1) ) ; rct.bottom = rct.top + wHeight; rct.right = rct.left; while( wIndex <= wCol ) { rct.left = rct.right; rct.right = ( wIndex == wLen && bAdjLastCol ? wMaxRight : rct.left + GetInt( paSizes, wIndex ) ); if( rct.right >= wMaxRight ) { wIndex = wCol + 1; // ya no pintamos m s rct.right = wMaxRight; } else wIndex++; } ReleaseDC( hWnd, hDC ); _reta( 4 ); // Si es un estilo sin separadores horizontales, pintar uno mas arriba //CeSoTech para que que bien completa el area !!! if (nStyle == 0 || nStyle == 5 || nStyle == 6 || nStyle == 9 || nStyle == 10) rct.top-- ; // Las coord.de edicion deberan ser mas arriba tambien !!! _storni( rct.top, -1, 1 ); _storni( rct.left, -1, 2 ); _storni( rct.bottom, -1, 3 ); _storni( ( wMaxRight <= rct.right ) ? wMaxRight - _parni( 7 ) : rct.right, -1, 4 ); }
//---------------------------------------------------------------------------// CLIPPER WBRWLINE( void ) // ( hWnd, hDC, nRow, aText, aSizes, nFirstItem, ; // nClrFore, nClrBack, hFont, lTree, aJustify, nPressed, // nStyle, nColAct, lFocused ) // bTextColor, bBkColor, nClrLine, lFooter, lSelect, // bFont, lDrawFocusRect ) // New's by CesoTech { HWND hWnd = (HWND) _parnl( 1 ); HDC hDC = (HDC) _parnl( 2 ); WORD wRow = _parni( 3 ); BOOL bDestroyDC = FALSE; WORD wHeight; RECT rct, box; void * bClrFore; void * bClrBack; COLORREF clrFore = 0; COLORREF clrBack = 0; HPEN hGrayPen ; HPEN hWhitePen ; HFONT hFont = (HFONT) _parnl( 9 ); HFONT hOldFont; BOOL bTree = _parl( 10 ); BOOL bFooter = ISLOGICAL( 19 ) ? _parl( 19 ) : FALSE ; // CeSoTech WORD nHeightCtrl ; // by CeSoTech hGrayPen = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) ) ; // RGB( 128, 128, 128 ) ); hWhitePen = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNHIGHLIGHT ) ); // GetStockObject( WHITE_PEN ); if( PCOUNT() > 6 ) { if( ISBLOCK( 7 ) ) { bClrFore = _param( 7, -1 ); _cEval0( bClrFore ); clrFore = _parnl( -1 ); } else { clrFore = _parnl( 7 ); } } if( PCOUNT() > 7 ) { if( ISBLOCK( 8 ) ) { bClrBack = _param( 8, -1 ); _cEval0( bClrBack ); clrBack = _parnl( -1 ); } else { clrBack = _parnl( 8 ); } } if( ! hDC ) { bDestroyDC = TRUE; hDC = GetDC( hWnd ); } if( hFont ) hOldFont = SelectObject( hDC, hFont ); GetClientRect( hWnd, &rct ); nHeightCtrl = rct.bottom-rct.top ; // by CeSoTech SetTextColor( hDC, clrFore ); SetBkColor( hDC, clrBack ); wHeight = wLineHeight + 1 ; if ( ( wRow == 0 ) && bDrawHeaders ) // Es una Cabecera wHeight = wHeaderHeight + 1 ; if ( ! bFooter ) { if ( ( wRow == 0 ) && bDrawHeaders ) // Es una Cabecera { rct.top = 0 ; rct.bottom = wHeaderHeight + 1 ; } else { rct.top = ( bDrawHeaders ? wHeaderHeight+1 : 0 ) + (wHeight * (wRow-1) ) ; rct.bottom = ( bDrawHeaders ? wHeaderHeight+1 : 0 ) + (wHeight * wRow) ; } } else { rct.top = rct.bottom - (wFooterHeight+1) ; } rct.left = 0; PaintTheLine( hDC, &rct, _parni( 6 ), _param( 4, -1 ), _param( 5, -1 ), hWhitePen, hGrayPen, bTree, ISARRAY(11) ? _param( 11, -1 ) : 0, _parni( 12 ), (wRow == 0), _parni( 13 ), _parni( 14 ), _parl( 15 ), ISBLOCK( 16 ) ? _param( 16, -1 ) : 0, // CeSoTech ISBLOCK( 17 ) ? _param( 17, -1 ) : 0, // CeSoTech wRow, nHeightCtrl, // CeSoTech ISNUM( 18 ) ? _parnl( 18 ) : -1, // CeSoTech bFooter, // CeSoTech ISLOGICAL( 20 ) ? _parl( 20 ) : FALSE, // CeSoTech ISBLOCK( 21 ) ? _param( 21, -1 ) : 0, // CeSoTech ISLOGICAL( 22 ) ? _parl( 22 ) : FALSE );// CeSoTech DeleteObject( hGrayPen ); DeleteObject( hWhitePen ); if( hFont ) SelectObject( hDC, hOldFont ); if( bDestroyDC ) ReleaseDC( hWnd, hDC ); _reta( 2 ); _storni( rct.top, -1, 1 ); _storni( rct.bottom, -1, 2 ); }
CLIPPER HB_UNDOC9() { _reta( _parni( 1 ) ); _retnl( _parinfa( -1, 0 ) ); }
CLIPPER HB_ARRAYS1() { _reta( _parnl( 1 ) ); }
CLIPPER WBrwRect( PARAMS ) // ( hWnd, nRow, aSizes, nFirstItem, nCol, // nLineStyle, nWidthVScroll ) #endif { HWND hWnd = ( HWND ) _parnl( 1 ); HDC hDC = GetDC( hWnd ); WORD wRow = _parni( 2 ); WORD wHeight ; RECT rct; WORD nStyle = ISNUM( 6 ) ? _parni( 6 ) : -1 ; // CeSoTech #ifdef __CLIPPER__ PCLIPVAR paSizes = _param( 3, 0x8000 ); WORD wLen = _VARRAYLEN( paSizes ); #else #ifdef __HARBOUR__ // void * paSizes = ( void * ) _param( 3, HB_IT_ARRAY ); WORD wLen = _parinfa( 3, 0 ); #else void * paSizes = ( void * ) _param( 3, 0x8000 ); WORD wLen = _VARRAYLEN( paSizes ); #endif #endif WORD wIndex = _parni( 4 ); WORD wCol = _parni( 5 ); WORD wMaxRight; LONG l; if( !wCol || wCol > wLen ) return; GetWindowRect( hWnd, &rct ); wMaxRight = rct.right - 2; wHeight = wLineHeight + 1 ; rct.top = rct.top + ( bDrawHeaders ? wHeaderHeight+1 : 0 ) + (wHeight * (wRow-1) ) ; rct.bottom = rct.top + wHeight; rct.right = rct.left; while( wIndex <= wCol ) { rct.left = rct.right; #ifndef __FLAT__ rct.right = ( wIndex == wLen && bAdjLastCol ? wMaxRight : rct.left + GetInt( paSizes, wIndex ) ); #else #ifndef __HARBOUR__ #define _parnl(x,y) PARNL(x,params,y); #endif l = _parnl( 3, wIndex ); rct.right = ( wIndex == wLen && bAdjLastCol ? wMaxRight : rct.left + l ); #endif if( rct.right >= wMaxRight ) { wIndex = wCol + 1; // ya no pintamos m s rct.right = wMaxRight; } else wIndex++; } ReleaseDC( hWnd, hDC ); _reta( 4 ); #ifdef __XPP__ #define _storni( x, y, z ) STORNI( x, params, y, z ) #endif // Si es un estilo sin separadores horizontales, pintar uno mas arriba //CeSoTech para que que bien completa el area !!! if (nStyle == 0 || nStyle == 5 || nStyle == 6 || nStyle == 9 || nStyle == 10) rct.top-- ; // Las coord.de edicion deberan ser mas arriba tambien !!! _storni( rct.top, -1, 1 ); _storni( rct.left, -1, 2 ); _storni( rct.bottom, -1, 3 ); _storni( ( wMaxRight <= rct.right ) ? wMaxRight - _parni( 7 ) : rct.right, -1, 4 ); }