GOLRedraw Macro

Microchip Graphics Library

Microchip Graphics Library
GOLRedraw Macro
C
#define GOLRedraw(pObj) ((OBJ_HEADER *)pObj)->state |= 0x7c00;
Overview

This macro sets the object to be redrawn. For the redraw to be effective, the object must be in the current active list. If not, the redraw action will not be performed until the list where the object is currently inserted will be set to be the active list.

Input Parameters
Input Parameters 
Description 
pObj 
Pointer to the object to be redrawn. 
Returns

none

Preconditions

none

Side Effects

none

Example
void GOLRedrawRec(SHORT left, SHORT top, SHORT right, SHORT bottom) {  
    // set all objects encompassed by the rectangle to be redrawn
    OBJ_HEADER *pCurrentObj;
    
    pCurrentObj = GOLGetList();
    while(pCurrentObj != NULL){
        if (
            ((pCurrentObj->left >= left) && (pCurrentObj->left <= right)) ||
            ((pCurrentObj->right >= left) && (pCurrentObj->right <= right))||
            ((pCurrentObj->top >= top) && (pCurrentObj->top <= bottom)) ||
            ((pCurrentObj->bottom >= top) && (pCurrentObj->bottom <= bottom))){
                GOLRedraw(pCurrentObj);
        }
        pCurrentObj = pCurrentObj->pNxtObj;           
    }//end of while
}                               
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved