mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] Change dynamic view controller paradigm
Change-Id: I57fd41c9b9ad8a1e8b684b97fdf80ddffd71881d
This commit is contained in:
@@ -25,6 +25,7 @@ void FloatParameterController::didBecomeFirstResponder() {
|
||||
}
|
||||
|
||||
void FloatParameterController::viewWillAppear() {
|
||||
DynamicViewController::viewWillAppear();
|
||||
selectableTableView()->reloadData();
|
||||
if (selectedRow() == -1) {
|
||||
selectCellAtLocation(0, 0);
|
||||
@@ -169,13 +170,6 @@ int FloatParameterController::activeCell() {
|
||||
return selectedRow();
|
||||
}
|
||||
|
||||
void FloatParameterController::unloadView() {
|
||||
assert(m_okButton != nullptr);
|
||||
delete m_okButton;
|
||||
m_okButton = nullptr;
|
||||
DynamicViewController::unloadView();
|
||||
}
|
||||
|
||||
StackViewController * FloatParameterController::stackController() {
|
||||
return (StackViewController *)parentResponder();
|
||||
}
|
||||
@@ -184,16 +178,6 @@ SelectableTableView * FloatParameterController::selectableTableView() {
|
||||
return (SelectableTableView *)view();
|
||||
}
|
||||
|
||||
View * FloatParameterController::createView() {
|
||||
SelectableTableView * tableView = new SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, this);
|
||||
assert(m_okButton == nullptr);
|
||||
m_okButton = new ButtonWithSeparator(tableView, okButtonText(), Invocation([](void * context, void * sender) {
|
||||
FloatParameterController * parameterController = (FloatParameterController *) context;
|
||||
parameterController->buttonAction();
|
||||
}, this));
|
||||
return tableView;
|
||||
}
|
||||
|
||||
void FloatParameterController::buttonAction() {
|
||||
StackViewController * stack = stackController();
|
||||
stack->pop();
|
||||
@@ -203,4 +187,19 @@ I18n::Message FloatParameterController::okButtonText() {
|
||||
return I18n::Message::Ok;
|
||||
}
|
||||
|
||||
View * FloatParameterController::loadView() {
|
||||
SelectableTableView * tableView = new SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, this);
|
||||
m_okButton = new ButtonWithSeparator(tableView, okButtonText(), Invocation([](void * context, void * sender) {
|
||||
FloatParameterController * parameterController = (FloatParameterController *) context;
|
||||
parameterController->buttonAction();
|
||||
}, this));
|
||||
return tableView;
|
||||
}
|
||||
|
||||
void FloatParameterController::unloadView(View * view) {
|
||||
delete m_okButton;
|
||||
m_okButton = nullptr;
|
||||
delete view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user