FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Browse con Vista de Window 7
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Browse con Vista de Window 7
Posted: Tue Feb 02, 2010 12:27 PM
Antonio
Estoy usando la funci贸n que nos pasaste para que la barra se vea como Windows 7
Funciona bien, lo que quiero es que la primera columna sea de otro color.
Hago lo siguiente:

Code (fw): Select all Collapse
Function Muestra(aTexto)
聽 聽 聽 聽DEFINE FONT oBig 聽NAME "Courier New" SIZE 聽0,-13
聽 聽 聽 聽DEFINE FONT oFont NAME "Courier New" SIZE 0,-11
聽 聽 聽 聽DEFINE FONT oFont1 NAME "Arial" SIZE 4, -9.8
聽 聽 聽 聽DEFINE DIALOG oDlgView FROM nDWTop, nDWLeft TO nDWBottom, nDWRight PIXEL TITLE "Muestra archivo "
聽 聽 聽 
聽 聽 聽 聽 聽oBrw1:= TXBrowse():New( oDlgView )
聽 聽 聽 聽 聽WITH OBJECT oBrw1
聽 聽 聽 聽 聽 聽 :nMarqueeStyle := MARQSTYLE_HIGHLROW
聽 聽 聽 聽 聽 聽 :lRecordSelector:=.F.
聽 聽 聽 聽 聽 聽 :nFreeze:=1
聽 聽 聽 聽 聽 聽 :nColSel:=2
聽 聽 聽 聽 聽 聽 :nHeaderHeight:=8
聽 聽 聽 聽 聽 聽 :lTransparent=.T.
聽 聽 聽 聽 聽 聽 :SetArray( aTexto,.T. )
聽 聽 聽 聽 聽END
聽 聽 聽 聽 聽
聽 聽 聽 聽 聽oBrw1:aCols[1]:cHeader:=.F. 
聽 聽 聽 聽 聽oBrw1:aCols[1]:nWidth:=25
聽 聽 聽 聽 聽oBrw1:aCols[1]:oDataFont:=oFont1
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oBrw1:aCols[1]:cOrder:="D"
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oBrw1:aCols[1]:nDataStrAlign:=AL_RIGHT
聽 聽 聽 聽 oBrw1:aCols[1]:bClrStd:={|| {CLR_GRAY,nRGB(230,230,240)} }
聽 聽 聽 聽 聽
聽 聽 聽 聽 聽oBrw1:aCols[2]:cHeader := .F.
聽 聽 聽 聽 聽oBrw1:aCols[2]:oDataFont:= { || iif( lFont,oFont,oBig) }

聽 聽 聽 聽 聽AEval( oBrw1:aCols, { | oCol | oCol:bPaintText := { | oCol, hDC, cData, aRect | PaintCol( oCol, hDC, cData, aRect ) } } )
聽 聽 
聽 聽 聽 聽oBrw1:CreateFromCode()
聽 聽 聽 
聽 聽 聽ACTIVATE DIALOG oDlgView 

Return Nil
...

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( ROUNDBOX )
{
聽 聽HDC hDC = ( HDC ) hb_parni( 1 );
聽 聽HBRUSH hBrush = ( HBRUSH ) GetStockObject( 5 );
聽 聽HBRUSH hOldBrush = ( HBRUSH ) SelectObject( hDC, hBrush );
聽 聽HPEN hPen, hOldPen ; 

聽 聽if( hb_pcount() > 8 )
聽 聽 聽 hPen = CreatePen( PS_SOLID, hb_parnl( 9 ), ( COLORREF ) hb_parnl( 8 ) );
聽 聽else
聽 聽 聽 hPen = CreatePen( PS_SOLID, 1, ( COLORREF ) hb_parnl( 8 ) );
聽 聽
聽 聽hOldPen = ( HPEN ) SelectObject( hDC, hPen );
聽 聽hb_retl( RoundRect( hDC ,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 2 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 3 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 4 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 5 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 6 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽hb_parni( 7 ) ) );

聽 聽SelectObject( hDC, hOldBrush );
聽 聽DeleteObject( hBrush );
聽 聽SelectObject( hDC, hOldPen );
聽 聽DeleteObject( hPen );
}

