Numworks Epsilon  1.4.1
Graphing Calculator Operating System
message_table_cell_with_message.cpp
Go to the documentation of this file.
2 #include <escher/palette.h>
3 #include <string.h>
4 
6  MessageTableCell(message, KDText::FontSize::Small, layout),
7  m_accessoryView(KDText::FontSize::Small, (I18n::Message)0, 0.0f, 0.5f)
8 {
9  if (layout != Layout::Vertical) {
10  m_accessoryView.setAlignment(1.0f, 0.5f);
11  }
12 }
13 
15  m_accessoryView.setMessage(textBody);
16  reloadCell();
17 }
18 
20  if (strlen(m_accessoryView.text()) == 0) {
21  return nullptr;
22  }
23  return (View *)&m_accessoryView;
24 }
25 
28  KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
29  m_accessoryView.setBackgroundColor(backgroundColor);
30 }
31 
35 }
36 
39 }
Definition: i18n.h:6
void setAccessoryMessage(I18n::Message textBody)
Definition: text.h:8
void setTextColor(KDColor color) override
MessageTableCellWithMessage(I18n::Message message=(I18n::Message) 0, Layout layout=Layout::Vertical)
virtual void setTextColor(KDColor color)
constexpr KDColor KDColorWhite
Definition: color.h:42
size_t strlen(const char *s)
Definition: strlen.c:3
static constexpr KDColor Select
Definition: palette.h:17
void setMessage(I18n::Message message)
bool isHighlighted() const
virtual void setHighlighted(bool highlight) override
Definition: color.h:6
Definition: view.h:23
void setAlignment(float horizontalAlignment, float verticalAlignment)
Definition: text_view.cpp:24
const char * text() const override
void setTextColor(KDColor textColor)
Definition: text_view.cpp:19
virtual void reloadCell()
void setBackgroundColor(KDColor backgroundColor)
Definition: text_view.cpp:14
void setHighlighted(bool highlight) override