comparison libgui/graphics/Canvas.cc @ 20629:46edfbd31ad7

Fix execution of "windowbuttonmotionfcn" with uipanels (bug #46151) * Canvas.cc (Canvas::canvasMouseMoveEvent): decide here to update the currentpoint and run "windowbuttonmotionfcn" if the latter is not empty * Canvas.h: remove unused "enableCurrentPointUpdates" method and "m_updateCurrentPoint" attribute * Figure.h: declare a new private method "enableMouseTracking" * Figure.cc (Figure::Figure): use "enableMouseTracking" instead of "update" on "windowbuttonmotionfcn". * Figure.cc (Figure::update): mouse tracking is now enabled unconditionally so remove unused case "windowbuttonmotionfcn". *Figure.cc(Figure::eventNotifyAfter): enable mouse tracking on new children widgets.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sat, 10 Oct 2015 12:21:37 +0200
parents dcfbf4c1c3c8
children 69270256b879
comparison
equal deleted inserted replaced
20628:3af34e1ef330 20629:46edfbd31ad7
505 505
506 default: 506 default:
507 break; 507 break;
508 } 508 }
509 } 509 }
510 else if (m_mouseMode == NoMode && m_updateCurrentPoint) 510 else if (m_mouseMode == NoMode)
511 { 511 {
512 graphics_object obj = gh_manager::get_object (m_handle); 512 graphics_object obj = gh_manager::get_object (m_handle);
513 513
514 if (obj.valid_object ()) 514 if (obj.valid_object ())
515 { 515 {
516 graphics_object figObj (obj.get_ancestor ("figure")); 516 graphics_object figObj (obj.get_ancestor ("figure"));
517 517
518 updateCurrentPoint (figObj, obj, event); 518 if (figObj.valid_object () &&
519 gh_manager::post_callback (figObj.get_handle (), 519 ! figObj.get ("windowbuttonmotionfcn").is_empty ())
520 "windowbuttonmotionfcn"); 520 {
521 updateCurrentPoint (figObj, obj, event);
522 gh_manager::post_callback (figObj.get_handle (),
523 "windowbuttonmotionfcn");
524 }
521 } 525 }
522 } 526 }
523 527
524 // Update mouse coordinates in the figure window status bar 528 // Update mouse coordinates in the figure window status bar
525 graphics_object figObj = 529 graphics_object figObj =