UniImage.h
00001 #ifndef _UniImage_H_
00002 #define _UniImage_H_
00003
00004 #include "GeneralUI.h"
00005
00006 namespace UniSetGraphics
00007 {
00008
00009 class UniImage: public GeneralUI
00010 {
00011 public:
00012 UniImage(string pictireFile, string name = "", string font_descr = "Arial Bold 12",
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
00017 UniImage(bool use_eventbox, string pictireFile, string name = "", string font_descr = "Arial Bold 12",
00018 guint x_pad = 0, guint y_pad = 0,
00019 Gtk::AttachOptions x_opt = Gtk::FILL|Gtk::EXPAND,
00020 Gtk::AttachOptions y_opt = Gtk::FILL|Gtk::EXPAND );
00021
00022 UniImage();
00023 virtual ~UniImage(){};
00024
00025 virtual void on();
00026 virtual void off();
00027 virtual void blink(int timeout = 300);
00028 virtual bool blink_handler();
00029
00030 void set_img_size( int width, int height );
00031 void set_images_path(string path){this->path = path;}
00032 void set_on_state(string on_state);
00033 void set_off_state(string off_state);
00034 void blink(string on_state, string off_state, int timeout = 300);
00035 void set_state(string state);
00036 string get_state();
00037 Gtk::Fixed* get_place(){return fixed;}
00038 Gtk::EventBox* get_eventbox(){return ebox;}
00039
00040 protected:
00041
00042 private:
00043 Gtk::Image *img;
00044 Gtk::Fixed *fixed;
00045 Gtk::EventBox *ebox;
00046
00047 string state;
00048 string off_state;
00049 string on_state;
00050 string path;
00051 };
00052
00053 }
00054
00055 #endif // _UniImage_H_