33 CellRendererPixbufToggle::CellRendererPixbufToggle() :
36 property_pixbuf_(*this,
"pixbuf"),
37 property_active_(*this,
"active", false)
39 property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
42 property_sensitive() =
false;
45 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> >
51 Glib::PropertyProxy<bool>
58 Glib::PropertyProxy_Base
74 CellRendererPixbufToggle::render_vfunc (
const Glib::RefPtr<Gdk::Drawable>& window, Gtk::Widget& ,
const Gdk::Rectangle& ,
const Gdk::Rectangle& cell_area,
const Gdk::Rectangle& , Gtk::CellRendererState )
77 int offset_height = 0;
81 offset_width = cell_area.get_x() + (int)(cell_area.get_width() -
inactive_pixbuf->get_width())/2;
82 offset_height = cell_area.get_y() + (int)(cell_area.get_height() -
inactive_pixbuf->get_height())/2;
84 window->draw_pixbuf (RefPtr<GC>(),
active_pixbuf, 0, 0, offset_width, offset_height, -1, -1, Gdk::RGB_DITHER_NORMAL, 0, 0);
87 offset_width = cell_area.get_x() + (int)(cell_area.get_width() -
inactive_pixbuf->get_width())/2;
88 offset_height = cell_area.get_y() + (int)(cell_area.get_height() -
inactive_pixbuf->get_height())/2;
90 window->draw_pixbuf (RefPtr<GC>(),
inactive_pixbuf, 0, 0, offset_width, offset_height, -1, -1, Gdk::RGB_DITHER_NORMAL, 0, 0);
Glib::Property< bool > property_active_
SignalToggled & signal_toggled()
Glib::RefPtr< Gdk::Pixbuf > inactive_pixbuf
Glib::PropertyProxy< Glib::RefPtr< Gdk::Pixbuf > > property_pixbuf()
Glib::PropertyProxy_Base _property_renderable()
virtual bool activate_vfunc(GdkEvent *, Gtk::Widget &, const Glib::ustring &path, const Gdk::Rectangle &, const Gdk::Rectangle &, Gtk::CellRendererState)
Glib::RefPtr< Gdk::Pixbuf > active_pixbuf
void set_active_pixbuf(Glib::RefPtr< Gdk::Pixbuf > pixbuf)
SignalToggled signal_toggled_
virtual void get_size_vfunc(Gtk::Widget &widget, const Gdk::Rectangle *cell_area, int *x_offset, int *y_offset, int *width, int *height) const
Glib::Property< Glib::RefPtr< Gdk::Pixbuf > > property_pixbuf_
Glib::PropertyProxy< bool > property_active()
void set_inactive_pixbuf(Glib::RefPtr< Gdk::Pixbuf > pixbuf)
sigc::signal< void, const Glib::ustring & > SignalToggled
virtual void render_vfunc(const Glib::RefPtr< Gdk::Drawable > &window, Gtk::Widget &widget, const Gdk::Rectangle &background_area, const Gdk::Rectangle &cell_area, const Gdk::Rectangle &expose_area, Gtk::CellRendererState flags)