GetState Macro

Microchip Graphics Library

Microchip Graphics Library
GetState Macro
C
#define GetState(pObj, stateBits) (((OBJ_HEADER *)pObj)->state & (stateBits))
Overview

This macro retrieves the current value of the state bits of an object. It is possible to get several state bits.

Input Parameters
Input Parameters 
Description 
pObj 
Pointer to the object of interest. 
stateBits 
Defines which state bits are requested. Please refer to specific objects for object state bits definition for details 
Returns

Macro returns a non-zero if any bit in the stateBits mask is set.

Preconditions

none

Side Effects

none

Example
#define BTN_HIDE 0x8000
BUTTON *pB;
// pB is created and initialized
// do something here to set state

// Hide the button (remove from screen)
if (GetState(pB,BTN_HIDE)) {
    SetColor(pB->pGolScheme->CommonBkColor);
    Bar(pB->left,pB->top,pB->right,pB->bottom);

}
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved