mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 06:10:31 +01:00
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#include "banner_view.h"
|
|
#include "../../i18n.h"
|
|
|
|
namespace Graph {
|
|
|
|
BannerView::BannerView() :
|
|
m_abscissaView(KDFont::SmallFont, 0.5f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_functionView(KDFont::SmallFont, 0.5f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_derivativeView(KDFont::SmallFont, 0.5f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_tangentEquationView(KDFont::SmallFont, I18n::Message::LinearRegressionFormula, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_aView(KDFont::SmallFont, 0.5f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_bView(KDFont::SmallFont, 0.5f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
|
m_numberOfSubviews(2)
|
|
{
|
|
}
|
|
|
|
void BannerView::setNumberOfSubviews(int numberOfSubviews) {
|
|
m_numberOfSubviews = numberOfSubviews;
|
|
}
|
|
|
|
int BannerView::numberOfSubviews() const {
|
|
return m_numberOfSubviews;
|
|
}
|
|
|
|
TextView * BannerView::textViewAtIndex(int i) const {
|
|
const TextView * textViews[6] = {&m_abscissaView, &m_functionView, &m_derivativeView, &m_tangentEquationView, &m_aView, &m_bView};
|
|
return (TextView *)textViews[i];
|
|
}
|
|
|
|
MessageTextView * BannerView::messageTextViewAtIndex(int i) const {
|
|
if (i == 3) {
|
|
return (MessageTextView *)&m_tangentEquationView;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
}
|