1 #include "canvas-flag.h"
5 using namespace Gnome::Canvas;
9 CanvasFlag::delete_allocated_objects()
22 CanvasFlag::set_text(const string& a_text)
24 delete_allocated_objects();
26 _text = new InteractiveText(*this, this, 0.0, 0.0, Glib::ustring(a_text));
27 _text->property_justification() = Gtk::JUSTIFY_CENTER;
28 _text->property_fill_color_rgba() = _outline_color_rgba;
29 double flagwidth = _text->property_text_width() + 10.0;
30 double flagheight = _text->property_text_height() + 3.0;
31 _text->property_x() = flagwidth / 2.0;
32 _text->property_y() = flagheight / 2.0;
34 _line = new SimpleLine(*this, 0.0, 0.0, 0.0, _height);
35 _line->property_color_rgba() = _outline_color_rgba;
36 _rect = new InteractiveRect(*this, this, 0.0, 0.0, flagwidth, flagheight);
37 _rect->property_outline_color_rgba() = _outline_color_rgba;
38 _rect->property_fill_color_rgba() = _fill_color_rgba;
39 _text->raise_to_top();
42 CanvasFlag::~CanvasFlag()
44 delete_allocated_objects();
48 CanvasFlag::on_event(GdkEvent* /*ev*/)