This repository was archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
changeCheckBoxEnabled()
Mammad900 edited this page Aug 30, 2020
·
1 revision
Disables or enables a check-box
- Page (
int) : The number of the page which contains the check-box - Index (
int) : Index of the check-box relative to it's containing page. - Value (
bool) : If true, the check-box become enabled; if false, it will become disabled.
Nothing
void targetTempChanged(int newTargetTemp){
// .....
if(newTargetTemp<22){ // Energy saving is impossible with temp lower than 22 degrees
changeCheckBoxEnabled(PAGE_ADVANCED,ENERGY_SAVING_ENABLED,false);
}
else{
changeCheckBoxEnabled(PAGE_ADVANCED,ENERGY_SAVING_ENABLED,true);
}
// .....
}When target temperature is set below 22 degrees, the energy saving check-box will become disabled (because it is not possible to save energy in this temp)
void changeCheckBoxEnabled(int page,int i,bool val){
if (checkbox_enabled[page][i] != val) {
HCT
checkbox_enabled[page][i] = val;
if (CurrentPage == page){
drawCheckBox(page,i);
}
}
}Note: HCT is a macro for making the rest of the library aware that something has changed.