Object States

Microchip Graphics Library

Microchip Graphics Library
Object States

The GOL objects follow two types of states, the Property States and the Drawing States. Property States defines action and appearance of objects. Drawing States on the other hand indicate if the object needs to be hidden, partially redrawn, or fully redrawn in the display. To store the states, the field state defined in OBJ_HEADER structure is used. Six most significant bits are allocated for Drawing States and the rest is allocated for the Property States. Some common Property States and Drawing States are shown in the following table.

State 
Type 
Bit Location 
Description 
OBJ_FOCUSED 
0x0001 
Object is in the focused state. This is usually used to show selection of the object. Not all objects have this feature. 
OBJ_DISABLED 
0x0002 
Object is disabled and will ignore all messages. 
OBJ_DRAW_FOCUS 
0x2000 
Focus for the object should be redrawn. 
OBJ_DRAW 
0x4000 
Object should be redrawn completely. 
OBJ_HIDE 
0x8000 
Object will be hidden by filling the area occupied by the object with the common background color. This has the highest priority over all Drawing States. When an object is set to be hidden, all other drawing states are overridden. 

Where:

  • OBJ – represent the prefix assigned to a GOL object.
  • P – Property states, D – Drawing states
Individual Object drawing function (e.g. BtnDraw(), SldDraw(), etc...) does not reset the draw states instead use GOLDraw() to automatically reset and manage the draw states. If the call to individual drawing function cannot be avoided, draw states must be reset manually after the drawing functions returns a 1.

Macros
Name 
Description 
This macro retrieves the current value of the state bits of an object. It is possible to get several state bits. 
This macro clear the state bits of an object. Object must be redrawn to display the changes. It is possible to clear several state bits with this macro. 
This macro sets the state bits of an object. Object must be redrawn to display the changes. It is possible to set several state bits with this macro. 
Topics
Name 
Description 
List of common Object bit states. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved