mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Create an abstract class for banner view
Change-Id: Ib0235866a2850caa78dc7caf246b42a5c4bc7db5
This commit is contained in:
@@ -9,6 +9,7 @@ include apps/statistics/Makefile
|
||||
app_objs += $(addprefix apps/,\
|
||||
apps_container.o\
|
||||
constant.o\
|
||||
banner_view.o\
|
||||
cursor_view.o\
|
||||
curve_view.o\
|
||||
curve_view_with_banner.o\
|
||||
|
||||
5
apps/banner_view.cpp
Normal file
5
apps/banner_view.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "banner_view.h"
|
||||
|
||||
void BannerView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
}
|
||||
12
apps/banner_view.h
Normal file
12
apps/banner_view.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef APPS_BANNER_VIEW_H
|
||||
#define APPS_BANNER_VIEW_H
|
||||
|
||||
#include <escher.h>
|
||||
|
||||
class BannerView : public View {
|
||||
public:
|
||||
virtual void reload() = 0;
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -33,10 +33,6 @@ void BannerView::reload() {
|
||||
}
|
||||
}
|
||||
|
||||
void BannerView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
}
|
||||
|
||||
void BannerView::setDisplayDerivative(bool displayDerivative) {
|
||||
m_displayDerivative = displayDerivative;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include <escher.h>
|
||||
#include "graph_window.h"
|
||||
#include "../../banner_view.h"
|
||||
|
||||
namespace Graph {
|
||||
|
||||
class BannerView : public View {
|
||||
class BannerView : public ::BannerView {
|
||||
public:
|
||||
BannerView(GraphWindow * graphWindow);
|
||||
void reload();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void reload() override;
|
||||
void setDisplayDerivative(bool displayDerivative);
|
||||
bool displayDerivative();
|
||||
private:
|
||||
|
||||
@@ -48,10 +48,6 @@ void BannerView::reload() {
|
||||
m_yView.setText(buffer);
|
||||
}
|
||||
|
||||
void BannerView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
}
|
||||
|
||||
int BannerView::numberOfSubviews() const {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include <escher.h>
|
||||
#include "data.h"
|
||||
#include "../banner_view.h"
|
||||
|
||||
namespace Regression {
|
||||
|
||||
class BannerView : public View {
|
||||
class BannerView : public ::BannerView {
|
||||
public:
|
||||
BannerView(Data * data);
|
||||
void reload();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void reload() override;
|
||||
private:
|
||||
constexpr static int k_maxNumberOfCharacters = 50;
|
||||
int numberOfSubviews() const override;
|
||||
|
||||
@@ -42,10 +42,6 @@ void BoxBannerView::reload() {
|
||||
m_calculationValue.setText(buffer);
|
||||
}
|
||||
|
||||
void BoxBannerView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
}
|
||||
|
||||
int BoxBannerView::numberOfSubviews() const {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
|
||||
#include <escher.h>
|
||||
#include "data.h"
|
||||
#include "../banner_view.h"
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
class BoxView;
|
||||
|
||||
class BoxBannerView : public View {
|
||||
class BoxBannerView : public ::BannerView {
|
||||
public:
|
||||
BoxBannerView(Data * data, BoxView * boxView);
|
||||
void reload();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void reload() override;
|
||||
private:
|
||||
constexpr static int k_maxNumberOfCharacters = 50;
|
||||
int numberOfSubviews() const override;
|
||||
|
||||
@@ -43,10 +43,6 @@ void HistogramBannerView::reload() {
|
||||
m_frequencyView.setText(buffer);
|
||||
}
|
||||
|
||||
void HistogramBannerView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
}
|
||||
|
||||
int HistogramBannerView::numberOfSubviews() const {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include <escher.h>
|
||||
#include "data.h"
|
||||
#include "../banner_view.h"
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
class HistogramBannerView : public View {
|
||||
class HistogramBannerView : public ::BannerView {
|
||||
public:
|
||||
HistogramBannerView(Data * data);
|
||||
void reload();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void reload() override;
|
||||
private:
|
||||
constexpr static int k_maxNumberOfCharacters = 50;
|
||||
int numberOfSubviews() const override;
|
||||
|
||||
Reference in New Issue
Block a user