- Code: Select all Expand view
#include 'fivewin.ch'
#define DT_TOP 0x0000
#define DT_LEFT 0x0000
#define DT_CENTER 0x0001
#define DT_RIGHT 0x0002
#define DT_VCENTER 0x0004
#define DT_BOTTOM 0x0008
#define DT_WORDBREAK 0x0010
#define DT_SINGLELINE 0x0020
#define DT_EXPANDTABS 0x0040
#define DT_TABSTOP 0x0080
#define DT_NOCLIP 0x0100
#define DT_EXTERNALLEADING 0x0200
#define DT_CALCRECT 0x0400
#define DT_NOPREFIX 0x0800
#define DT_INTERNAL 0x1000
//----------------------------------------------------------------------------//
Function Main()
Local i
Local oDlg
Local n := 130
Local aConceptos := CargaArray()
Define Dialog oDlg From 100, 100 To 800, 750 Pixel Style nOr( WS_POPUP ) Color 0, CLR_WHITE Transparent
For i := 1 To Len( aConceptos )
@ n, 40 Say aConceptos[ i ][ 1 ] Size 120, 10 Pixel Of oDlg
n += 10
Next i
Activate Dialog oDlg Centered On Paint DibujaFactura( oDlg ) Valid ( .t. ) //NoWait
Return 0
//----------------------------------------------------------------------------//
Function DibujaFactura( oDlg )
Local oFont1
Local oFont2
Local nOldPen
Local hOldBrush
Local hDc := oDlg : GetDC()
Local hPen := CreatePen( PS_SOLID, 1.5, Rgb( 0, 0, 0 ) )
Local hPen1 := CreatePen( PS_SOLID, 1, Rgb( 170, 170, 170 ) )
Local aRect := GetClientRect( oDlg : hWnd )
Local hBrush := CreateSolidBrush( RGB( 240, 240, 240 ) )
Define Font oFont1 Name "Ms Sans Seriff" Size 0, -38 Bold
Define Font oFont2 Name "Segoe UI" Size 0, -18 //Bold
nOldPen := SelectObject( hDc, hPen1 )
Rectangle( hDC, aRect[ 1 ],;
aRect[ 2 ],;
aRect[ 3 ],;
aRect[ 4 ] )
SelectObject( hDc, hPen )
Rectangle( hDC, aRect[ 1 ] + 10,;
aRect[ 2 ] + 10,;
aRect[ 3 ] - 10,;
aRect[ 4 ] - 10 )
Rectangle( hDC, aRect[ 1 ] + 30,;
oDlg : nWidth / 2 - 25,;
aRect[ 1 ] + 80,;
oDlg : nWidth / 2 + 25 )
hOldBrush := SelectObject( hDc, hBrush )
Rectangle( hDC, 200, 10, 230, oDlg : nWidth - 10 )
SelectObject( hDc, hOldBrush )
MoveTo( hDc, 10, 130 )
LineTo( hDc, oDlg : nWidth - 10, 130, hPen )
MoveTo( hDc, 10, 175 )
LineTo( hDc, oDlg : nWidth - 10, 175, hPen )
MoveTo( hDc, oDlg : nWidth / 2, 10 ) //lineas verticales cabecera
LineTo( hDc, oDlg : nWidth / 2, 30 ) //lineas verticales cabecera
MoveTo( hDc, oDlg : nWidth / 2, 80 ) //lineas verticales cabecera
LineTo( hDc, oDlg : nWidth / 2, 130 ) //lineas verticales cabecera
MoveTo( hDc, 10, 590 )
LineTo( hDc, oDlg : nWidth - 10, 590, hPen )
MoveTo( hDc, 535, 200 ) //lineas verticales
LineTo( hDc, 535, 590 ) //lineas verticales
oFont1 : Activate( hDc )
DrawTextEx( hDC, 'C', { 32, 15, 70, aRect[ 4 ] - 17 }, DT_CENTER + DT_VCENTER )
SelectObject( hDc, nOldPen )
DeleteObject( hPen )
DeleteObject( hPen1 )
DeleteObject( hBrush )
oDlg : ReleaseDc()
oFont1 : End()
oFont2 : End()
Return 0
//----------------------------------------------------------------------------//
Function CargaArray()
Local aArray := { { '1001', 'ELEMENTO 1', 1500, 0.00 },;
{ '1002', 'ELEMENTO 2', 1600, 0.00 },;
{ '1003', 'ELEMENTO 3', 0.00, 1800 } }
Return aArray
Alguna idea, Muchísimas gracias