From 403af35519944e8c68a6e51216c7cd52d3471362 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 9 Nov 2019 14:41:42 +0100 Subject: [PATCH] Refactor cRecMenuSwitchTimerConfirm --- recmenus.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/recmenus.c b/recmenus.c index 9e69115..9881e32 100644 --- a/recmenus.c +++ b/recmenus.c @@ -1119,18 +1119,14 @@ cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) { } // --- cRecMenuSwitchTimerConfirm --------------------------------------------------------- -cRecMenuSwitchTimerConfirm::cRecMenuSwitchTimerConfirm(bool success) { +cRecMenuSwitchTimerConfirm::cRecMenuSwitchTimerConfirm(bool success) { // OK SetWidthPercent(50); - - cString message1 = tr("Switch Timer sucessfully created"); - cString message2 = tr("Switch Timer NOT sucessfully created"); - cString infoText = success?message1:message2; - cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); - infoItem->CalculateHeight(width - 2 * border); - AddMenuItem(infoItem); - AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true)); - + const cString line1 = (success) ? tr("Switch Timer sucessfully created") : tr("Switch Timer NOT sucessfully created"); + + AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border)); + AddFooter(new cRecMenuItemButton(tr("OK"), rmsClose, true)); + CalculateHeight(); CreatePixmap(); Arrange();