TPD/VPD Series – Programming Guide v.1.0.6
Page 32
Copyright@ 2020 ICP DAS CO., LTD. All Rights Reserved. E-mail: [email protected]
Step 8: Edit the control codes for the “Slider” component.
a.
Double click the “Slider” component in the design area to open the programming
window.
b.
Edit the code in the programming window using the C language. (Users can copy the
code from the picture below.) In this demo, the “CheckBox4” will be changed by the
value of “Slider6”. Both the text in the “Slider6” and the corresponding picture will be
changed at the same time.
c.
When finished, click “OK” to store.
Step 9:
Build and Download the demo to the TouchPAD model.
Please refer
Downloading Methods for TouchPAD
void Slider6OnSliderChange(tWidget *pWidget, long
lValue)
{
static char strValue[10];
usnprintf(strValue , sizeof(strValue) , "%d" , lValue);
SliderTextSet(&Slider6 , strValue);
WidgetPaint((tWidget*)&Slider6);
CheckBoxValueSet(&
CheckBox4
, lValue);
}
Convert the
integer to a string
in order to display
it on the Slider.
Declare the variables
This name must be the same as the “Name” and
“ID” properties of the CkeckBox.
b.
c.