Slider/Scroll Bar

Microchip Graphics Library

Microchip Graphics Library
Slider/Scroll Bar

Slider or Scrollbar supports both Keyboard and Touchscreen inputs, replying to their events with the following messages: 

1. SLD_MSG_INC - when the thumb is to be incremented in position 

2. SLD_MSG_DEC - when the thumb is to be decremented in position 

 

The Slider object is rendered using the assigned style scheme. The following figure illustrates the color assignments. 

 

 

Functions
 
Name 
Description 
 
This function creates a SLIDER object with the parameters given. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. It automatically attaches the new object into a global linked list of objects and returns the address of the object. 
 
This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object.
When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering. 
 
This sets the page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2. 
 
This function sets the position of the slider thumb. Value should be in the set range inclusive. Object must be redrawn to reflect the change. 
 
This sets the range of the thumb. If this field is changed Object must be completely redrawn to reflect the change. 
 
This function performs the actual state change based on the translated message given. The following state changes are supported:  
 
This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
 
Macros
Name 
Description 
Returns the current page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2. 
Returns returns the current position of the slider thumb. 
Returns the current range of the thumb. 
This macro increment the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object. 
This macro decrement the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object. 
Structures
Name 
Description 
Defines the parameters required for a slider/scrollbar Object. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. For scrollbar mode, focus rectangle is not drawn. 
Topics
Name 
Description 
List of Slider bit states. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved