First Project Comments...Suggestions... #331
bostonareahuman
started this conversation in
Show and tell
Replies: 1 comment
-
Looks great, @bostonmacosx ! As for replacing the images, the following shows an example of using a toggle button to swap an image (this uses bool CbBtnCommon(void* pvGui,void *pvElemRef,gslc_teTouch eTouch,int16_t nX,int16_t nY)
{
gslc_tsGui* pGui = (gslc_tsGui*)(pvGui);
gslc_tsElemRef* pElemRef = (gslc_tsElemRef*)(pvElemRef);
gslc_tsElem* pElem = gslc_GetElemFromRef(pGui,pElemRef);
// ADDED IMAGE REFERENCES HERE
gslc_tsImgRef sImgRef1 = gslc_GetImageFromProg((const unsigned char*)exit_g24,GSLC_IMGREF_FMT_BMP24);
gslc_tsImgRef sImgRef2 = gslc_GetImageFromProg((const unsigned char*)exit_n24,GSLC_IMGREF_FMT_BMP24);
if ( eTouch == GSLC_TOUCH_UP_IN ) {
switch (pElem->nId) {
case E_ELEM_BTN1:
// ADDED IMAGE TOGGLE HERE
m_bToggle = (m_bToggle)? false : true;
if (m_bToggle) {
gslc_ElemSetImage(&m_gui,m_pMyImageElem,sImgRef1,sImgRef1);
} else {
gslc_ElemSetImage(&m_gui,m_pMyImageElem,sImgRef2,sImgRef2);
}
break;
default:
break;
}
}
return true;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@Pconti31 ;)
Here is my 5 day/currrent weather time and live google calendar on my ESP32.
Willing to donate the code to the examples...
To replace the image on screen....i've seen that people make a BOX with a callback to draw the image buut I'm unsure of the benefit and how exactly to do this? This would be a great tutorrial.
I'm using SPIFFS for iimages and calliing
imgref = gslc_GetImageFromFile("/verycloud_sm.jpg",GSLC_IMGREF_FMT_JPG);
gslc_ElemSetImage(&m_gui,whichref,imgref,imgref);
Once a day NTP clockk refresh
Twice a day google calendar refresh
Once a minute clock refresh
Every 15 min current weather refresh
every 6 hr 5 day forecast refresh.
Need to do:
Alarm Clock
Internet Radio
Qi Charger
LED lights for wakeup
Beta Was this translation helpful? Give feedback.
All reactions