Files
Upsilon/apps/shared/float_parameter_controller.h
Émilie Feral d46afd1343 [apps/shared] Correct bug
Change-Id: I194c13c9886d2184f841723d12dc8886b0e92878
2017-03-02 18:15:46 +01:00

34 lines
1.2 KiB
C++

#ifndef SHARED_FLOAT_PARAMETER_CONTROLLER_H
#define SHARED_FLOAT_PARAMETER_CONTROLLER_H
#include <escher.h>
#include "text_field_delegate.h"
namespace Shared {
/* This controller edits float parameter of any model (given through
* parameterAtIndex and setParameterAtIndex). */
class FloatParameterController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDelegate, public TextFieldDelegate {
public:
FloatParameterController(Responder * parentResponder);
View * view() override;
void viewWillAppear() override;
void didBecomeFirstResponder() override;
KDCoordinate cellHeight() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
protected:
int activeCell();
SelectableTableView m_selectableTableView;
private:
TextFieldDelegateApp * textFieldDelegateApp() override;
virtual float parameterAtIndex(int index) = 0;
virtual void setParameterAtIndex(int parameterIndex, float f) = 0;
};
}
#endif