UValueIndicator.h

00001 #ifndef _UVALUEINDICATOR_H
00002 #define _UVALUEINDICATOR_H
00003 // -------------------------------------------------------------------------
00004 #include "UEventBox.h"
00005 // -------------------------------------------------------------------------
00006 /* Color masks */
00007 #define COLOR_RED_MASK      0xFF0000
00008 #define COLOR_GREEN_MASK    0xFF00
00009 #define COLOR_BLUE_MASK     0xFF
00010 /* Bits offset*/
00011 #define BITS_OFFSET     8
00012 // -------------------------------------------------------------------------
00018 class UValueIndicator : public UEventBox
00019 {
00020 public:
00021     UValueIndicator();
00022     explicit UValueIndicator(GtkmmBaseType::BaseObjectType* gobject);
00023     ~UValueIndicator() {}
00024 
00025     virtual void on_connect() throw();
00026     virtual void on_disconnect() throw();
00027     virtual void set_connector(const ConnectorRef& connector) throw();
00028 
00029     /* Set methods for widget properties */
00034     void set_sensor_ai(const UniSetTypes::ObjectId sens_id, const UniSetTypes::ObjectId node_id);
00038     void set_precisions(const int precisions);
00042     void set_digits(const int digits);
00046     void set_fill_digits(const int digits);
00050     void set_font_color(const long font_color);
00051 
00052 protected:
00053     virtual bool on_expose_event(GdkEventExpose*);
00054 
00055 private:
00056     void ctor();
00057     void process_sensor(UniSetTypes::ObjectId, UniSetTypes::ObjectId, float);
00058 
00059     void on_value_changed();
00060     void on_bg_color_changed();
00061     void on_text_color_changed();
00062     void on_align_changed();
00063     void on_font_changed();
00064 
00065     Glib::RefPtr<Pango::Layout> layout_value_;
00066     sigc::connection sensor_connection_;
00067 
00068     SensorProp sensor_ai_;
00069 
00070     Glib::Property<double> property_value_;
00071     Glib::Property<Glib::ustring> property_font_name_;
00072 
00073     Glib::Property<int> property_precision_;
00074     Glib::Property<int> property_digits_;
00075     Glib::Property<int> property_fill_digits_;
00076 
00077 
00078     Glib::Property<bool> property_bg_transparent_;
00079     Glib::Property<Gdk::Color> property_font_color_;
00080     Glib::Property<Gdk::Color> property_bg_color_;
00081 
00082 
00083     Glib::Property<bool> property_hi_warning_on_;
00084     Glib::Property<float> property_hi_warning_;
00085     Glib::Property<Gdk::Color> property_hi_warning_color_;
00086 
00087     Glib::Property<bool> property_hi_alarm_on_;
00088     Glib::Property<float> property_hi_alarm_;
00089     Glib::Property<Gdk::Color> property_hi_alarm_color_;
00090 
00091     Glib::Property<bool> property_lo_warning_on_;
00092     Glib::Property<float> property_lo_warning_;
00093     Glib::Property<Gdk::Color> property_lo_warning_color_;
00094 
00095     Glib::Property<bool> property_lo_alarm_on_;
00096     Glib::Property<float> property_lo_alarm_;
00097     Glib::Property<Gdk::Color> property_lo_alarm_color_;
00098 
00099 };
00100 #endif

Документация по UniWidgets. Последние изменения: Fri Oct 10 09:57:50 2014. Создано системой  doxygen 1.5.9