From 3e85cc8bfccf63236e815eba64acd99fbe154daf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 18 Oct 2011 14:49:43 +0200 Subject: New Label and LED widgets. --- plugingui/label.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'plugingui/label.cc') diff --git a/plugingui/label.cc b/plugingui/label.cc index 8ec6330..a8ff0ae 100644 --- a/plugingui/label.cc +++ b/plugingui/label.cc @@ -26,6 +26,27 @@ */ #include "label.h" +#include "painter.h" + +Label::Label(GlobalContext *gctx, Widget *parent) + : Widget(gctx, parent) +{ +} + +void Label::setText(std::string text) +{ + _text = text; + repaint(NULL); +} + +void Label::repaint(RepaintEvent *e) +{ + Painter p(gctx, wctx); + p.setColour(Colour(1)); + p.drawText(10, height() / 2 + 4, _text); +} + + #ifdef TEST_LABEL //Additional dependency files //deps: -- cgit v1.2.3