changes to help strp silence
[ardour.git] / gtk2_ardour / canvas-flag.cc
1 #include "canvas-flag.h"
2 #include <iostream>
3 #include "ardour_ui.h"
4
5 using namespace Gnome::Canvas;
6 using namespace std;
7
8 void
9 CanvasFlag::delete_allocated_objects()
10 {
11         delete _text;
12         _text = 0;
13
14         delete _line;
15         _line = 0;
16
17         delete _rect;
18         _rect = 0;
19 }
20
21 void
22 CanvasFlag::set_text(const string& a_text)
23 {
24         delete_allocated_objects();
25
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;
33         _text->show();
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();
40 }
41
42 CanvasFlag::~CanvasFlag()
43 {
44         delete_allocated_objects();
45 }
46
47 bool
48 CanvasFlag::on_event(GdkEvent* /*ev*/)
49 {
50         return false;
51 }