SimpleText.h
00001 #ifndef _SIMPLETEXT_H
00002 #define _SIMPLETEXT_H
00003
00004 #include <gtkmm.h>
00005 #include <plugins.h>
00006 #include <global_macros.h>
00007 #include <components/SimpleView.h>
00008
00009 namespace UniWidgets
00010 {
00017 class SimpleText : public SimpleView
00018 {
00019
00020 public:
00021 SimpleText();
00022 explicit SimpleText(SimpleView::BaseObjectType* gobject);
00023 virtual ~SimpleText();
00024
00025
00026 virtual void text_draw();
00028 int get_text_width(){return layout->get_width();}
00029 int get_text_height(){return layout->get_height();}
00030 void get_pixel_size(int &w,int &h){layout->get_pixel_size(w, h);}
00031
00032 protected:
00033
00034 virtual bool on_expose_event(GdkEventExpose* event);
00035 virtual void on_realize();
00036 virtual void on_transparency_changed();
00037 virtual void on_dropshadow_changed();
00038 virtual void on_text_changed();
00039
00040 Glib::RefPtr<Pango::Layout> layout;
00041 Cairo::RefPtr<Cairo::Context> cr;
00042
00043
00044 Gdk::Color current_color;
00045 double transparency;
00047 private:
00048
00049 void constructor();
00050 DISALLOW_COPY_AND_ASSIGN(SimpleText);
00051 ADD_PROPERTY( property_text_, Glib::ustring )
00052 ADD_PROPERTY( property_drop_shadow_, bool )
00053 ADD_PROPERTY( property_transparency_, double )
00054 ADD_PROPERTY( property_alignment_, Pango::Alignment )
00055
00056 };
00057
00058 }
00059 #endif