Colon in the digital clock
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-21 6:05 AM
Is the colon between the hours and minutes in the digital clock accessible? Is there a way to make it blink at the "seconds" ?
- Labels:
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-22 1:23 AM
Hello,
Yes adding a colon is doable.
Just copy the digitalClock.cpp and .hpp in your gui folder (respectively in src/common and include/gui/common).
Then modify the updateClock() function in digitalClock.cpp as follows:
void DigitalClock::updateClock()
{
// ....
else if (displayMode == DISPLAY_24_HOUR)
{
const char* format = useLeadingZeroForHourIndicator ? "%02d;%02d;%02d" : "%d;%02d;%02d";
Unicode::snprintf(buffer, BUFFER_SIZE, format, currentHour, currentMinute, currentSecond);
}
text.invalidate();
}
}
What do you mean by "blink at the seconds" ?
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-22 6:30 AM
please see attached, the colon between the hours and minutes blinks every second, a kind of replacement for the displaying the seconds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-22 7:06 AM
Hello,
This blinking effect is difficult with the current digital clock widget. The widget has to be changed quite a lot (it might even be better to create your own widget based on the analog clock).
The reason is that right now the widget has only one single text area. But to make something blink, you need to create a dedicated text area that you make disappear and reappear every second.
As a first idea, I would create 3 text areas in a container, one for hours, one for the colon, one for the minutes.
I would modify the hours and minutes accordingly in the handleTickEvent and also make the colon appear and disappear (setVisible(true or false)) in this function as well.
If I have time I will make something.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-23 1:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-05 7:24 AM
Thanks. That seems more simplifying the issue, just using textAreas instead of the digital clock widget, great thinking!
