Menu

RE: Right Click

Help
DBirdMan
2011-09-09
2012-12-06
  • DBirdMan

    DBirdMan - 2011-09-09

    Hi All,

    Not much activity on this forum for a while but I figured I would ask.  When using the samples (Simple Graph Test for instance) when you right click a node, a menu pops up with several selections (Hide Node; Remove Node; Crop to Selection; Invert Selection; Properties). 

    Where are these options found ?  I'd like to add/subtract to them.  Plus there is the standard menu that I want to get rid of (Settings …; Global Settings etc…)

    Thanks !

     
  • Chris Callendar

    Chris Callendar - 2011-09-12

    Hi there,

    The context menus are initialized inside the FlexGraph.as class.
    See the createNodesLayerContextMenuItems(), createArcsLayerContextMenuItems(), createCanvasContextMenuItems() functions, they are protected so you can create your own class that extends FlexGraph.as (or ExtendedFlexGraph.as if you want the menubars and side panels) and override one of those functions.

    Or if you prefer you can access the context menus directly by nodesLayerContextMenu, arcsLayerContextMenu, or canvasLayerContextMenu and remove items individually or simply clear the list and add your own custom items.

    You can never get rid of the standard Flash Player menu items like Print, Settings, Global Settings.  They always have to be there even if you call contextMenu.hideBuiltInItems().

     

Log in to post a comment.