In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Bitmap align in browser column

Xailer professional forum in English
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Bitmap align in browser column

Mensaje por Giuseppe Bogetti »

Hi,
I have a problem with bitmap alignment in browser column.
I want to center the bitmap in the column.
Whichever value I set to :nBmpMargin the image is drawn always as in the
attache image.
In the OnInizialize method I have added this code:
// Setup alignment for bitmaps in columns
oCol := ::oBrwIndexes:aCols[ tDBFIDX_UNIQUE ]
oCol:nBmpMargin := Int( ( ( oCol:nWidth - 16 ) / 2 ) )
oCol := ::oBrwIndexes:aCols[ tDBFIDX_DESCEND ]
oCol:nBmpMargin := Int( ( ( oCol:nWidth - 16 ) / 2 ) )
To set the image index I use the following code in OnGetData :
METHOD FormIdxDescendGetData( oSender, cText, nImage ) CLASS TDbfTable
// Image index
cText := ""
IF ( Len( ::oBrwIndexes:aArrayData ) > 0 )
IF ( ::oBrwIndexes:aArrayData[ ::oBrwIndexes:nArrayAt,
tDBFIDX_DESCEND ] )
nImage := 2
ELSE
nImage := 1
ENDIF
ENDIF
RETURN Nil
I also set the OnDrawCell method to force white background of cell with
this code.
METHOD FormIdxUniqueDrawCell( oSender, cText, nClrText, nClrPane,
lHighLite ) CLASS TDbfTable
// Background color
nClrPane := clWhite
RETURN Nil
Am I doing something wrong ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
--
Responder