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)
17 bool ViewBTreeData::on_event (GdkEvent *p1)
20 case GDK_BUTTON_PRESS:
23 case GDK_2BUTTON_PRESS:
24 m_signal_double_clicked (data, this);
27 return Canvas::Rect::on_event (p1);
31 ViewBTreeData::type_signal_clicked ViewBTreeData::signal_clicked ()
33 return m_signal_clicked;
36 ViewBTreeData::type_signal_double_clicked ViewBTreeData::signal_double_clicked ()
38 return m_signal_double_clicked;
43 ViewBTreeData::Create (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2)
46 if (dynamic_cast<BTreeChildData *>(data))
47 ret = new ViewBTreeChildData (data, parent, x1, y1, x2, y2);
49 ret = new ViewBTreeData (data, parent, x1, y1, x2, y2);
54 ViewBTreeChildData::ViewBTreeChildData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2):
55 ViewBTreeData (data, parent, x1, y1, x2, y2)
59 void ViewBTreeChildData::init (Canvas::Group *parent)
61 property_outline_color () = "black";
64 void ViewBTreeData::SetSelected (bool b)
67 property_fill_color () = "yellow";
68 m_signal_clicked(data, this);
70 property_fill_color () = "red";
74 bool ViewBTreeData::operator == (Clave &k) const
76 if (!data->GetKey ()) return false;
78 return (*(data->GetKey ())) == k;