/// <summary> /// /// </summary> /// <param name="e"></param> public override void OnMouseDown(NMouseEventArgs e) { // handle only the left mouse down single click on the check box if (e.Button == MouseButtons.Left || e.Clicks == 1) { NExpandCollapseCheck check = GetExpandCollapseCheck(); // check to see if the hit was on some of the check box children if (NSceneTree.IsAncestorOfNode(check, e.HitNode)) { Expand(!Expanded); // mark as processed and return (stops event bubbling) e.Processed = true; return; } } // bubble event to previous mouse event handler base.OnMouseDown(e); }
protected void NDrawingView1_AsyncMouseOut(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; if (args.ItemId == null) { return; } NElementAtomIdentifier id = new NElementAtomIdentifier(args.ItemId); NEllipsePath path = id.FindInDocument(NDrawingView1.Document) as NEllipsePath; if (path == null) { return; } NShape shape = NSceneTree.FirstAncestor(path, NFilters.TypeNShape) as NShape; shape.Style.FillStyle = new NColorFillStyle(Color.Linen); }
protected void NDrawingView1_AsyncCustomCommand(object sender, EventArgs e) { NCallbackCustomCommandArgs args = e as NCallbackCustomCommandArgs; NCallbackCommand command = args.Command; switch (command.Name) { case "changeColor": string idText = command.Arguments["id"] as string; if (idText == null) { break; } NElementAtomIdentifier id = new NElementAtomIdentifier(idText); NEllipsePath path = id.FindInDocument(NDrawingView1.Document) as NEllipsePath; if (path == null) { break; } NShape shape = NSceneTree.FirstAncestor(path, NFilters.TypeNShape) as NShape; Color c = Color.Red; if (command.Arguments["color"].ToString() == "blue") { c = Color.Blue; } NColorFillStyle fs = shape.Style.FillStyle as NColorFillStyle; shape.Style.FillStyle = new NColorFillStyle(c); clientSideRedrawRequired = (fs == null || fs.Color != c); break; case "rotate10Degrees": IterateRotatingEllipse(true); break; } }