private void DoLayout() { int layoutWidth = LayoutWidth; if (Root == null || layoutWidth <= 0 || m_lastLayoutWidth == layoutWidth) { return; } using (var gm = new GraphicsManager(this, null)) { Root.Layout(LayoutArg(gm)); } m_lastLayoutWidth = layoutWidth; //SetScrollRange(Root.Width, Root.Height); Invalidate(); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); Focus(); if (Root == null || m_lastLayoutWidth == 0) { return; } using (var gm = new GraphicsManager(this)) { var sel = m_root.Selection; m_root.OnMouseMove(e, ModifierKeys, gm.VwGraphics, PaintArg(gm.VwGraphics)); if (sel != m_root.Selection) { Update(); // need to show the updated selection before we process more movements to get continuous drag effect. } } }
LayoutInfo LayoutArg(GraphicsManager gm) { var dpiX = (int) Math.Round(gm.DpiX); var dpiY = (int) Math.Round(gm.DpiY); return new LayoutInfo(Indent, TopMargin, dpiX, dpiY, ClientSize.Width - Indent*2, gm.VwGraphics, RendererFactory); }
protected override void OnDragDrop(DragEventArgs drgevent) { // I don't think we need to support the DragDrop event, apart from our own implementation of it. //base.OnDragDrop(drgevent); using (var gm = new GraphicsManager(this)) { var location = PointToClient(new Point(drgevent.X, drgevent.Y)); Root.OnDragDrop(drgevent, location, gm.VwGraphics, PaintArg(gm.VwGraphics)); } }
protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); Focus(); if (Root == null || m_lastLayoutWidth == 0) return; using (var gm = new GraphicsManager(this)) { Root.OnMouseClick(e, ModifierKeys, gm.VwGraphics, PaintArg(gm.VwGraphics)); } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); Focus(); if (Root == null || m_lastLayoutWidth == 0) return; using (var gm = new GraphicsManager(this)) { var sel = m_root.Selection; m_root.OnMouseMove(e, ModifierKeys, gm.VwGraphics, PaintArg(gm.VwGraphics)); if (sel != m_root.Selection) Update(); // need to show the updated selection before we process more movements to get continuous drag effect. } }
private void DoLayout() { int layoutWidth = LayoutWidth; if (Root == null || layoutWidth <= 0 || m_lastLayoutWidth == layoutWidth) return; using (var gm = new GraphicsManager(this, null)) { Root.Layout(LayoutArg(gm)); } m_lastLayoutWidth = layoutWidth; //SetScrollRange(Root.Width, Root.Height); Invalidate(); }
private void ScrollToShowSelection() { if (m_root == null) return; using (var gm = new GraphicsManager(this)) { int dx, dy; Root.ScrollToShowSelection(gm.VwGraphics, PaintArg(gm.VwGraphics), ClientRectangle, out dx, out dy); ScrollBy(dx, dy); } }
protected override void OnPaint(PaintEventArgs e) { if (Root == null || m_lastLayoutWidth == 0) return; using (var gm = new GraphicsManager(this, e.Graphics)) { Root.Paint(gm.VwGraphics, PaintArg(gm.VwGraphics)); } }