Blame view

build2/epsilon-master/apps/shared/function_curve_parameter_controller.cpp 1.11 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  #include "function_curve_parameter_controller.h"
  #include <assert.h>
  
  namespace Shared {
  
  FunctionCurveParameterController::FunctionCurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
    ViewController(nullptr),
    m_goToCell(I18n::Message::Goto),
    m_selectableTableView(this, this, this),
    m_function(nullptr)
  {
  }
  
  View * FunctionCurveParameterController::view() {
    return &m_selectableTableView;
  }
  
  void FunctionCurveParameterController::didBecomeFirstResponder() {
    if (selectedRow() < 0) {
      selectCellAtLocation(0, 0);
    }
    app()->setFirstResponder(&m_selectableTableView);
  }
  
  bool FunctionCurveParameterController::handleGotoSelection() {
    if (m_function == nullptr) {
      return false;
    }
    goToParameterController()->setFunction(m_function);
    StackViewController * stack = (StackViewController *)parentResponder();
    stack->push(goToParameterController());
    return true;
  }
  
  KDCoordinate FunctionCurveParameterController::cellHeight() {
    return Metric::ParameterCellHeight;
  }
  
  void FunctionCurveParameterController::setFunction(Function * function) {
    m_function = function;
  }
  
  }