Page 1 of 1

TSBROWSE

Posted: Mon Jun 16, 2008 12:15 pm
by Eajunior
I would like to click the right mouse button on the Browse Header and reverse the order (ORDDESCEND) and also could be put in a header arrow up or down in the index active :oops:

Elias Abrão Júnior

Re: TSBROWSE

Posted: Mon Jun 16, 2008 9:19 pm
by mmercado
Eajunior wrote:I would like to click the right mouse button on the Browse Header and reverse the order (ORDDESCEND) and also could be put in a header arrow up or down in the index active
Hi Elias, you can try something like this:

Code: Select all

DEFINE BITMAP aBmp[ 1 ] RESOURCE "DownArrow"
DEFINE BITMAP aBmp[ 2 ] RESOURCE "UpArrow"
lAscend := .T.
.....
....
oBrw:aColumns[ nCol ]:bRClicked := {|| lAscend := ! lAscend, fChangeOrder() }
oBrw:aColumns[ nCol ]:uBmpHead := {||If( lAscend, aBmp[ 1 ], aBmp[ 2 ] ) }

"nCol" would be the column you want to right click for index changing
"fChangeOrder()" would be the function where you change the index

Regards.

Manuel Mercado

Posted: Mon Jun 23, 2008 11:13 pm
by Eajunior
how can I do to change the column of bitmaps according to the index active, as prg below

********************************
REDEFINE BROWSE oTbr ALIAS "Estoque" ID 100 OF oDlg

ADD COLUMN TO oTbr HEADER "Código" SIZE 125 ALIGN DT_LEFT ORDER "Codigo" DATA TransField( Estoque->Est_Cod, oPub:wEstPic )
ADD COLUMN TO oTbr HEADER "Descrição" SIZE 376 ALIGN DT_LEFT ORDER "Nome" DATA Estoque->Est_Nom
ADD COLUMN TO oTbr HEADER "Grupo" SIZE 205 ALIGN DT_LEFT ORDER "Grupo" DATA Fetch( Estoque->Est_GruCod , "GrupoProduto", "Est_GruNom", "Codigo" )
ADD COLUMN TO oTbr HEADER "Fabricante" SIZE 165 ALIGN DT_LEFT ORDER "Marca" DATA Fetch( "201" + Estoque->Est_FabCod, "TabArray" , "Tab_Nom" , "Codigo" )
ADD COLUMN TO oTbr HEADER "Familia" SIZE 97 ALIGN DT_LEFT DATA ASeek( Estoque->Est_FamCod, oPub:aCodFamilia, oPub:aTabFamilia )

oTbr:cAlias := "Estoque"
oTbr:nHeightHead := 30
oTbr:nHeightCell := 25
oTbr:l2007 := True
oTbr:aColumns[1]:lSeek := True
oTbr:aColumns[2]:lSeek := True
oTbr:bKeyDown := {|nKey| IIF( nKey == VK_RETURN, Estoque_Consulta( oTbr, oVar ), ) }
oTbr:bLDblClick := {|| Estoque_Consulta( oTbr, oVar ) }

oTbr:ChangeFont( oPub:hFntBarra, , 2 )
oTbr:SetIndexCols( 1, 2 )
oTbr:SetColor( { 2, 4, 5, 6, 11, 12, 14, 15 } ,;
{ {|| IF( oTbr:nLogicPos % 2 = 0, oPub:nClrBrw1, oPub:nClrBrw2 ) },;
{ GetSysColor(9), CLR_HGRAY } ,;
{ CLR_BLACK } ,;
{ nRgb( 254,112,0 ), nRgb( 251,219,181 ) } ,;
{ CLR_BLACK } ,;
{ nRgb( 254,112,0 ), nRgb( 251,219,181 ) } ,;
{ GetSysColor(9), CLR_YELLOW } ,;
{ CLR_GRAY } } )
*************************************