Code: Select all
//----------------------------------------------------------------------------//
function ShowItem( i, nArea, cAreaIni, aFirst, nElemente, aIniEntries, nIndex )
local cTyp, cName, nTop, nLeft, nWidth, nHeight, nFont, oFont, hDC, nTrans, lTrans
local nColText, nColPane, nOrient, cFile, nBorder, nColor, nColFill, nStyle, nPenWidth
local nRndWidth, nRndHeight, nBarcode, nPinWidth, cItemDef
local lRight := .F.
local lCenter := .F.
local cTool := ""
/*
// Text : say| name| ID| show| deleteable| editable| top| left| width| height| font| text color| background color| orientation | border | transparent
// Image : say| name| ID| show| deleteable| editable| top| left| width| height| filename| border
// Graphic: say| style| ID| show| deleteable| editable| top| left| width| height| color | fill color | Style | Pen Size
// Barcode: say| value| ID| show| deleteable| editable| top| left| width| height| barcode font | color | fill color | orientation | transparent | Pin width
*/
if aIniEntries = NIL
cItemDef := AllTrim( GetPvProfString( "Items", AllTrim(STR(i,5)) , "", cAreaIni ) )
ELSE
cItemDef := GetIniEntry( aIniEntries,, "",, nIndex )
endif
if .NOT. EMPTY( cItemDef ) .AND. VAL( GetField( cItemDef, 4 ) ) <> 0
cTyp := UPPER(AllTrim( GetField( cItemDef, 1 ) ))
cName := GetField( cItemDef, 2 )
nTop := oER:nRulerTop + ER_GetPixel( VAL( GetField( cItemDef, 7 ) ) )
nLeft := oER:nRuler + ER_GetPixel( VAL( GetField( cItemDef, 8 ) ) )
nWidth := ER_GetPixel( VAL( GetField( cItemDef, 9 ) ) )
nHeight := ER_GetPixel( VAL( GetField( cItemDef, 10 ) ) )
if aFirst[1] = .F.
aFirst[2] := nTop
aFirst[3] := nLeft
aFirst[4] := nWidth
aFirst[5] := nHeight
aFirst[6] := i
aFirst[1] := .T.
endif
if cTyp = "TEXT"
nFont := VAL( GetField( cItemDef, 11 ) )
nColText := VAL( GetField( cItemDef, 12 ) )
nColPane := VAL( GetField( cItemDef, 13 ) )
nOrient := VAL( GetField( cItemDef, 14 ) )
nBorder := VAL( GetField( cItemDef, 15 ) )
nTrans := VAL( GetField( cItemDef, 16 ) )
oFont:= IIF( nFont = 0, oEr:oAppFont, oER:aFonts[nFont] )
lCenter := IIF( nOrient = 2, .T. , .F. )
lRight := IIF( nOrient = 3, .T. , .F. )
SetBKMode( oEr:oMainWnd:hDC, 1 )
/*
aItems[nArea,i] := TSSay():New( nTop, nLeft, ;
{|| cName }, aWnd[nArea],, oFont,,, ;
lCenter, lRight,, .T., .T., nColText, nColPane,, ;
nWidth, nHeight, .F., .T., .F., .F., .F., IIF( nTrans = 1, .T., .F. ) )
*/
aItems[nArea,i] := TSay():New( nTop, nLeft, ;
{|| cName }, aWnd[nArea], , oFont, ;
lCenter, lRight, ( nBorder = 1 .OR. oGenVar:lShowBorder ), .T., ;
oER:GetColor( nColText ), oER:GetColor( nColPane ), nWidth, nHeight, .F., .T., .F., .F., .F. )
SetBKMode( oEr:oMainWnd:hDC, 0 )
cTool := " Tipo: " + Chr( 9 ) + "TSAY" + CRLF + ;
" Top: " + Chr( 9 ) + Str( nTop, 10 ) + CRLF + ;
" Left: " + Chr( 9 ) + Str( nLeft, 10 ) + CRLF + ;
" Width: " + Chr( 9 ) + Str( nWidth, 10 ) + CRLF + ;
" Height: " + Chr( 9 ) + Str( nHeight, 10 ) + CRLF + ;
" Contenido " + Chr( 9 ) + cName + CRLF + ;
" Font: " + Chr( 9 ) + oFont:cFaceName + CRLF + ;
" Font: " + Chr( 9 ) + Str( oFont:nHeight, 10 ) + CRLF + ;
" Color Texto: " + Chr( 9 ) + Str( oER:GetColor( nColText ), 10 ) + CRLF + ;
" Color Fondo: " + Chr( 9 ) + Str( oER:GetColor( nColPane ), 10 ) + CRLF + ;
" Alineacion: " + Chr( 9 ) + if( nOrient = 1, "LEFT",if( nOrient = 2, "CENTER", "RIGHT") ) + CRLF + ;
" Border: " + Chr( 9 ) + if( ( nBorder = 1 .OR. oGenVar:lShowBorder ), " SI ", " NO ") + CRLF + ;
" Transparente:" + Chr( 9 ) + iif( nTrans = 1, " SI ", " NO " ) + CRLF
/*
[ <oSay> := ] TSay():New( <nRow>, <nCol>, <{cText}>,;
[<oWnd>], [<cPict>], <oFont>, <.lCenter.>, <.lRight.>, <.lBorder.>,;
<.lPixel.>, <nClrText>, <nClrBack>, <nWidth>, <nHeight>,;
<.design.>, <.update.>, <.lShaded.>, <.lBox.>, <.lRaised.> )
*/
ELSEif cTyp = "IMAGE"
cFile := AllTrim( GetField( cItemDef, 11 ) )
nBorder := VAL( GetField( cItemDef, 12 ) )
aItems[nArea,i] := TImage():New( nTop, nLeft, nWidth, nHeight,,, ;
IIF( nBorder = 1, .F., .T.), aWnd[nArea],,, .F., .T.,,, .T.,, .T. )
aItems[nArea,i]:Progress(.F.)
aItems[nArea,i]:LoadBmp( VRD_LF2SF( cFile ) )
cTool := " Tipo: " + Chr( 9 ) + "TIMAGE" + CRLF + ;
" Top: " + Chr( 9 ) + Str( nTop, 10 ) + CRLF + ;
" Left: " + Chr( 9 ) + Str( nLeft, 10 ) + CRLF + ;
" Width: " + Chr( 9 ) + Str( nWidth, 10 ) + CRLF + ;
" Height: " + Chr( 9 ) + Str( nHeight, 10 ) + CRLF + ;
" Contenido " + Chr( 9 ) + cFile + CRLF + ;
" Border: " + Chr( 9 ) + if( ( nBorder = 1 .OR. oGenVar:lShowBorder ), " SI ", " NO ") + CRLF
/*
[ <oBmp> := ] TImage():New( <nRow>, <nCol>, <nWidth>, <nHeight>,;
<cResName>, <cBmpFile>, <.NoBorder.>, <oWnd>,;
[\{ |nRow,nCol,nKeyFlags| <uLClick> \} ],;
[\{ |nRow,nCol,nKeyFlags| <uRClick> \} ], <.scroll.>,;
<.adjust.>, <oCursor>, <cMsg>, <.update.>,;
<{uWhen}>, <.pixel.>, <{uValid}>, <.lDesign.> )
*/
ELSEif IsGraphic( cTyp )
nColor := VAL( GetField( cItemDef, 11 ) )
nColFill := VAL( GetField( cItemDef, 12 ) )
nStyle := VAL( GetField( cItemDef, 13 ) )
nPenWidth := VAL( GetField( cItemDef, 14 ) )
nRndWidth := ER_GetPixel( VAL( GetField( cItemDef, 15 ) ) )
nRndHeight := ER_GetPixel( VAL( GetField( cItemDef, 16 ) ) )
aItems[nArea,i] := TBitmap():New( nTop, nLeft, nWidth, nHeight, "GRAPHIC",, ;
.T., aWnd[nArea],,, .F., .T.,,, .T.,, .T. )
aItems[nArea,i]:lTransparent := .T.
aItems[nArea,i]:bPainted = {| hDC, cPS | ;
DrawGraphic( hDC, cTyp, nWidth, nHeight, oER:GetColor( nColor ), oER:GetColor( nColFill ), ;
nStyle, nPenWidth, nRndWidth, nRndHeight ) }
cTool := " Tipo: " + Chr( 9 ) + "GRAPHIC" + CRLF + ;
" Top: " + Chr( 9 ) + Str( nTop, 10 ) + CRLF + ;
" Left: " + Chr( 9 ) + Str( nLeft, 10 ) + CRLF + ;
" Width: " + Chr( 9 ) + Str( nWidth, 10 ) + CRLF + ;
" Height: " + Chr( 9 ) + Str( nHeight, 10 ) + CRLF + ;
" Contenido " + Chr( 9 ) + " " + CRLF + ;
" Color: " + Chr( 9 ) + Str( oER:GetColor( nColor ), 10 ) + CRLF + ;
" Color Fondo: " + Chr( 9 ) + Str( oER:GetColor( nColFill ), 10 ) + CRLF + ;
" Border: " + Chr( 9 ) + if( ( nBorder = 1 .OR. oGenVar:lShowBorder ), " SI ", " NO ") + CRLF + ;
" Transparente:" + Chr( 9 ) + if( aItems[nArea,i]:lTransparent, " SI ", " NO " ) + CRLF
ELSEif cTyp = "BARCODE" .AND. lProfi
nBarcode := VAL( GetField( cItemDef, 11 ) )
nColText := VAL( GetField( cItemDef, 12 ) )
nColPane := VAL( GetField( cItemDef, 13 ) )
nOrient := VAL( GetField( cItemDef, 14 ) )
lTrans := IIF( VAL( GetField( cItemDef, 15 ) ) = 1, .T., .F. )
nPinWidth := ER_GetPixel( VAL( GetField( cItemDef, 16 ) ) )
aItems[nArea,i] := TBitmap():New( nTop, nLeft, nWidth, nHeight, "GRAPHIC",, ;
.T., aWnd[nArea],,, .F., .T.,,, .T.,, .T. )
aItems[nArea,i]:lTransparent := .T.
aItems[nArea,i]:bPainted = {| hDC, cPS | ;
DrawBarcode( hDC, cName, 0, 0, nWidth, nHeight, nBarCode, oER:GetColor( nColText ), ;
oER:GetColor( nColPane ), nOrient, lTrans, nPinWidth ) }
cTool := " Tipo: " + Chr( 9 ) + "BARCODE" + CRLF + ;
" Top: " + Chr( 9 ) + Str( nTop, 10 ) + CRLF + ;
" Left: " + Chr( 9 ) + Str( nLeft, 10 ) + CRLF + ;
" Width: " + Chr( 9 ) + Str( nWidth, 10 ) + CRLF + ;
" Height: " + Chr( 9 ) + Str( nHeight, 10 ) + CRLF + ;
" Contenido " + Chr( 9 ) + cName + CRLF + ;
" Color: " + Chr( 9 ) + Str( oER:GetColor( nColText ), 10 ) + CRLF + ;
" Color Fondo: " + Chr( 9 ) + Str( oER:GetColor( nColPane ), 10 ) + CRLF + ;
" Border: " + Chr( 9 ) + if( ( nBorder = 1 .OR. oGenVar:lShowBorder ), " SI ", " NO ") + CRLF + ;
" Transparente:" + Chr( 9 ) + if( lTrans, " SI ", " NO " ) + CRLF
endif
if cTyp = "BARCODE" .AND. lProfi = .F.
//Dummy
ELSE
aItems[nArea,i]:lDrag := .T.
ElementActions( aItems[nArea,i], i, cName, nArea, cAreaIni, cTyp )
endif
++nElemente
endif
if Valtype( aItems[nArea,i] ) = "O"
aItems[nArea,i]:cToolTip := cTool
endif
return .T.
//----------------------------------------------------------------------------//