2 #include "view_btree_data.h"
3 #define NODE_PTR_WIDTH 5
5 ViewBTreeData::ViewBTreeData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2):
6 Canvas::Rect (*parent, x1, y1, x2, y2)
9 property_fill_color () = "red";
10 property_outline_color () = "black";
13 void ViewBTreeData::init (Canvas::Group *parent)
15 double w = property_x2() - property_x1();
16 double h = property_y2() - property_y1();
18 Canvas::Rect *ptr = new Canvas::Rect (*parent, property_x1()+w-NODE_PTR_WIDTH, h-NODE_PTR_WIDTH, property_x1()+w-1, h-1);
19 ptr->property_fill_color () = "green";
20 ptr->property_outline_color () = "black";
23 bool ViewBTreeData::on_event (GdkEvent *p1)
26 case GDK_BUTTON_PRESS:
27 m_signal_clicked(data, this);
30 return Canvas::Rect::on_event (p1);
34 ViewBTreeData::type_signal_clicked ViewBTreeData::signal_clicked ()
36 return m_signal_clicked;
40 ViewBTreeData::Create (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2)
43 if (dynamic_cast<BTreeChildData *>(data))
44 ret = new ViewBTreeChildData (data, parent, x1, y1, x2, y2);
46 ret = new ViewBTreeData (data, parent, x1, y1, x2, y2);
51 ViewBTreeChildData::ViewBTreeChildData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2):
52 ViewBTreeData (data, parent, x1, y1, x2, y2)
56 void ViewBTreeChildData::init (Canvas::Group *parent)
58 property_outline_color () = "black";
61 void ViewBTreeData::SetSelected (bool b)
64 property_fill_color () = "yellow";
66 property_fill_color () = "red";