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