* added myself to about.cc
[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                 
9 void 
10 CanvasFlag::set_text(string a_text)
11 {
12         if (_text) {
13                 delete _text;
14         }
15         
16         _text = new Text(*this, 0.0, 0.0, a_text);
17         _text->property_justification() = Gtk::JUSTIFY_CENTER;
18         _text->property_fill_color_rgba() = _outline_color_rgba;
19         double flagwidth  = _text->property_text_width()  + 10.0;
20         double flagheight = _text->property_text_height() + 3.0;
21         _text->property_x() = flagwidth / 2.0;
22         _text->property_y() = flagheight / 2.0;
23         _text->show();
24         _line = new SimpleLine(*this, 0.0, 0.0, 0.0, _height);
25         _line->property_color_rgba() = _outline_color_rgba;
26         _rect = new SimpleRect(*this, 0.0, 0.0, flagwidth, flagheight);
27         _rect->property_outline_color_rgba() = _outline_color_rgba;
28         _rect->property_fill_color_rgba() = _fill_color_rgba;
29         _text->lower_to_bottom();
30         _text->raise(2);        
31 }
32
33 CanvasFlag::~CanvasFlag()
34 {
35         delete _line;
36         delete _rect;
37         if(_text) {
38                 delete _text;
39         }
40 }
41