Blame view

build6/epsilon-master/apps/regression/banner_view.cpp 1.31 KB
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  #include "banner_view.h"
  
  namespace Regression {
  
  constexpr KDColor BannerView::k_textColor;
  constexpr KDColor BannerView::k_backgroundColor;
  
  BannerView::BannerView() :
    m_dotNameView(k_fontSize, 0.0f, 0.5f, k_textColor, k_backgroundColor),
    m_xView(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_yView(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_regressionTypeView(k_fontSize, (I18n::Message)0, 0.0f, 0.5f, k_textColor,k_backgroundColor),
    m_subText1(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_subText2(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_subText3(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_subText4(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor),
    m_subText5(k_fontSize, 0.5f, 0.5f, k_textColor, k_backgroundColor)
  {
  }
  
  int BannerView::numberOfSubviews() const {
    return k_numberOfTextViews;
  }
  
  TextView * BannerView::textViewAtIndex(int i) const {
    const TextView * textViews[k_numberOfTextViews] = {&m_dotNameView, &m_xView, &m_yView, &m_regressionTypeView, &m_subText1, &m_subText2, &m_subText3, &m_subText4, &m_subText5};
    return (TextView *)textViews[i];
  }
  
  MessageTextView * BannerView::messageTextViewAtIndex(int i) const {
    if (i == 3) {
      return (MessageTextView *)&m_regressionTypeView;
    }
    return nullptr;
  }
  
  }