Back to the main page.

Bug 1631 - ft_select_range: add context menu capabilities

Reported 2012-08-06 15:15:00 +0200
Modified 2013-01-17 10:39:09 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Roemer van der Meij
Depends on:
See also:

Roemer van der Meij - 2012-08-06 15:15:28 +0200

Roemer van der Meij - 2012-08-07 14:39:21 +0200

Functionality added, took a long time figuring it out. It now supports context menu on selections/points. When selecting a range, the context menu items are grayed out when no selection is made. When an item is activated (also document in function) the regular callback is used, but this time having an extra input arg, being the item name. The only way to do this was (at least, that I found) to distinguish between left clicks and right clicks, which are saved in a read-only property, SelectionType. One remaining issue is the uicontextmenu property of all objects in the current figure. They have to be set in order for the menu to appear, but in case of a redraw (like in the databrowser) the properties have to be reset. What I now did was reset the property every single call of the function for all objects that have 'hittest' set to on, i.e. all objects that are clickable. This turns out to be pretty fast, but if it used on a mesh.... Anywho, it only does so if the contextmenu option is being used of course, so it won't break any current functions. I added you Robert because you're the only one who worked on this function?

Roemer van der Meij - 2012-08-08 17:20:00 +0200

Change the 'graying-out' of menu-items to be such that they are gray when cursor is outside a selection, and clickable when cursor is within a selection. This can be easily done in the 'windowmotionevent' section, but IIRC there should be a disable set just after clicking, which is prior to motion? Change and check with some data.

Roemer van der Meij - 2012-08-16 18:05:25 +0200


Roemer van der Meij - 2013-01-17 10:39:09 +0100

bug closing time