LedMeter.h
00001 #ifndef _LedMeter_H_
00002 #define _LedMeter_H_
00003
00004 #include "GeneralUI.h"
00005
00006 namespace UniSetGraphics
00007 {
00008
00009 class LedMeter: public GeneralUI
00010 {
00011 public:
00012 LedMeter(float value = 0, string font_descr = "DS Crystal 34",
00013 guint x_pad = 0, guint y_pad = 0,
00014 Gtk::AttachOptions x_opt = Gtk::FILL|Gtk::EXPAND,
00015 Gtk::AttachOptions y_opt = Gtk::FILL|Gtk::EXPAND );
00016 ~LedMeter(){};
00017
00018 virtual void on(){label->show();}
00019 virtual void off(){label->hide();}
00020 virtual bool blink_handler();
00021
00022 float get_value();
00023 void set_value(float value);
00024 void set_precision(int prec){this->prec = prec;}
00025 void modify_value_color(Gdk::Color color);
00026 void modify_bg_color(Gdk::Color color);
00027 Gtk::Label *get_title(){ return label; }
00028 Gtk::EventBox *get_boxbg(){ return ebox; }
00029
00030 protected:
00031
00032 private:
00033 Gtk::Label *label;
00034 Gtk::EventBox *ebox;
00035 float value;
00036 int prec;
00037 };
00038
00039 }
00040
00041 #endif // _LedMeter_H_