Numworks Epsilon  1.4.1
Graphing Calculator Operating System
button.h
Go to the documentation of this file.
1 #ifndef ESCHER_BUTTON_H
2 #define ESCHER_BUTTON_H
3 
5 #include <escher/i18n.h>
6 #include <escher/responder.h>
8 #include <escher/invocation.h>
9 
10 class Button : public HighlightCell, public Responder {
11 public:
12  Button(Responder * parentResponder, I18n::Message textBody, Invocation invocation, KDText::FontSize size = KDText::FontSize::Small, KDColor textColor = KDColorBlack);
13  bool handleEvent(Ion::Events::Event event) override;
14  void setHighlighted(bool highlight) override;
15  Responder * responder() override {
16  return this;
17  }
18  KDSize minimalSizeForOptimalDisplay() const override;
19 protected:
21 private:
22  constexpr static KDCoordinate k_verticalMargin = 5;
23  constexpr static KDCoordinate k_horizontalMarginSmall = 10;
24  constexpr static KDCoordinate k_horizontalMarginLarge = 20;
25  int numberOfSubviews() const override;
26  View * subviewAtIndex(int index) override;
27  void layoutSubviews() override;
28  Invocation m_invocation;
29  KDText::FontSize m_size;
30 };
31 
32 #endif
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
KDSize minimalSizeForOptimalDisplay() const override
Definition: button.cpp:42
MessageTextView m_messageTextView
Definition: button.h:20
Definition: size.h:6
Responder * responder() override
Definition: button.h:15
bool handleEvent(Ion::Events::Event event) override
Definition: button.cpp:27
void setHighlighted(bool highlight) override
Definition: button.cpp:35
constexpr KDColor KDColorBlack
Definition: color.h:41
Definition: color.h:6
Definition: view.h:23
Button(Responder *parentResponder, I18n::Message textBody, Invocation invocation, KDText::FontSize size=KDText::FontSize::Small, KDColor textColor=KDColorBlack)
Definition: button.cpp:5
Definition: button.h:10
FontSize
Definition: text.h:10