Object Management

Microchip Graphics Library

Microchip Graphics Library
Object Management

This section describes the API functions and macros that are used to create, maintain and render individual and list of objects.

Functions
 
Name 
Description 
 
This function adds an object to the tail of the active list pointed to by _pGolObjects. The new list tail is set to point to NULL. 
 
This function finds an object in the active list pointed to by _pGolObjects using the given object ID. 
 
This function marks all objects in the active list intersected by the given rectangular area to be redrawn. 
 
This function loops through the active list and redraws objects that need to be redrawn. Partial redrawing or full redraw is performed depending on the drawing states of the objects. GOLDrawCallback() function is called by GOLDraw() when drawing of objects in the active list is completed. 
 
GOLDrawCallback() function MUST BE implemented by the user. This is called inside the GOLDraw() function when the drawing of objects in the active list is completed. User drawing must be done here. Drawing color, line type, clipping region, graphic cursor position and current font will not be changed by GOL if this function returns a zero. To pass drawing control to GOL this function must return a non-zero value. If GOL messaging is not using the active link list, it is safe to modify the list here. 
 
This function frees all the memory used by objects in the active list and initializes _pGolObjects pointer to NULL to start a new empty list. This function must be called only inside the GOLDrawCallback()function when using GOLDraw() and GOLMsg() functions. This requirement assures that primitive rendering settings are not altered by the rendering state machines of the objects. 
 
deletes an object to the linked list objects for the current screen. 
 
Deletes an object in the current active linked list of objects using the ID parameter of the object. 
 
This function sets the keyboard input focus to the object. If the object cannot accept keyboard messages focus will not be changed. This function resets FOCUSED state for the object was in focus previously, set FOCUSED state for the required object and marks the objects to be redrawn. 
 
This function initializes the graphics library and creates a default style scheme with default settings referenced by the global scheme pointer. GOLInit() function must be called before GOL functions can be used. It is not necessary to call GraphInit() function if this function is used. 
 
This function returns non-zero if the object can be focused. Only button, check box, radio button, slider, edit box, list box, scroll bar can accept focus. If the object is disabled it cannot be set to focused state. 
 
This function returns the pointer to the next object in the active linked list which is able to receive keyboard input. 
 
This function returns the pointer to the previous object in the active linked list which is able to receive keyboard input. 
 
This function draws a panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel. 
 
This function draws a two tone panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel. 
Macros
Name 
Description 
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. 
This macro resets the drawing states of the object (6 MSBits of the object�s state). 
This macro returns the object type. 
This macro returns the object ID. 
This macro returns the next object after the specified object. 
This macro starts a new linked list of objects and resets the keyboard focus to none. This macro assigns the current active list _pGolObjects and current receiving keyboard input _pObjectFocused object pointers to NULL. Any keyboard inputs at this point will be ignored. Previous active list must be saved in another pointer if to be referenced later. If not needed anymore memory used by that list should be freed by GOLFree() function. 
This macro gets the current active list. 
This macro sets the given object list as the active list and resets the keyboard focus to none. This macro assigns the receiving keyboard input object _pObjectFocused pointer to NULL. If the new active list has an object�s state set to focus, the _pObjectFocused pointer must be set to this object or the object�s state must be change to unfocused. This is to avoid two objects displaying a focused state when only one object in the active list must be set to a focused state at anytime. 
This macro tests if the object is pending to be redrawn. This is done by testing the 6 MSBits of object�s state to detect if the object must be redrawn. 
This macro returns the pointer to the current object receiving keyboard input. 
This is macro GOLPanelDraw. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved