Files
Upsilon/escher/src/buffer_text_view.cpp
Émilie Feral c0dc33cfbd [escher] Make one constructor only for views
Change-Id: I304a49995beb59071dd88fcfad8715bdb58e6685
2016-12-13 15:10:02 +01:00

20 lines
530 B
C++

#include <escher/buffer_text_view.h>
#include <string.h>
#include <assert.h>
BufferTextView::BufferTextView(float horizontalAlignment, float verticalAlignment,
KDColor textColor, KDColor backgroundColor) :
TextView(horizontalAlignment, verticalAlignment, textColor, backgroundColor)
{
}
const char * BufferTextView::text() const {
return m_buffer;
}
void BufferTextView::setText(const char * text) {
assert(strlen(text) < sizeof(m_buffer));
strlcpy(m_buffer, text, sizeof(m_buffer));
markRectAsDirty(bounds());
}