<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_RYOFilterActivate |
Declare Function sx_RYOFilterActivate Lib "Apollo9.dll"
(ByVal iFilterHandle As Integer,
ByVal iBoolOperation As Integer)
As Integer
BOOL FAR PASCAL sx_RYOFilterActivate
(SHORT iFilterHandle,
SHORT iBoolOperation);
Activate an existing filter bitmap and either make it the filter bitmap of record or combine it with the current active bitmap.
iFilterHandle: An integer identifier of the bitmap to be activated returned from either sx_RYOFilterCopy or sx_RYOFilterCreate.
iBoolOperation: One of the following manifest constants:
RYOFILTER_NEW 1
RYOFILTER_AND 2
RYOFILTER_OR 3
RYOFILTER_XOR 4
RYOFILTER_ANDNOT 5
RYOFILTER_ORNOT 6
RYOFILTER_XORNOT 7
RYOFILTER_NEW replaces any existing active bitmap.
For the bitwise boolean operations, every bit in the current filter bitmap is operated upon by its corresponding bit in the bitmap being activated. The bitwise operations give us the following results:
RYOFILTER_AND
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_AND |
1 |
1 |
0 |
0 |
Result |
0 |
1 |
0 |
0 |
RYOFILTER_OR
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_OR |
1 |
1 |
0 |
0 |
Result |
1 |
1 |
0 |
1 |
RYOFILTER_XOR
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_XOR |
1 |
1 |
0 |
0 |
Result |
1 |
0 |
0 |
1 |
RYOFILTER_ANDNOT
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_ANDNOT |
1 |
1 |
0 |
0 |
Result |
1 |
0 |
1 |
1 |
RYOFILTER_ORNOT
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_ORNOT |
1 |
1 |
0 |
0 |
Result |
0 |
0 |
1 |
0 |
RYOFILTER_XORNOT
Existing Bit Value |
0 |
1 |
0 |
1 |
RYOFILTER_XORNOT |
1 |
1 |
0 |
0 |
Result |
0 |
1 |
1 |
0 |
The NOT operations apply the boolean bitwise operation on the bits and then invert the result.
True or False depending on the outcome of the operation.
If Button1.Caption = "Activate Filter" Then
sx_RYOFilterActivate( hBitMap, RYOFILTER_NEW )
Button1.Caption = "Clear Filter"
Else
' Deactivate active bitmap does not destroy it
sx_RYOFilterDestroy( 0 )
' Destroys bitmap, freeing allocated memory
sx_RYOFilterDestroy( hBitMap )
' Create new, empty bitmap
hBitMap = sx_RYOFilterCreate
Button1.Caption = "Activate Filter"
End If
sx_GoTop
SHORT hBitMap;
if (!lstrcmpi(Button1.Caption, "Activate Filter")
{
sx_RYOFilterActivate( hBitMap, RYOFILTER_NEW );
lstrcpy(Button1.Caption, "Clear Filter");
}
else
{
// Deactivate active bitmap does not destroy it
sx_RYOFilterDestroy( 0 );
// Destroys bitmap, freeing allocated memory
sx_RYOFilterDestroy( hBitMap );
// Create new, empty bitmap
hBitMap = sx_RYOFilterCreate();
lstrcpy(Button1.Caption, "Activate Filter");
}
sx_GoTop();
sx_RYOFilterCopy, sx_RYOFilterCreate, sx_RYOFilterDestroy, sx_RYOFilterRestore, sx_RYOFilterSave, sx_RYOFilterSetBit