FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse - how to update
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
xBrowse - how to update
Posted: Fri Jul 24, 2009 06:49 PM
Hello Daniel,
would you be so kind to show me how to update the xbrowse in my special case.

I select some rows and press the button to start the function: Backuploeschen(oBrw)

But I don’t find an easy way to update the xbrowse. The code below is working but a 2. array seems a little time-consuming.

Thanks in advance,
Otto

Code (fw): Select all Collapse
  FUNCTION Backuploeschen(oBrw)
      local I       := 0
      local aTemp   := {}
      local nreturn := 0

      For I := 1 to len(aTageSort)
         aadd( aTemp, {   aTageSort[ I ][ 1 ] ,;
            aTageSort[ I ][ 2 ],;
            aTageSort[ I ][ 3 ],;
            aTageSort[ I ][ 4 ],;
            aTageSort[ I ][ 5 ],;
            aTageSort[ I ][ 6 ] } )
      next

      for I := 1 to Len( aTemp )
         if aTemp[ I,1 ] = .t.
            //      DELETEDIR( Setup():cWHBackup + '\' + aTemp[ I ][ 4 ] )

            nreturn := ASCAN( aTageSort, { |a,b,c,d,e,x| x  == aTemp[ I ][ 6 ] } )
            ADel( aTageSort, nreturn )
            ASize( aTageSort, Len( aTageSort ) - 1 )
            oBrw:Refresh()
            oBrw:GoTop()
            oBrw:Refresh()
         endif
      next


      msginfo("Verzeichnisse gelöscht")

      RETURN( NIL )
      //----------------------------------------------------------------------------//



Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: xBrowse - how to update
Posted: Fri Jul 24, 2009 08:12 PM
Hello Otto.

I hope this is what you're looking for

on.bmp
off.bmp

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "xbrowse.ch"


function Main()

   local oDlg, oBrw, aData:= {}
   local n
   
   
   
   for n = 1 to 1000
      aadd( aData, {.f., "NUMBER_" + StrZero( n, 4 ), "REVERSE_" + StrZero( 1000 - n, 4 ) } )
   next

   DEFINE DIALOG oDlg TITLE "I am a DialogBox" PIXEL SIZE 600,400
   
  @ 160, 10 BUTTON "Delete" ACTION Backuploeschen( oBrw ) PIXEL OF oDlg SIZE 25,15
   
  @ 0,0 XBROWSE oBrw OF oDlg  ;
        COLUMNS {1, 2, 3} ;
        HEADERS {"Selected", "First", "Second"} ;
        ARRAY aData SIZE 250,150
     
    oBrw:aCols[ 1 ]:SetCheck( {"on.bmp", "off.bmp"}, {| o, x, n | o:Value := x } )
    oBrw:aCols[ 1 ]:bStrData = NIL

     
    oBrw:nMarqueeStyle    = 4
    oBrw:nColDividerStyle = 1
    oBrw:nRowDividerStyle = 1

    oBrw:CreateFromCode()


ACTIVATE DIALOG oDlg CENTERED 

return nil


FUNCTION Backuploeschen( oBrw )
local n      := 0
local nCount := 0


   DO WHILE ( n := AScan( oBrw:aArrayData, {| uVal | uVal[ 1 ] == .T. }, n ) ) > 0
      ADel( oBrw:aArrayData, n )
      ASize( oBrw:aArrayData, Len( oBrw:aArrayData ) - 1 )
   ENDDO
   
   oBrw:Refresh()
   

RETURN( NIL )
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: xBrowse - how to update
Posted: Fri Jul 24, 2009 08:49 PM

Hello Daniel,
thank you so much. Now it is all working.
Best regards,
Otto

Continue the discussion