Blame view

emulateur/epsilon-nofrendo/apps/shared/message_view.h 707 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  #ifndef SHARED_MESSAGE_VIEW_H
  #define SHARED_MESSAGE_VIEW_H
  
  #include <escher.h>
  
  class MessageView : public View {
  public:
    MessageView(I18n::Message * messages, KDColor * colors, uint8_t numberOfMessages);
    void drawRect(KDContext * ctx, KDRect rect) const override;
  protected:
    int numberOfSubviews() const override { return m_numberOfMessages; }
    View * subviewAtIndex(int index) override;
    void layoutSubviews() override;
  private:
    constexpr static KDCoordinate k_titleMargin = 40;
    constexpr static KDCoordinate k_paragraphHeight = 100;
    constexpr static uint8_t k_maxNumberOfMessages = 8;
    MessageTextView m_messageTextViews[k_maxNumberOfMessages];
    uint8_t m_numberOfMessages;
  };
  
  #endif