sort up/down xbrowse error function sort

sort up/down xbrowse error function sort

Postby Silvio.Falconi » Tue Feb 28, 2023 11:18 am

on first column of xbrowse I have an black arrow to sort the dbf

Image


initial run ok , them when I click on header it refresh the oBrw but not the nHeadBmpNo why ?

look this sample

Code: Select all  Expand view  RUN


#include "fivewin.ch"


REQUEST DBFCDX

function Main()

   local oDlg, oBrw
   local oDbf
   local nOrder:= 1

   oDbf :=TDatabase():Open( , "Customer", "DBFCDX", .T. )
   oDbf:setorder(1)

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oDbf AUTOCOLS AUTOSORT CELL LINES NOBORDER

   WITH OBJECT oBrw
      *:AddBitmap( { "sort_up.bmp","sort_down.bmp" } )
      :AddBitmap( { , } )

      WITH OBJECT  oBrw:aCols[1]
              :AddBitmap( { "sort_up.bmp","sort_down.bmp" } )
              :nHeadBmpNo := iif( nOrder == 1, 1, 2 )
              :bLClickHeader :={ || SortDbf(2,oBrw,oDbf ) }
           END
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT (   DeleteObject( oBrw:aSortBmp[ 1, 1 ] ), ;
                  DeleteObject( oBrw:aSortBmp[ 2, 1 ] ), ;
                  oBrw:aSortBmp := oBrw:aBitmaps, ;
                  oBrw:aBitmaps := {} )

   return nil

   FUNCTION SortDbf(nOrden, oBrw, oDbf )
   LOCAL nRecno := oDbf:RecNo()
   LOCAL nLen   := Len( oBrw:aCols )
   LOCAL n
   local nBmp

   FOR n := 1 TO nLen
  *    IF oBrw:aCols[ n ]:nHeadBmpNo != NIL .AND. oBrw:aCols[ n ]:nHeadBmpNo > 0
         IF oBrw:aCols[ n ]:Cargo == nOrden
            oBrw:aCols[ n ]:nHeadBmpNo := 1
            nBmp:= 1
             oDbf:Gotop()
            ELSE
               oBrw:aCols[ n ]:nHeadBmpNo := 2
               nBmp:= 2
              oDbf:GoBottom()
            ENDIF
            *  ENDIF
           * oBrw:aCols[1]:bOnChange := {|o|o:oBrw:RefreshHeaders()}
    NEXT
       oBrw:RefreshHeaders()
    //  oBrw:SetSortBmp( ".\bitmaps\sort_up.bmp",".\bitmaps\sort_down.bmp" )

      oBrw:Refresh( .T. )
      oBrw:SetFocus( .T. )
      RETURN nBmp

 


give me error
Error description: Error BASE/1075 Argument error: >
Args:
[ 1] = B {|| ... }
[ 2] = N 0
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests