9 OutputExpressionsView::OutputExpressionsView(
Responder * parentResponder) :
11 m_approximateExpressionView(),
13 m_exactExpressionView(),
19 m_approximateExpressionView.
setExpression(expressionsLayout[0]);
25 m_approximateSign.
setMessage(equalSignMessage);
50 if (numberOfSubviews() == 1) {
60 if (numberOfSubviews() == 1) {
61 return approximateExpressionSize;
66 KDCoordinate height = max(exactBaseline, approximateBaseline) + max(exactExpressionSize.
height()-exactBaseline, approximateExpressionSize.
height()-approximateBaseline);
68 return KDSize(exactExpressionSize.
width()+approximateSignSize.width()+approximateExpressionSize.
width()+2*k_digitHorizontalMargin, height);
72 if (numberOfSubviews() == 1) {
80 if (numberOfSubviews() == 1) {
98 return m_selectedSubviewType;
102 m_selectedSubviewType = subviewType;
106 int OutputExpressionsView::numberOfSubviews()
const {
113 View * OutputExpressionsView::subviewAtIndex(
int index) {
114 View * views[3] = {&m_approximateExpressionView, &m_approximateSign, &m_exactExpressionView};
118 void OutputExpressionsView::layoutSubviews() {
121 if (numberOfSubviews() == 1) {
122 m_approximateExpressionView.
setFrame(
KDRect(0, 0, approximateExpressionSize.
width(), height));
127 KDCoordinate baseline = max(exactBaseline, approximateBaseline);
130 m_exactExpressionView.
setFrame(
KDRect(0, baseline-exactBaseline, exactExpressionSize));
131 m_approximateExpressionView.
setFrame(
KDRect(2*k_digitHorizontalMargin+exactExpressionSize.
width()+approximateSignSize.
width(), baseline-approximateBaseline, approximateExpressionSize));
132 m_approximateSign.
setFrame(
KDRect(k_digitHorizontalMargin+exactExpressionSize.
width(), baseline-approximateSignSize.
height()/2, approximateSignSize));
void setHighlighted(bool highlight) override
void setBackgroundColor(KDColor backgroundColor)
void didBecomeFirstResponder() override
KDSize minimalSizeForOptimalDisplay() const override
void setFrame(KDRect frame)
constexpr KDCoordinate width() const
void setExpression(Poincare::ExpressionLayout *expressionLayout)
void setSelectedSubviewType(SubviewType subviewType)
Responder * parentResponder() const
KDSize minimalSizeForOptimalDisplay() const override
constexpr KDColor KDColorWhite
static constexpr KDColor Select
void setMessage(I18n::Message message)
Poincare::ExpressionLayout * expressionLayout() const
void setEqualMessage(I18n::Message equalSignMessage)
KDSize minimalSizeForOptimalDisplay() const override
void reloadCell() override
constexpr KDColor KDColorBlack
void setTextColor(KDColor textColor)
bool isHighlighted() const
bool handleEvent(Ion::Events::Event event) override
static constexpr KDColor WallScreen
KDColor backgroundColor() const override
SubviewType selectedSubviewType()
static constexpr KDColor GreyVeryDark
KDCoordinate width() const
void setExpressions(Poincare::ExpressionLayout **expressionsLayout)
void setBackgroundColor(KDColor backgroundColor)
KDCoordinate height() const
constexpr KDCoordinate height() const