From 7f827ad4ef2baab206da087e9790a45a92b6bd4e Mon Sep 17 00:00:00 2001 From: Karl Melscher Date: Wed, 7 Mar 2018 15:20:35 +0100 Subject: NumTimers in timermenu --- lcarsng.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lcarsng.c') diff --git a/lcarsng.c b/lcarsng.c index 03c4fed..1920b58 100644 --- a/lcarsng.c +++ b/lcarsng.c @@ -1657,11 +1657,21 @@ void cLCARSNGDisplayMenu::SetTitle(const char *Title) case mcEvent: case mcRecording: case mcRecordingInfo: - case mcTimer: case mcTimerEdit: osd->DrawText(xs00, ys00, Title, Theme.Color(clrMenuFrameFg), frameColor, font, xs11 - xs00, lineHeight, taBottom | taRight | taBorder); osd->DrawRectangle(xs12, ys00, xs13 - 1, ys01 - 1, frameColor); break; + case mcTimer: { + osd->DrawText(xs00, ys00, Title, Theme.Color(clrMenuFrameFg), frameColor, font, xs11 - xs00, lineHeight, taBottom | taRight | taBorder); + osd->DrawRectangle(xs12, ys00, xs13 - 1, ys01 - 1, frameColor); + int NumTimers = 0; + for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { + if (Timer->HasFlags(tfActive)) + NumTimers++; + } + osd->DrawText(xs00, ys00, itoa(NumTimers), Theme.Color(clrMenuFrameFg), frameColor, font, xs03 - xs02, ys01 - ys00, taBottom | taLeft | taBorder); + } + break; default: int w = font->Width(Title); osd->DrawRectangle(xa06, yt00, xa07 - w - Gap - 1, yt01 - 1, frameColor); -- cgit v1.2.3