#pragma ENDDUMP
*
function PaintCol( oCol, hDC, cData, aRect )

聽 聽if oCol:oBrw:VGetPos() == oBrw1:nArrayAt //Cust->( OrdKeyNo() )
聽 聽 聽 GradientFill( hDC, aRect[ 1 ] - 2, aRect[ 2 ] - 3, aRect[ 3 ] + 1, aRect[ 4 ] + 5,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 { { 1, RGB( 220, 235, 252 ), RGB( 193, 219, 252 ) } }, .T. )
聽 聽 聽 SetBkMode( hDC, 1 )
聽 聽 聽 RoundBox( hDC, 2, aRect[ 1 ] - 1, WndWidth( oCol:oBrw:hWnd ) - 22, aRect[ 3 ] + 1, 2, 2,;
聽 聽 聽 聽 聽 聽 聽 聽 RGB( 235, 244, 253 ), 1 ) 
聽 聽 聽 RoundBox( hDC, 1, aRect[ 1 ] - 2, WndWidth( oCol:oBrw:hWnd ) - 21, aRect[ 3 ] + 2, 2, 2,;
聽 聽 聽 聽 聽 聽 聽 聽 RGB( 125, 162, 206 ), 1 ) 
聽 聽endif

聽 聽SetTextColor( hDC, 0 )
聽 聽DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )

return nil

El resultado es:


Gracias por ayuda

Saludos

Adhemar
Saludos,



Adhemar C.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Browse con Vista de Window 7
Posted: Tue Feb 02, 2010 01:39 PM

Adhemar,

En la llamada a RoundBox() cambia el valor aRect[ 1 ] - 1 por oBrw1:aCols[1]:nWidth y asi el pintado se har谩 a continuaci贸n de la primera columna.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Browse con Vista de Window 7
Posted: Tue Feb 02, 2010 02:37 PM

Gracias Distinguido

Hice el cambio, pero no varia nada.

?oBrw1:aCols[1]:nWidth da un valor de 25

Gracias de nuevo

Saludos

Adhemar

Saludos,



Adhemar C.
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Browse con Vista de Window 7
Posted: Tue Feb 02, 2010 04:00 PM
Cambiandole el segundo valor 2 de RoundBox() por oBrw1:aCols[1]:nWidth

con el parametro lTransparent:=.T.
Sale asi:


sin el parametro lTransparent:=.T.

Sale asi:



La primer columna sale de otro color pero mantiene el pintado del puntero.

Gracias por la ayuda

Saludos

Adhemar
Saludos,



Adhemar C.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Browse con Vista de Window 7
Posted: Wed Feb 03, 2010 12:46 AM

Adhemar,

Disculpa, hay que cambiar tambien el valor de llamada a GradientFill(), cambiando aRect[ 1 ] - 2 de igual forma

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Browse con Vista de Window 7
Posted: Wed Feb 03, 2010 01:15 PM

Gracias Distinguido

Ahora empieza desde la 2da. columna, el problema ahora es el ltransparent con .T. no muestra la 1ra. con fondo gris, con .F. muestra gris pero mantiene el pintado del puntero.

Saludos

Adhemar

Saludos,



Adhemar C.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Browse con Vista de Window 7
Posted: Wed Feb 03, 2010 01:51 PM

Adhemar,

Puedes a帽adir otra llamada a GradientFill() para que rellene la zona de la primera columna, con las coordenadas de la primera columna.

Tenemos libertad de dibujar como queramos ahi :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Browse con Vista de Window 7
Posted: Wed Feb 03, 2010 04:06 PM
Gracias Distinguido

Lo logr茅 haciendo otro Gradientfill como me indico el resultado es:

No me aparece la enumeraci贸n completa, pero creo que se ve bien.

como es una tabla y est谩 ordena por la enumeraci贸n cuandoy pulso 011 me sale as铆:


Tengo que dar un Click sobre la l铆nea para que recien la pinte con el gradient.

Gracias una vez mas por sus ayuda y su tiempo

Saludos

Adhemar
Saludos,



Adhemar C.

Continue the discussion