From a5d27c1f06b1ba1c6af609830512ced09ceddb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 7 Feb 2017 11:04:37 +0100 Subject: [PATCH] [apps/shared] Move apps/graph/list/new_function_cell to shared folder to be used by sequence Change-Id: Ie42a8b6cc60e652ab49379dd72b00f2efdc6ebda --- apps/graph/Makefile | 1 - apps/graph/list/list_controller.h | 4 ++-- apps/shared/Makefile | 1 + apps/{graph/list => shared}/new_function_cell.cpp | 9 +++++++-- apps/{graph/list => shared}/new_function_cell.h | 9 +++++---- 5 files changed, 15 insertions(+), 9 deletions(-) rename apps/{graph/list => shared}/new_function_cell.cpp (69%) rename apps/{graph/list => shared}/new_function_cell.h (72%) diff --git a/apps/graph/Makefile b/apps/graph/Makefile index 5daad1a07..c8bf63037 100644 --- a/apps/graph/Makefile +++ b/apps/graph/Makefile @@ -9,7 +9,6 @@ app_objs += $(addprefix apps/graph/,\ graph/graph_controller.o\ graph/graph_view.o\ graph/initialisation_parameter_controller.o\ - list/new_function_cell.o\ list/list_controller.o\ values/abscissa_parameter_controller.o\ values/derivative_parameter_controller.o\ diff --git a/apps/graph/list/list_controller.h b/apps/graph/list/list_controller.h index 01fe388af..3069c3d1b 100644 --- a/apps/graph/list/list_controller.h +++ b/apps/graph/list/list_controller.h @@ -5,7 +5,7 @@ #include "../function_store.h" #include "../function_title_cell.h" #include "../../shared/function_expression_cell.h" -#include "new_function_cell.h" +#include "../../shared/new_function_cell.h" #include "../../shared/list_parameter_controller.h" namespace Graph { @@ -45,7 +45,7 @@ private: FunctionTitleCell m_functionTitleCells[k_maxNumberOfRows]; Shared::FunctionExpressionCell m_expressionCells[k_maxNumberOfRows]; EvenOddCell m_emptyCell; - NewFunctionCell m_addNewFunction; + Shared::NewFunctionCell m_addNewFunction; SelectableTableView m_selectableTableView; FunctionStore * m_functionStore; Shared::ListParameterController m_parameterController; diff --git a/apps/shared/Makefile b/apps/shared/Makefile index de87510f7..d9592aad9 100644 --- a/apps/shared/Makefile +++ b/apps/shared/Makefile @@ -15,6 +15,7 @@ app_objs += $(addprefix apps/shared/,\ interactive_curve_view_range.o\ list_parameter_controller.o\ memoized_curve_view_range.o\ + new_function_cell.o\ range_parameter_controller.o\ store_controller.o\ store_parameter_controller.o\ diff --git a/apps/graph/list/new_function_cell.cpp b/apps/shared/new_function_cell.cpp similarity index 69% rename from apps/graph/list/new_function_cell.cpp rename to apps/shared/new_function_cell.cpp index 466ee6c08..7ba2b350e 100644 --- a/apps/graph/list/new_function_cell.cpp +++ b/apps/shared/new_function_cell.cpp @@ -1,12 +1,13 @@ #include "new_function_cell.h" #include "assert.h" -namespace Graph { +namespace Shared { NewFunctionCell::NewFunctionCell() : EvenOddCell(), - m_pointerTextView(PointerTextView(KDText::FontSize::Large, "Ajouter une fonction", 0.5f, 0.5f)) + m_pointerTextView(PointerTextView(KDText::FontSize::Large, nullptr, 0.5f, 0.5f)) { + m_pointerTextView.setText(text()); } void NewFunctionCell::reloadCell() { @@ -27,4 +28,8 @@ void NewFunctionCell::layoutSubviews() { m_pointerTextView.setFrame(bounds()); } +const char * NewFunctionCell::text() { + return "Ajouter une fonction"; +} + } diff --git a/apps/graph/list/new_function_cell.h b/apps/shared/new_function_cell.h similarity index 72% rename from apps/graph/list/new_function_cell.h rename to apps/shared/new_function_cell.h index 52661d384..ecb70e817 100644 --- a/apps/graph/list/new_function_cell.h +++ b/apps/shared/new_function_cell.h @@ -1,9 +1,10 @@ -#ifndef GRAPH_NEW_FUNCTION_CELL_H -#define GRAPH_NEW_FUNCTION_CELL_H +#ifndef SHARED_NEW_FUNCTION_CELL_H +#define SHARED_NEW_FUNCTION_CELL_H #include -namespace Graph { +namespace Shared { + class NewFunctionCell : public EvenOddCell { public: NewFunctionCell(); @@ -11,8 +12,8 @@ public: int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews() override; - protected: + virtual const char * text(); PointerTextView m_pointerTextView; };