Xbrowse header's sort bitmap

Xbrowse header's sort bitmap

Postby Marcelo Via Giglio » Sun Apr 06, 2014 4:10 pm

Hello,

a suggestion when we don't need or don't like to show the sort bitmap in the xbrowse's columns, we can add a

Code: Select all  Expand view  RUN

DATA lSortBmp  INIT .T.
 


then in the xBrowse sorce

In new Method add IF...
Code: Select all  Expand view  RUN

   IF ::lSortBmp
      hBmp        := FWBmpAsc()
      AAdd( ::aSortBmp, { hBmp, 0, nBmpWidth( hBmp ), nBmpHeight( hBmp ), nil, .F. } )
      hBmp        := FWBmpDes()
      AAdd( ::aSortBmp, { hBmp, 0, nBmpWidth( hBmp ), nBmpHeight( hBmp ), nil, .F. } )
   ENDIF
 


In destroy Method add IF ...
Code: Select all  Expand view  RUN

   IF ::lSortBmp
      DeleteObject( ::aSortBmp[ 1 ][ 1 ] )
      DeleteObject( ::aSortBmp[ 2 ][ 1 ] )
   ENDIF
 


In METHOD HeaderWidth CLASS TXBrwColumn modify
Code: Select all  Expand view  RUN
 
if ! Empty( aBitmap := ::aBitmap( If( ValType( ::nHeadBmpNo ) == 'B', Eval( ::nHeadBmpNo ), ::nHeadBmpNo ) ) )
      nWidth   += aBitmap[ BITMAP_WIDTH ] + BMP_EXTRAWIDTH
   elseif ! Empty( ::cSortOrder )
      nWidth += IF( ::oBrw:lSortBmp, ::oBrw:aSortBmp[ 1 ][ BITMAP_WIDTH ], 0 ) + BMP_EXTRAWIDTH // MVG
   endif
 


Finally
In METHOD PaintHeader CLASS TXBrwColumn Modify
Code: Select all  Expand view  RUN
     if ! Empty( ::cOrder ) .AND. ::oBrw:lSortBmp
         aBitmap     := ::oBrw:aSortBmp[ If( ::cOrder == 'A', 1, 2 ) ]
         nBmpAlign   := AL_RIGHT
      elseif !Empty( aBitmap := ::aBitmap( nBmpNo ) )
         nBmpAlign   := ::nHeadBmpAlign
      endif
 


I hope Fivetech can evaluate this modifications

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1065
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Return to To do - WishList / Por hacer - Peticiones

Who is online

Users browsing this forum: No registered users and 2 guests