public void onMouseClick(MouseClickArgs args) { if (!(mouseClickEvent == null)) { mouseClickEvent.Invoke(this, args); } }
protected override void OnMouseEvent(MouseClickArgs arg){ if (null != m_text) m_text.Delete(); m_text = DrwText.Create( arg.point, string.Format("user mouse {0} click at bar {1} on data stream {2}", arg.buttons, arg.bar_number, arg.data_number)); }
protected override void OnMouseEvent(MouseClickArgs arg) { if (null != m_text) { m_text.Delete(); } m_text = DrwText.Create( arg.point, string.Format("user mouse {0} click at bar {1} on data stream {2}", arg.buttons, arg.bar_number, arg.data_number)); }
public static string MakeMouseClickCommand(ButtonTag tag, uint x, uint y) { var args = new MouseClickArgs() { Tag = tag, X = x, Y = y, }; var argsSerialize = JsonConvert.SerializeObject(args); return(PluginCommandSerializeMaker.MakeCommand(InnerPluginName, "MouseClick", argsSerialize)); }
private void MouseEvent_onMouseClick(object sender, MouseClickArgs e) { OpenFileDialog fileDlg = new OpenFileDialog(); fileDlg.DefaultExt = ".png"; fileDlg.Filter = "Images (.png)|*.png"; if (fileDlg.ShowDialog() == DialogResult.OK) { FilePath = fileDlg.FileName; Text = FileName; IsSuccess = true; } else { IsSuccess = false; } }
public string Shell(MouseClickArgs args) { MouseUtil.MouseClick(args.Tag, args.X, args.Y); return(null); }
public PluginMethodReturnValueType Shell(MouseClickArgs args) { MouseUtil.MouseClick(args.Tag, args.X, args.Y); return(PluginMethodReturnValueType.NoReturnValueType); }
public void PerformMouseClick(MouseClickArgs args) { MouseClick?.Invoke(this, args); }
private void OnNodeClick(TreeViewEx sender, MouseClickArgs args) { switch((NodeLevel)args.Node.Level) { case NodeLevel.PROJECT: { if(args.Button == MouseButtons.Right) { LightContextMenu contextMenu = new LightContextMenu(); ItemClickHandler addSceneHandler = delegate() { CheckValueCorrectnessDelegate checker = Solution.Instance.CreateSceneNameChecker(); string sceneName = NameGenerator.GenerateName("Scene", checker); Scene.Scene scene = m_Scenes.CreateScene(sceneName); this.SelectedScene = scene; }; contextMenu.AddItem("Add scene", addSceneHandler); contextMenu.Show(this, args.Location); } break; } case NodeLevel.SCENE: { Scene.Scene scene = (Scene.Scene)args.Node.Tag; this.SelectedScene = scene; if(args.Button == MouseButtons.Right) { LightContextMenu contextMenu = new LightContextMenu(); if(Settings.SceneTranslator != null) { ItemClickHandler codeToClipboardHandler = delegate() { try { string code = Settings.SceneTranslator.Translate(m_Scenes, scene); System.Windows.Forms.Clipboard.SetText(code); } catch(Exception e) { MessageBox.Show("Translation error: " + e.Message, "Translation error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }; contextMenu.AddItem("Copy code to clipboard", codeToClipboardHandler); } ItemClickHandler cloneSceneHandler = delegate() { CheckValueCorrectnessDelegate checker = Solution.Instance.CreateSceneNameChecker(); string cloneName = NameGenerator.GenerateName(scene.Name, checker); Scene.Scene clone = m_Scenes.CloneScene(scene, cloneName); this.SelectedScene = clone; }; ItemClickHandler removeSceneHandler = delegate() { m_Scenes.RemoveScene(scene); this.SelectedScene = null; }; contextMenu.AddItem("Clone scene", cloneSceneHandler); contextMenu.AddItem("Remove scene", removeSceneHandler); contextMenu.Show(this, args.Location); } break; } case NodeLevel.SHAPE: { Shape shape = (Shape)args.Node.Tag; if(shape != null && m_ShapeSelectedHandler != null) { m_ShapeSelectedHandler(this, shape); m_ShapeSelectedHandler = null; } else { this.SelectedShape = shape; if(args.Button == MouseButtons.Right) { LightContextMenu contextMenu = new LightContextMenu(); ItemClickHandler removeObjectHandler = delegate() { this.SelectedScene.RemoveShape(shape); this.SelectedShape = null; }; contextMenu.AddItem("Remove object", removeObjectHandler); contextMenu.Show(this, args.Location); } } break; } } }
private static void Button_MouseClick(object sender, MouseClickArgs args) { Console.WriteLine("Button_MouseClick"); }
private void OnNodeClick(TreeViewEx sender, MouseClickArgs args) { if(args.Node.Level == 0) { if(args.Button == MouseButtons.Right) { LightContextMenu contextMenu = new LightContextMenu(); contextMenu.AddItem("Edit templates...", this.OnEditTemplatesClick); contextMenu.Show(this, args.Location); this.ActiveTemplate = null; } } else if(args.Node.Level == 1) { if(args.Button == MouseButtons.Left) { this.ActiveTemplate = (ShapeTemplate)args.Node.Tag; } } }