comparison libgui/graphics/Container.cc @ 18612:9597e00ed2dd

Add support for "windowbuttonmotionfcn" and "currentpoint" * Figure.cc (Figure::Figure): Enable mouse tracking if windowbuttonmotionfcn callback is defined. (Figure::update): Enable mouse tracking on canvas and all child widgets when windowbuttonmotionfcn is defined. * Panel.cc (Panel::Panel): Propagate mouse tracking to child widgets during initialization. * Container.h (Container::childEvent): New method. * Container.cc (Container::childEvent): Likewise. Propagate mouse tracking status to child widgets. * BaseControl.cc (BaseControl::eventFilter): Handle mouse move events and call figure's appropriate callback. * Canvas.h (Canvas::updateCurrentPoint): New method. * Canvas.cc (Canvas::updateCurrentPoint): Likewise. Update figure and child axes currentpoint property. (Canvas::canvasMouseMoveEvent): Update currentpoint properties and call windowbuttonmotionfcn callback. (Canvas::canvasMousePressEvent): Call updateCurrentPoint. (Canvas::canvasMouseReleaseEvent): Likewise.
author Michael Goffioul <michael.goffioul@gmail.com>
date Tue, 01 Apr 2014 20:57:08 -0400
parents fb96b7f55242
children fe0e34be5576
comparison
equal deleted inserted replaced
18606:0ede4dbb37f1 18612:9597e00ed2dd
22 22
23 #ifdef HAVE_CONFIG_H 23 #ifdef HAVE_CONFIG_H
24 #include <config.h> 24 #include <config.h>
25 #endif 25 #endif
26 26
27 #include <QChildEvent>
27 #include <QVBoxLayout> 28 #include <QVBoxLayout>
28 29
29 #include "graphics.h" 30 #include "graphics.h"
30 31
31 #include "Canvas.h" 32 #include "Canvas.h"
93 } 94 }
94 } 95 }
95 } 96 }
96 } 97 }
97 98
99 void Container::childEvent (QChildEvent* event)
100 {
101 if (event->child ()->isWidgetType ())
102 {
103 qobject_cast<QWidget*> (event->child ())->setMouseTracking (hasMouseTracking ());
104 }
105 }
106
98 }; // namespace QtHandles 107 }; // namespace QtHandles