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
Elias Abrão Júnior
TSBROWSE
Re: TSBROWSE
Hi Elias, you can try something like this: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
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 ] ) }
"fChangeOrder()" would be the function where you change the index
Regards.
Manuel Mercado
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 } } )
*************************************
********************************
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 } } )
*************************************
Elias Abrão Júnior
Indaiatuba - SP - Brasil
XHarbour 1.10 - Fivewin 2.5 - xMate
Indaiatuba - SP - Brasil
XHarbour 1.10 - Fivewin 2.5 - xMate