Esempio n. 1
0
        private void noTerminalCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            // If we previously had a terminal line, erase the terminal
            // position and unhighlight the arc.

            ISpatialDisplay draw = m_Cmd.ActiveDisplay;

            if (m_Line != null)
            {
                m_Cmd.ErasePainting();
            }

            m_Line = null;
            ParallelLineUI cmd = Command;

            // Draw the parallel point instead.
            if (m_IsLast)
            {
                m_Terminal = cmd.ParallelTwo;
            }
            else
            {
                m_Terminal = cmd.ParallelOne;
            }

            EditingController.Current.Style(Color.Yellow).Render(draw, m_Terminal);
        }
Esempio n. 2
0
        private void otherWayButton_Click(object sender, EventArgs e)
        {
            m_IsLeft = !m_IsLeft;

            // Shouldn't be here if an offset point has been specified.
            if (m_Point != null)
            {
                MessageBox.Show("Can't go the other way because the parallel passes through a point.");
                otherWayButton.Enabled = false;
                return;
            }

            // The offset distance SHOULD be available, but just check.
            if (m_Offset == null)
            {
                MessageBox.Show("Need an offset to do that.");
                otherWayButton.Enabled = false;
                return;
            }

            // Erase what we have.
            m_Cmd.ErasePainting();

            // Reverse the sign of the offset distance.
            if (m_Offset.Meters < 0.0)
            {
                m_Offset.SetPositive();
            }
            else
            {
                m_Offset.SetNegative();
            }

            // Re-calculate the parallel and draw it.
            if (Calculate())
            {
                Draw();
            }

            // Resume in the "Next" field.
            nextButton.Focus();
        }
Esempio n. 3
0
        private void distanceTextBox_TextChanged(object sender, EventArgs e)
        {
            // Parse the distance to the split point.
            string d = distanceTextBox.Text.Trim();

            if (d.Length == 0)
            {
                m_Length = new Distance();
            }
            else
            {
                m_Length = new Distance(d);
            }

            // If the observed length is greater than the max, reveal warning.
            warningLabel.Visible = (m_Length.Meters > m_MaxLength);

            // Clear current highlightling (Draw will be called in idle time)
            m_Cmd.ErasePainting();
        }
Esempio n. 4
0
 private void lengthTextBox_TextChanged(object sender, EventArgs e)
 {
     m_Length = new Distance(lengthTextBox.Text);
     m_Cmd.ErasePainting();
 }