Please modify this sample with
Code: Select all | Expand
@ 60,250 BTNBMP PROMPT "Clear Filter" ;
SIZE 100,40 PIXEL OF oDlg FLAT ;
ACTION ( oBrw:cAlias )->( DBCLEARFILTER(), oBrw:Refresh(), ClearFilter( oBrw ), oBrw:SetFocus() )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFontB, oBoldB
return nil
static function ClearFilter( oBrw )
local n
for n := 1 to Len( oBrw:aCols )
WITH OBJECT oBrw:aCols[ n ]
if FieldType( n ) != 'L'
:uBarGetVal := uValBlank( fieldGet( n ) )
if FieldType( n ) == 'N'
:cBarGetPic := NumPict( FieldLen( n ), FieldDec( n ) )
endif
endif
if hb_IsObject( :oBarGet )
:oBarGet:Refresh()
endif
END
next
Return nil
Please note that the functions used for applying and removing filters depend on the RDD (data source) you are using in xbrowse, and therefore the initialization of the oGetBar will also be different. This example is created using a DBF.
The important thing to clean the values in the barget is to initialize the data :uBarGetVal of all columns. Their initial value, as I mentioned before, will depend on the RDD used in Xbrowse.