4 ViewNode::ViewNode (Canvas::Group *parent, uint num, BTreeNodeHeader &header, std::list<BTreeData *> &keys)
5 : Canvas::Group (*parent)
7 double header_w = ViewBTree::byte_to_pixels * sizeof (BTreeNodeHeader);
11 Canvas::Rect *fondo = new Canvas::Rect (*this, 0, 0, NODE_WIDTH, NODE_HEIGHT);
12 fondo->property_fill_color() = "gray";
13 fondo->property_outline_color() = "black";
16 Canvas::Rect *h = new Canvas::Rect (*this, 0, 0, header_w, NODE_HEIGHT);
17 h->property_fill_color() = "blue";
18 h->property_outline_color() = "black";
25 new Canvas::Text (*this, header_w/2, NODE_HEIGHT/2, node_num);
29 std::list<BTreeData *>::iterator it = keys.begin ();
30 while (it != keys.end ()) {
31 BTreeData *data = (*it);
32 double w = ViewBTree::byte_to_pixels * data->Size ();
34 ViewBTreeData *v = ViewBTreeData::Create (data, this, x, 0, w+x, NODE_HEIGHT);
35 v->signal_clicked ().connect ( sigc::mem_fun (this , &ViewNode::on_item_clicked ));
39 if (!dynamic_cast<BTreeLeafData *>(data)) {
40 /* Si no es un dato de una hoja, tiene hijos */
41 hijos.push_back (data->getChild ());
46 void ViewNode::on_item_clicked (BTreeData *data)
48 m_signal_selected (data, num);
51 ViewNode::type_signal_selected ViewNode::signal_selected ()
53 return m_signal_selected;