State Bits of Graphic Objects

This page contains information for the Graphics Library found in Microchip Libraries for Applications (MLA). It is not relevant for the MPLAB® Harmony Graphics Library.

State Bits

Every graphics object has several state bits. The state bits are combined together into one word and stored in the object's data structure. State bits fall into one of two different categories:

The first category informs the drawing function, GFX_GOL_ObjectListDraw, to copy the entire object, or a portion of the object, to the frame buffer.

The second category of status bits informs GFX_GOL_ObjectListDraw how to draw the object. When an object is being copied to the frame-buffer some of the state bits inform GFX_GOL_ObjectListDraw which elements from the style scheme are to be applied to the object.

Examples of the GFX_GOL_ObjectListDraw applying a style scheme to an object based on the state bits are covered in the "Drawing Graphics Objects" Developer Help page.

State Bits used to Draw or Re-draw an Object

GOL_OBJ_xxxx_DRAW_STATE and GOL_OBJ_xxxx_DRAW_UPDATE_STATE are the state bits used to determine if an object is to be drawn or redrawn to the frame buffer.

The "xxxx" in the state bit names above are representative of the type of object to be drawn. There are no state bits with an xxxx in their name.

All objects have a DRAW state bit. When this bit is set, the entire object is written (or re-written) to the frame buffer. Typically, the user program sets the DRAW bit when a situation occurs in which the entire object needs to be redrawn.

Some objects have an UPDATE status bit in addition to the DRAW bit. When the update bit is set by the user application, only the portion of the object which contains data (such as the value on the meter object) will be re-drawn to the frame buffer. Using the UPDATE bit will help reduce the visual "jitter" that some people notice when an entire object is redrawn.
Object DRAW State bit UPDATE State bit
Button GFX_GOL_BUTTON_DRAW_STATE n/a
Meter GFX_GOL_METER_DRAW_STATE GFX_GOL_METER_UPDATE_DRAW
Scroll Bar GFX_GOL_SCROLLBAR_DRAW_STATE GFX_GOL_SCROLLBAR_THUMB_DRAW_STATE
Static Text Box GFX_GOL_STATICTEXT_DRAW_STATE n/a
Progress Bar GFX_GOL_PROGRESSBAR_DRAW_STATE GFX_GOL_PROGRESSBAR_DRAW_BAR_STATE
The above table contains only a partial listing of the available state bits. To get a complete list the state-bits for all objects, open GFX_help.png elp_mlagfx.jar located in …microchip/mla/vYYYY_MM_DD/doc…

State Bits Used to Control an Object's Appearance

In addition to the draw and update state bits, Graphics objects each have the following bits:

  • GFX_GOL_xxxx_DISABLED: Draws the object with ColorDisabled and TextColorDisabled
  • GOLgfx_xxxx_HIDE: Draws the object with the CommonBkColor from the style scheme, making the object non-visible
  • GFX_GOL_xxxx_FOCUS: Applies a focus element to the object

The "xxxx" in the update-state bit names above are representative of the type of object to be drawn. There are no state bits with an xxxx in their names. Examples include names such as: GFX_GOL_BUTTON_DISABLE, GFX_GOL_METER_HIDE, etc…


In addition to the draw and update state bits, each object type has some states unique to that object. These unique state bits reflect conditions applicable to those objects. Comparison of the state bits for a Button object and a Scroll-bar object reveals some of the differences:

Button States Scroll-bar States
button-state-bits.png scrollbar-state-bits.png
Object Specific States in yellow: yellow-bar.png

The function and effect of setting the object-specific state bits vary from object to object. This tutorial will show you the procedures used to set and clear state bits. Refer to the help file to learn about the attributes of object-specific state bits.

Examples of programming changes to the state bits of the object are covered in the "Changing the State of Graphics Objects" Developer Help page.


© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.