From: Ricardo Markiewicz Date: Fri, 23 Sep 2005 17:32:26 +0000 (+0000) Subject: Muestro mas datos en las claves e hijos. X-Git-Tag: 1_0-pre1~115 X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/commitdiff_plain/439b54b40ab317655a60bf1c323446b3dfb6e7d2?ds=inline Muestro mas datos en las claves e hijos. --- diff --git a/viewer/view_btree_data.cpp b/viewer/view_btree_data.cpp index 403da55..a98c30e 100644 --- a/viewer/view_btree_data.cpp +++ b/viewer/view_btree_data.cpp @@ -7,6 +7,17 @@ ViewBTreeData::ViewBTreeData (BTreeData *data, Canvas::Group *parent, double x1, this->data = data; property_fill_color () = "red"; property_outline_color () = "black"; + + init (parent); +} + +void ViewBTreeData::init (Canvas::Group *parent) +{ + double w = property_x2() - property_x1(); + double h = property_y2() - property_y1(); + + std::string s = *data; + Canvas::Text *text = new Canvas::Text (*parent, property_x1()+w/2, h/2, s); } @@ -21,14 +32,18 @@ ViewBTreeData::Create (BTreeData *data, Canvas::Group *parent, double x1, double ViewBTreeChildData::ViewBTreeChildData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2): ViewBTreeData (data, parent, x1, y1, x2, y2) +{ +} + +void ViewBTreeChildData::init (Canvas::Group *parent) { property_fill_color () = "yellow"; property_outline_color () = "black"; - double w = x2 - x1; - double h = y2 - y1; + double w = property_x2() - property_x1(); + double h = property_y2() - property_y1(); std::string s = *data; - Canvas::Text *text = new Canvas::Text (*parent, x1 + w/2, y1 + h/2, s); + Canvas::Text *text = new Canvas::Text (*parent, property_x1()+w/2, h/2, s); } diff --git a/viewer/view_btree_data.h b/viewer/view_btree_data.h index 4fb9510..4020b3f 100644 --- a/viewer/view_btree_data.h +++ b/viewer/view_btree_data.h @@ -17,6 +17,7 @@ class ViewBTreeData :public Canvas::Rect { static ViewBTreeData *Create (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2); protected: + virtual void init (Canvas::Group *parent); BTreeData *data; }; @@ -25,6 +26,7 @@ class ViewBTreeChildData :public ViewBTreeData { ViewBTreeChildData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2); protected: + virtual void init (Canvas::Group *parent); BTreeData *data; }; #endif