comparison libgui/graphics/Canvas.cc @ 20141:8eb72c4ed457

Add uicontextmenu to annotation objects * Canvas.cc (Canvas::canvasMousePressEvent): Allow searching in axes that have hidden handles so that annotations objects can be picked by mouse events. * Canvas.cc (Canvas::canvasMousePressEvent): later disallow manipulating hidden axes in pan/zoomin/zoomout/rotate modes * annotation.m: add context menu to manipulate annotation properties * annotation.m: fix wrong position of textbox when position has negative width/height
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 20 Apr 2015 09:26:13 +0200
parents c164cfc24bdd
children f1f6d5eab46f
comparison
equal deleted inserted replaced
20140:ddc5c7663329 20141:8eb72c4ed457
470 { 470 {
471 graphics_object figObj (obj.get_ancestor ("figure")); 471 graphics_object figObj (obj.get_ancestor ("figure"));
472 graphics_object currentObj, axesObj; 472 graphics_object currentObj, axesObj;
473 QList<graphics_object> axesList; 473 QList<graphics_object> axesList;
474 474
475 Matrix children = obj.get_properties ().get_children (); 475 Matrix children = obj.get_properties ().get_all_children ();
476 octave_idx_type num_children = children.numel (); 476 octave_idx_type num_children = children.numel ();
477 477
478 for (int i = 0; i < num_children; i++) 478 for (int i = 0; i < num_children; i++)
479 { 479 {
480 graphics_object childObj (gh_manager::get_object (children(i))); 480 graphics_object childObj (gh_manager::get_object (children(i)));
516 516
517 if (r.contains (event->posF ())) 517 if (r.contains (event->posF ()))
518 axesObj = *it; 518 axesObj = *it;
519 } 519 }
520 520
521 if (axesObj) 521 if (axesObj && currentObj)
522 break; 522 break;
523 } 523 }
524 524
525 if (axesObj) 525 if (axesObj)
526 { 526 {
602 602
603 case PanMode: 603 case PanMode:
604 case RotateMode: 604 case RotateMode:
605 case ZoomInMode: 605 case ZoomInMode:
606 case ZoomOutMode: 606 case ZoomOutMode:
607 if (axesObj) 607 if (axesObj && axesObj.get_properties ().handlevisibility_is ("on"))
608 { 608 {
609 bool redraw_figure = true; 609 bool redraw_figure = true;
610 610
611 if (isdblclick) 611 if (isdblclick)
612 { 612 {