00001 #include "LCDIcon.h"
00002 #include <sstream>
00003
00004 using namespace std;
00005
00006 LCDIcon::LCDIcon(LCDElement *parent, const string &id) : LCDWidget(id, parent, "icon")
00007 {
00008 }
00009
00010 LCDIcon::LCDIcon(const string &type, int x, int y, LCDElement *parent, const string &id) : LCDWidget(id, parent, "string")
00011 {
00012 set(type, x, y);
00013 }
00014
00015 void LCDIcon::set(const string &type, int x, int y)
00016 {
00017 _type = type;
00018 _x = x;
00019 _y = y;
00020 notifyChanged();
00021 }
00022 void LCDIcon::notifyChanged()
00023 {
00024 ostringstream params;
00025
00026 params << _x
00027 << " "
00028 << _y
00029 << " "
00030 << _type;
00031
00032 setWidgetParameters(params.str());
00033 }
00034
00035 void LCDIcon::setIcon(const string &type)
00036 {
00037 _type = type;
00038 notifyChanged();
00039 }
00040
00041 string LCDIcon::getIcon()
00042 {
00043 return _type;
00044 }