( oBrw:cAlias )->( DbDelete() )
oBrw:Refresh()
Otto wrote:Do you have SET DELETED ON in your code?
- Code: Select all Expand view
( oBrw:cAlias )->( DbDelete() )
oBrw:Refresh()
I achieve the effect using :bClrStd
:bClrStd := { || If( Eval( ListVen:bKeyNo,,ListVen ) % 2 == 0, { CLR_BLACK, RGB( 224, 236, 255 ) }, { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
SET DELETED ON !DELETED()
SET DELETED ON
SET FILTER TO !DELETED()
INDEX ON Name TAG "Name" ;
TO ( cPath + "\Test" ) FOR ! Test->( Deleted() )
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oDlg, oBrw, oFont
SET DELETED ON
USE CUSTOMER
SET FILTER TO !DELETED()
GO TOP
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 600,400 PIXEL FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
COLUMNS "First", "City", "State", "Salary" ;
ALIAS 'CUSTOMER' CELL LINES NOBORDER
WITH OBJECT oBrw
:bClrStd := { || { CLR_BLACK, If( oBrw:KeyNo() % 2 == 0, RGB(224,236,255), RGB(189,211,253) ) } }
:bKeyDown := { |nKey| If( nKey == VK_DELETE, (oBrw:cAlias)->( BrwDelete( oBrw ) ), nil ) }
END
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return (0)
//----------------------------------------------------------------------------//
static function BrwDelete( oBrw )
if DbrLock()
DELETE
DbUnlock()
SKIP
if ( eof() )
GO BOTTOM
endif
oBrw:Refresh()
endif
return nil
//----------------------------------------------------------------------------//
FiveWin, One line of code and it's done...
Is there a way to paint the Browse Client Area when the Database is Empty??? Right now is ALL WHITE...
The problem is not about the Deleted Records, but is that when I delete a record, the color of that row is lost and I get two consecutive rows with the same color....As you can see the above picture...
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 107 guests