xBrowse - how to update

xBrowse - how to update

Postby Otto » Fri Jul 24, 2009 6: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: Select all  Expand view
 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 )
      //----------------------------------------------------------------------------//



Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse - how to update

Postby Daniel Garcia-Gil » Fri Jul 24, 2009 8:12 pm

Hello Otto.

I hope this is what you're looking for

Image on.bmp
Image off.bmp

Code: Select all  Expand view

#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 )
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: xBrowse - how to update

Postby Otto » Fri Jul 24, 2009 8:49 pm

Hello Daniel,
thank you so much. Now it is all working.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 108 guests