Xbrowse header's sort bitmap

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

Xbrowse header's sort bitmap

Post by Marcelo Via Giglio »

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

DATA lSortBmp  INIT .T.
 
then in the xBrowse sorce

In new Method add IF...

Code: Select all

   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

   IF ::lSortBmp
      DeleteObject( ::aSortBmp[ 1 ][ 1 ] )
      DeleteObject( ::aSortBmp[ 2 ][ 1 ] )
   ENDIF
 
In METHOD HeaderWidth CLASS TXBrwColumn modify

Code: Select all

   
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

      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
Post Reply