private void OnMouseDoubleClick(object sender, ILMouseEventArgs args) { MouseDoubleClickShowEditor(this, args); }
protected void MouseDoubleClickShowEditor(object sender, ILMouseEventArgs args) { editor.MouseDoubleClickShowEditor(sender, args); }
private void OnMouseClick(object sender, ILMouseEventArgs e) { if (e.Button != MouseButtons.Right || e.Cancel) return; var contextMenu = new ContextMenu(); // Reset view contextMenu.MenuItems.Add("Reset View", (o, args) => { Panel.SceneSyncRoot.First<ILPlotCube>().Reset(); Panel.Refresh(); }); // Switch planes if (!TwoDMode) { contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add("X-Y Plane", (o, args) => { Panel.SceneSyncRoot.First<ILPlotCube>().Rotation = Matrix4.Identity; Panel.Refresh(); }); contextMenu.MenuItems.Add("X-Z Plane", (o, args) => { Panel.SceneSyncRoot.First<ILPlotCube>().Rotation = Matrix4.Rotation(Vector3.UnitX, Math.PI / 2.0); Panel.Refresh(); }); contextMenu.MenuItems.Add("Y-Z Plane", (o, args) => { Panel.SceneSyncRoot.First<ILPlotCube>().Rotation = Matrix4.Rotation(Vector3.UnitY, Math.PI / 2.0); Panel.Refresh(); }); } // Plot browser contextMenu.MenuItems.Add("-"); contextMenu.MenuItems.Add("Plot Browser", (o, args) => Editor.PanelEditor.PlotBrowser.Show()); contextMenu.Show(Panel, e.Location); e.Cancel = true; }
private void OnMouseDoubleClick(object sender, ILMouseEventArgs args) { if (!args.DirectionUp) return; MouseDoubleClickShowEditor(this, args); }
internal void MouseDoubleClickShowEditor(object sender, ILMouseEventArgs args) { // 1) In a 'standard' scene, the MouseDoubleClick handler of the original item is invoked -> use sender // 2) In a ILPlotCube scene, the MouseDoubleClick handler of ILPlotCube is invoke (with original item in the ILMouseEventArgs.Target) -> lookup args.Target object item = (FindWrapperById(args.Target.ID) ?? sender) as ILWrapperBase; if (item == null) return; ShowEditor(((ILWrapperBase) item).Path); args.Cancel = true; }