SldGetPos Macro

Microchip Graphics Library

Microchip Graphics Library
SldGetPos Macro
C
#define SldGetPos(pSld) (((SLIDER*)pSld)->pos)
Overview

Returns returns the current position of the slider thumb.

Input Parameters
Input Parameters 
Description 
pSld 
Pointer to the object. 
Returns

Returns the current position of the slider's thumb.

Preconditions

none

Side Effects

none

Example
#define MAXVALUE 100;

SLIDER *pSlider;
DWORD ctr = 0;

    // create slider here and initialize parameters
    SetState(pSlider, SLD_DRAW);
    SldDraw(pSlider);

    while("some condition") {
        SldSetPos(pSlider, ctr);
        SetState(pSlider, SLD_DRAW_THUMB);
        SldDraw(pSlider);
        // update ctr here
        ctr = "some source of value";
    }

    if (SldGetPos(pSlider) > (MAXVALUE – 1))
       return 0;
    else  
        "do something else"
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved