Numworks Epsilon  1.4.1
Graphing Calculator Operating System
empty_battery_window.cpp
Go to the documentation of this file.
1 #include "empty_battery_window.h"
2 #include "global_preferences.h"
3 #include "i18n.h"
4 extern "C" {
5 #include <assert.h>
6 }
7 
9  Window()
10 {
11 }
12 
14  ctx->fillRect(bounds(), KDColorWhite);
15  const char * warningMessage = I18n::translate(I18n::Message::LowBattery, GlobalPreferences::sharedGlobalPreferences()->language());
16  KDSize warningSize = KDText::stringSize(warningMessage, KDText::FontSize::Large);
17  ctx->drawString(warningMessage, KDPoint((Ion::Display::Width - warningSize.width())/2, (Ion::Display::Height - warningSize.height())/2), KDText::FontSize::Large);
18 }
19 
Definition: window.h:6
KDPoint drawString(const char *text, KDPoint p, KDText::FontSize size=KDText::FontSize::Large, KDColor textColor=KDColorBlack, KDColor backgroundColor=KDColorWhite, int maxLength=-1)
Definition: context_text.cpp:9
void drawRect(KDContext *ctx, KDRect rect) const
constexpr int Width
Definition: display.h:26
constexpr KDCoordinate width() const
Definition: size.h:10
static KDSize stringSize(const char *text, FontSize size=FontSize::Large)
Definition: text.cpp:6
Definition: point.h:6
Definition: size.h:6
enum Message uint16_t enum Language uint16_t const char * translate(Message m, Language l=(Language) 0)
Definition: i18n.cpp:5
constexpr KDColor KDColorWhite
Definition: color.h:42
Definition: rect.h:26
void fillRect(KDRect rect, KDColor color)
Definition: context_rect.cpp:8
constexpr int Height
Definition: display.h:27
KDRect bounds() const
Definition: view.cpp:157
static GlobalPreferences * sharedGlobalPreferences()
constexpr KDCoordinate height() const
Definition: size.h:11