private static void MouseUp(object sender, MouseEventArgs e) { bool doneAlready = false; foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p) && !doneAlready && p.MouseUpHandler != null) { p.MouseUpHandler(p, e); doneAlready = true; } if (p.dragging) { p.dragging = false; Panel h = GetHighlightedPanel(); if (h) { p.SetParent(h); p.z = nextz; nextz++; ResortPanelsByZ(); RefreshProperties(); h.highlighted = false; } } } }
private static void MouseWheel(object sender, MouseEventArgs e) { foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p) && p.MouseWheelHandler != null) { p.MouseWheelHandler(p, e); break; } } }
private static void MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e) { foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p) && p.MouseDoubleClickHandler != null) { p.MouseDoubleClickHandler(p, e); break; } } }
private static void MouseClick(object sender, MouseEventArgs e) { foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p) && p.MouseClickHandler != null && !p.hidden) { p.MouseClickHandler(p, e); break; } } }
// to set the selected panel static void SelectedItem_MouseHandler(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p)) { SetSelected(p); Repaint(); break; } } }
private static void MouseMove(object sender, MouseEventArgs e) { bool alreadyCalled = false; foreach (Panel p in panels) { if (Derma.MouseIsOverPanel(p)) { if (!alreadyCalled && p.MouseMoveHandler != null) { p.MouseMoveHandler(p, e); alreadyCalled = true; } } else { p.highlighted = false; } } }
private static void MouseDown(object sender, MouseEventArgs e) { foreach (Panel p in panels) { if (ResizeGrip.Resize_MouseDown(sender, e)) { break; } SelectedItem_MouseHandler(sender, e); if (!p.locked && p == GetSelected() && e.Button == MouseButtons.Left && MouseIsOverPanel(p)) { p.dragOffsetX = e.X - p.x; p.dragOffsetY = e.Y - p.y; p.dragging = true; } if (Derma.MouseIsOverPanel(p) && p.MouseDownHandler != null) { p.MouseDownHandler(p, e); break; } } }