Files
Upsilon/apps/graph/values/value_cell.cpp
Émilie Feral 352277f0a9 [apps/graph/values] Use Buffer text view in value cell class
Change-Id: Ib1d8d13a09bf4195f3ee9f2b266941fa996f9b8f
2016-10-18 09:46:14 +02:00

36 lines
611 B
C++

#include "value_cell.h"
#include "assert.h"
namespace Graph {
ValueCell::ValueCell() :
EvenOddCell(),
m_bufferTextView(BufferTextView(1.0f, 0.5f))
{
}
void ValueCell::reloadCell() {
EvenOddCell::reloadCell();
m_bufferTextView.setBackgroundColor(backgroundColor());
}
void ValueCell::setText(const char * textContent) {
m_bufferTextView.setText(textContent);
}
int ValueCell::numberOfSubviews() const {
return 1;
}
View * ValueCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_bufferTextView;
}
void ValueCell::layoutSubviews() {
m_bufferTextView.setFrame(bounds());
}
}