/// <summary> /// Do any command-specific drawing. /// </summary> /// <param name="point">The specific point (if any) that the parent window has drawn. /// Not used.</param> internal override void Paint(PointFeature point) { if (m_LastPosition != null) { // Draw gray text in the original position ISpatialDisplay display = ActiveDisplay; m_Text.Draw(display, Color.Gray); // Draw the text at the last mouse position IPointGeometry p = m_Text.Position; try { m_Text.TextGeometry.Position = m_LastPosition; m_Text.Draw(display, Color.Red); } finally { m_Text.TextGeometry.Position = p; } } }
/// <summary> /// Handles a mouse down event /// </summary> /// <param name="p">The position where the click occurred</param> /// <returns>True (always), indicating that something was done.</returns> internal override bool LButtonDown(IPosition p) { // Erase any text outline. EraseRect(); // Add a new label. TextFeature label = AddNewLabel(p); // Draw it. if (label != null) { label.Draw(ActiveDisplay, Color.Black); } // Tell the base class. OnLabelAdd(); // Get the info for the next piece of text. GetLabelInfo(); return(true); }
/// <summary> /// Do any command-specific drawing. /// </summary> /// <param name="point">The specific point (if any) that the parent window has drawn.</param> internal override void Paint(PointFeature point) { HighlightStyle style = new HighlightStyle(); if (m_Orient != null) { style.ShowLineEndPoints = false; m_Orient.Render(ActiveDisplay, style); } if (m_IsAutoPos && m_Polygon != null) { if (m_AutoPosition == null) { m_AutoPosition = m_Polygon.GetLabelPosition(Width, Height); } DrawText(m_AutoPosition); } else { base.Paint(point); } if (IsValidPolygon()) { m_Polygon.Render(ActiveDisplay, style); // If the polygon actually contains a label that is drawn on the current editing // layer, take this opportunity to draw it in gray. TextFeature label = m_Polygon.Label; if (label != null) { label.Draw(ActiveDisplay, Color.Gray); } } }