Numworks Epsilon
1.4.1
Graphing Calculator Operating System
message_table_cell_with_message.cpp
Go to the documentation of this file.
1
#include <
escher/message_table_cell_with_message.h
>
2
#include <
escher/palette.h
>
3
#include <string.h>
4
5
MessageTableCellWithMessage::MessageTableCellWithMessage
(I18n::Message message,
Layout
layout) :
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
14
void
MessageTableCellWithMessage::setAccessoryMessage
(I18n::Message textBody) {
15
m_accessoryView
.
setMessage
(textBody);
16
reloadCell
();
17
}
18
19
View
*
MessageTableCellWithMessage::accessoryView
()
const
{
20
if
(
strlen
(
m_accessoryView
.
text
()) == 0) {
21
return
nullptr
;
22
}
23
return
(
View
*)&
m_accessoryView
;
24
}
25
26
void
MessageTableCellWithMessage::setHighlighted
(
bool
highlight) {
27
MessageTableCell::setHighlighted
(highlight);
28
KDColor
backgroundColor =
isHighlighted
()?
Palette::Select
:
KDColorWhite
;
29
m_accessoryView
.
setBackgroundColor
(backgroundColor);
30
}
31
32
void
MessageTableCellWithMessage::setTextColor
(
KDColor
color) {
33
m_accessoryView
.
setTextColor
(color);
34
MessageTableCell::setTextColor
(color);
35
}
36
37
void
MessageTableCellWithMessage::setAccessoryTextColor
(
KDColor
color) {
38
m_accessoryView
.
setTextColor
(color);
39
}
I18n
Definition:
i18n.h:6
MessageTableCellWithMessage::setAccessoryMessage
void setAccessoryMessage(I18n::Message textBody)
Definition:
message_table_cell_with_message.cpp:14
TableCell::Layout::Vertical
KDText
Definition:
text.h:8
MessageTableCellWithMessage::setTextColor
void setTextColor(KDColor color) override
Definition:
message_table_cell_with_message.cpp:32
MessageTableCellWithMessage::MessageTableCellWithMessage
MessageTableCellWithMessage(I18n::Message message=(I18n::Message) 0, Layout layout=Layout::Vertical)
Definition:
message_table_cell_with_message.cpp:5
MessageTableCell::setTextColor
virtual void setTextColor(KDColor color)
Definition:
message_table_cell.cpp:27
KDColorWhite
constexpr KDColor KDColorWhite
Definition:
color.h:42
strlen
size_t strlen(const char *s)
Definition:
strlen.c:3
MessageTableCell
Definition:
message_table_cell.h:8
Palette::Select
static constexpr KDColor Select
Definition:
palette.h:17
MessageTextView::setMessage
void setMessage(I18n::Message message)
Definition:
message_text_view.cpp:19
MessageTableCellWithMessage::m_accessoryView
MessageTextView m_accessoryView
Definition:
message_table_cell_with_message.h:15
message_table_cell_with_message.h
HighlightCell::isHighlighted
bool isHighlighted() const
Definition:
highlight_cell.h:11
MessageTableCell::setHighlighted
virtual void setHighlighted(bool highlight) override
Definition:
message_table_cell.cpp:15
MessageTableCellWithMessage::accessoryView
View * accessoryView() const override
Definition:
message_table_cell_with_message.cpp:19
KDColor
Definition:
color.h:6
View
Definition:
view.h:23
TextView::setAlignment
void setAlignment(float horizontalAlignment, float verticalAlignment)
Definition:
text_view.cpp:24
MessageTextView::text
const char * text() const override
Definition:
message_text_view.cpp:11
TextView::setTextColor
void setTextColor(KDColor textColor)
Definition:
text_view.cpp:19
TableCell::Layout
Layout
Definition:
table_cell.h:8
palette.h
HighlightCell::reloadCell
virtual void reloadCell()
Definition:
highlight_cell.cpp:16
TextView::setBackgroundColor
void setBackgroundColor(KDColor backgroundColor)
Definition:
text_view.cpp:14
MessageTableCellWithMessage::setAccessoryTextColor
void setAccessoryTextColor(KDColor color)
Definition:
message_table_cell_with_message.cpp:37
MessageTableCellWithMessage::setHighlighted
void setHighlighted(bool highlight) override
Definition:
message_table_cell_with_message.cpp:26
epsilon
escher
src
message_table_cell_with_message.cpp
Generated by
1.8.14