diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-01 12:26:59 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-01 12:36:55 +0100 |
commit | d293d53136fa7e6e7eda510847145edf4d3d7f55 (patch) | |
tree | 50d5969dec90938cc7efd42e9aea5bfcf5aa6bae /grapher/CairoWidget.hxx | |
parent | 572a176d481c329b370ce52e7bec1a49ed76c225 (diff) | |
download | systemtap-steved-d293d53136fa7e6e7eda510847145edf4d3d7f55.tar.gz systemtap-steved-d293d53136fa7e6e7eda510847145edf4d3d7f55.tar.xz systemtap-steved-d293d53136fa7e6e7eda510847145edf4d3d7f55.zip |
Add hover text to the graph.
When the graph display is paused, leaving the mouse stationary over
the graph will display the data point under the pointer.
* grapher/CairoWidget.hxx (CairoTextBox): new class
(CairoWidget, CairoPlayButton): refector some play button-specific
things from CairoWidget to CairoPlayButton.
* grapher/CairoWidget.cxx (CairoTextBox::draw): new function.
* grapher/GraphWidget.hxx (GraphWidget): new members for supporting
hover text.
* grapher/GraphWidget.cxx (on_motion_notify_event): Set up hover text box.
(establishHoverTimeout, onHoverTimeout, getGraphUnderPoint): new functions.
Diffstat (limited to 'grapher/CairoWidget.hxx')
-rw-r--r-- | grapher/CairoWidget.hxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/grapher/CairoWidget.hxx b/grapher/CairoWidget.hxx index 077a4c7a..8cfb816a 100644 --- a/grapher/CairoWidget.hxx +++ b/grapher/CairoWidget.hxx @@ -8,7 +8,7 @@ namespace systemtap { public: CairoWidget(bool visible = false) - : _visible(visible), _size(50.0), _radius(5) + : _visible(visible) {} bool isVisible() const { return _visible; } void setVisible(bool visible) { _visible = visible; } @@ -28,15 +28,27 @@ namespace systemtap bool _visible; double _x0; double _y0; - double _size; - double _radius; }; class CairoPlayButton : public CairoWidget { public: + CairoPlayButton(bool visible = false) + : CairoWidget(visible), _size(50.0), _radius(5) + { + } virtual void draw(Cairo::RefPtr<Cairo::Context> cr); virtual bool containsPoint(double x, double y); + protected: + double _size; + double _radius; + }; + + class CairoTextBox : public CairoWidget + { + public: + void draw(Cairo::RefPtr<Cairo::Context> cr); + std::string contents; }; } #endif |