GOLDrawComplete Macro

Microchip Graphics Library

Microchip Graphics Library
GOLDrawComplete Macro
C
#define GOLDrawComplete(pObj) ((OBJ_HEADER *)pObj)->state &= 0x03ff
Overview

This macro resets the drawing states of the object (6 MSBits of the object�s state).

Input Parameters
Input Parameters 
Description 
pObj 
Pointer to the object of interest. 
Returns

none

Preconditions

none

Side Effects

none

Example
// This function should be called again whenever an incomplete
// rendering (done = 0) of an object occurs.
// internal states in the BtnDraw() or WndDraw() should pickup
// on the state where it left off to continue rendering.
void GOLDraw() {
    static OBJ_HEADER *pCurrentObj = NULL;
    SHORT done;

    if(pCurrentObj == NULL) {
        if(GOLDrawCallback()) {
            // If it's last object jump to head
            pCurrentObj = GOLGetList();
        } else {
            return;
        }
    }
    done = 0;

    while(pCurrentObj != NULL) {
        if(IsObjUpdated(pCurrentObj)) {
            done = pCurrentObj->draw(pCurrentObj);

            if(done){
                GOLDrawComplete(pCurrentObj);
            }else{
                return;
            }
        }
        pCurrentObj = pCurrentObj->pNxtObj;
    }
}
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved