mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[shared] Temporarily duplicate shared controllers to take a
StorageFunction instead of a Function The original controllers are to be deleted when Sequence uses Storage
This commit is contained in:
43
apps/shared/storage_function_curve_parameter_controller.cpp
Normal file
43
apps/shared/storage_function_curve_parameter_controller.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "storage_function_curve_parameter_controller.h"
|
||||
#include <assert.h>
|
||||
|
||||
namespace Shared {
|
||||
|
||||
StorageFunctionCurveParameterController::StorageFunctionCurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
|
||||
ViewController(nullptr),
|
||||
m_goToCell(I18n::Message::Goto),
|
||||
m_selectableTableView(this, this, this),
|
||||
m_function(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
View * StorageFunctionCurveParameterController::view() {
|
||||
return &m_selectableTableView;
|
||||
}
|
||||
|
||||
void StorageFunctionCurveParameterController::didBecomeFirstResponder() {
|
||||
if (selectedRow() < 0) {
|
||||
selectCellAtLocation(0, 0);
|
||||
}
|
||||
app()->setFirstResponder(&m_selectableTableView);
|
||||
}
|
||||
|
||||
bool StorageFunctionCurveParameterController::handleGotoSelection() {
|
||||
if (m_function == nullptr) {
|
||||
return false;
|
||||
}
|
||||
goToParameterController()->setFunction(m_function);
|
||||
StackViewController * stack = (StackViewController *)parentResponder();
|
||||
stack->push(goToParameterController());
|
||||
return true;
|
||||
}
|
||||
|
||||
KDCoordinate StorageFunctionCurveParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void StorageFunctionCurveParameterController::setFunction(StorageFunction * function) {
|
||||
m_function = function;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user