From d293d53136fa7e6e7eda510847145edf4d3d7f55 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 12:26:59 +0100 Subject: 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. --- grapher/GraphWidget.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'grapher/GraphWidget.hxx') diff --git a/grapher/GraphWidget.hxx b/grapher/GraphWidget.hxx index 876b6e09..61d50e70 100644 --- a/grapher/GraphWidget.hxx +++ b/grapher/GraphWidget.hxx @@ -65,8 +65,15 @@ namespace systemtap void onDataAdd(); void onDataRemove(); void onDataDialogOpen(); + bool onHoverTimeout(); DataModelColumns _dataColumns; Glib::RefPtr _listStore; + sigc::connection _hover_timeout_connection; + std::tr1::shared_ptr _hoverText; + double _mouseX; + double _mouseY; + std::tr1::shared_ptr getGraphUnderPoint(double x, double y); + void establishHoverTimeout(); }; } #endif // SYSTEMTAP_GRAPHWIDGET_H -- cgit