XBROWSE transparente

XBROWSE transparente

Postby Modesto » Wed Feb 10, 2021 11:17 pm

Estimados amigos un saludo cordial.

Trabajo en windows 10, con fwh 21.01

Se ha definido una ventana con una imagen de fondo (:oBrush)
luego se define un xBrowse en modo transparente. Es decir :
@ 149, 12 XBROWSE ::oBrwsVta Of ::oWndMain ARRAY {} SIZE 913,247 FONT oFnt PIXEL COLORS CLR_BLACK FASTEDIT NOBORDER TRANSPARENT
(no defino ninguna imagen de fondo para este browse)

xBrowse pinta el fondo del area de datos con la imagen de fondo de la ventana a partir de la ultima fila; con la versión 20.01 no hay ningún problema, el fondo del xbrowse es transparente y deja ver el fondo de la imagen del área que ocupa ( el browse ) en la ventana.
Con la versión 20.12 y 21.01 xBrowse pinta el fondo del area de datos que ocupa con la imagen de la ventana desde inicio.
Empieza a pintar después de la ultima fila con la imagen la ventana empezando de la esquina superior izquierda.

Como puedo solucionar este detalle ?.

Muchas gracias por su tiempo.
Modesto
 
Posts: 7
Joined: Sat Mar 29, 2014 5:54 pm

Re: XBROWSE transparente

Postby Modesto » Thu Feb 11, 2021 1:29 am

Mr Rao.
Encontré la solución.
::bPaintBack := {|| aOrg := SetBrushOrgEx( ::hDC, nBmpWidth( ::oWnd:oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oWnd:oBrush:hBitmap ) - ::nTop ),
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oWnd:oBrush:hBrush ),
SetBrushOrgEx( ::hDC, aOrg[ 1 ], aOrg[ 2 ] ) }

Aparentemente en el método Paint(), el dato ::lTransparent toma dato negativo y ejecuta el otro proceso. (posiblemente)
No comprendo el porque, pero esta parte de código no se ejecuta como esperaba.
Si ::lTransparent == true y no se ha definido ninguna imagen de fondo para xBrowse, tendría que seguir las líneas de código en negrillas.

METHOD Paint() CLASS TXBrowse
...
....
// Paint Background
if ::bPaintBack != nil
Eval( ::bPaintBack, Self )
else
if ::lTransparent .and. Empty( ::oBrush:hBitmap )
if ! Empty( ::oWnd:oBrush:hBitmap )
aOrg := SetBrushOrgEx( ::hDC, nBmpWidth( ::oWnd:oBrush:hBitmap ) - ::nLeft, ;
nBmpHeight( ::oWnd:oBrush:hBitmap ) - ::nTop )
endif
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oWnd:oBrush:hBrush )
SetBrushOrgEx( ::hDC, aOrg[ 1 ], aOrg[ 2 ] )

else
oRect := ::DataRect()
aOrg := SetBrushOrgEx( ::hDC, oRect:nLeft, oRect:nTop )
FillRect( ::hDC, oRect:aRect, ::oBrush:hBrush )
SetBrushOrgEx( ::hDC, aOrg[ 1 ], aOrg[ 2 ] )
endif
endif
// Paint Background end
.....
..
.
Mr Rao, muchas gracias por su tiempo, espero que se pueda dar una mejor salida de la que he podido encontrar por ahora.
Amigos muchas gracias por su tiempo.
Modesto
 
Posts: 7
Joined: Sat Mar 29, 2014 5:54 pm

Re: XBROWSE transparente

Postby nageswaragunupudi » Fri Feb 12, 2021 5:04 pm

I will check and come back.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE transparente

Postby nageswaragunupudi » Sat Feb 13, 2021 10:14 am

con la versión 20.01 no hay ningún problema,


FWH never released version 20.01.
Do you mean FWH1912 or FWH2002 ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE transparente

Postby nageswaragunupudi » Sat Feb 13, 2021 10:41 am

We tested this program with FWH versions 1912, 2002 and 2101.
The behavior is exactly the same and correct in all versions.

Image
Image
Image

Even the dynamic behavior also is correct and as expected.

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests