GUIslice  0.16.0
Embedded GUI in C
XSlider.h File Reference
#include "GUIslice.h"
Include dependency graph for XSlider.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gslc_tsXSlider
 Extended data for Slider element. More...
 

Macros

#define GSLC_TYPEX_SLIDER
 
#define gslc_ElemXSliderCreate_P(pGui, nElemId, nPage, nX, nY, nW, nH, nPosMin_, nPosMax_, nPos_, nThumbSz_, bVert_, colFrame_, colFill_)
 Create a Slider Element in Flash. More...
 

Typedefs

typedef bool(* GSLC_CB_XSLIDER_POS) (void *pvGui, void *pvElem, int16_t nPos)
 Callback function for slider feedback. More...
 

Functions

gslc_tsElemRefgslc_ElemXSliderCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXSlider *pXData, gslc_tsRect rElem, int16_t nPosMin, int16_t nPosMax, int16_t nPos, uint16_t nThumbSz, bool bVert)
 Create a Slider Element. More...
 
void gslc_ElemXSliderSetStyle (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bTrim, gslc_tsColor colTrim, uint16_t nTickDiv, int16_t nTickLen, gslc_tsColor colTick)
 Set a Slider element's current position. More...
 
void gslc_ElemXSliderSetSnapEn (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bSnapEn)
 Enable touch to snap to the nearest tick mark. More...
 
int gslc_ElemXSliderGetPos (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef)
 Get a Slider element's current position. More...
 
void gslc_ElemXSliderSetPos (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nPos)
 Set a Slider element's current position. More...
 
void gslc_ElemXSliderSetPosFunc (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, GSLC_CB_XSLIDER_POS funcCb)
 Assign the position callback function for a slider. More...
 
bool gslc_ElemXSliderDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Slider element on the screen. More...
 
bool gslc_ElemXSliderTouch (void *pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nRelX, int16_t nRelY)
 Handle touch events to Slider element. More...
 

Macro Definition Documentation

#define gslc_ElemXSliderCreate_P (   pGui,
  nElemId,
  nPage,
  nX,
  nY,
  nW,
  nH,
  nPosMin_,
  nPosMax_,
  nPos_,
  nThumbSz_,
  bVert_,
  colFrame_,
  colFill_ 
)

Create a Slider Element in Flash.

Parameters
[in]pGuiPointer to GUI
[in]nElemIdUnique element ID to assign
[in]nPagePage ID to attach element to
[in]nXX coordinate of element
[in]nYY coordinate of element
[in]nWWidth of element
[in]nHHeight of element
[in]nPosMin_Minimum position value
[in]nPosMax_Maximum position value
[in]nPos_Starting position value
[in]nThumbSz_Size of the thumb control
[in]bVert_Orientation (true for vertical)
[in]colFrame_Color of the element frame
[in]colFill_Color of the element fill
Returns
none
#define GSLC_TYPEX_SLIDER

Typedef Documentation

typedef bool(* GSLC_CB_XSLIDER_POS) (void *pvGui, void *pvElem, int16_t nPos)

Callback function for slider feedback.

Function Documentation

gslc_tsElemRef* gslc_ElemXSliderCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXSlider pXData,
gslc_tsRect  rElem,
int16_t  nPosMin,
int16_t  nPosMax,
int16_t  nPos,
uint16_t  nThumbSz,
bool  bVert 
)

Create a Slider Element.

Parameters
[in]pGuiPointer to GUI
[in]nElemIdElement ID to assign (0..16383 or GSLC_ID_AUTO to autogen)
[in]nPagePage ID to attach element to
[in]pXDataPtr to extended element data structure
[in]rElemRectangle coordinates defining checkbox size
[in]nPosMinMinimum position value
[in]nPosMaxMaximum position value
[in]nPosStarting position value
[in]nThumbSzSize of the thumb control
[in]bVertOrientation (true for vertical)
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXSliderDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Slider element on the screen.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eRedrawRedraw mode
Returns
true if success, false otherwise
int gslc_ElemXSliderGetPos ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef 
)

Get a Slider element's current position.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
Returns
Current slider position
void gslc_ElemXSliderSetPos ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
int16_t  nPos 
)

Set a Slider element's current position.

Parameters
[in]pGuiPointer to GUI
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nPosNew position value
Returns
none
void gslc_ElemXSliderSetPosFunc ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
GSLC_CB_XSLIDER_POS  funcCb 
)

Assign the position callback function for a slider.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]funcCbFunction pointer to position routine (or NULL for none)
Returns
none
void gslc_ElemXSliderSetSnapEn ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bSnapEn 
)

Enable touch to snap to the nearest tick mark.

  • nTickDiv (in SetStyle) must be non-zero for snap to be active
Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bSnapEnEnable snap function if true
Returns
none
void gslc_ElemXSliderSetStyle ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bTrim,
gslc_tsColor  colTrim,
uint16_t  nTickDiv,
int16_t  nTickLen,
gslc_tsColor  colTick 
)

Set a Slider element's current position.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bTrimShow a colored trim?
[in]colTrimColor of trim
[in]nTickDivNumber of tick divisions to show (0 for none)
[in]nTickLenLength of tickmarks
[in]colTickColor of ticks
Returns
none
bool gslc_ElemXSliderTouch ( void *  pvGui,
void *  pvElemRef,
gslc_teTouch  eTouch,
int16_t  nRelX,
int16_t  nRelY 
)

Handle touch events to Slider element.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eTouchTouch event type
[in]nRelXTouch X coord relative to element
[in]nRelYTouch Y coord relative to element
Returns
true if success, false otherwise