예제 #1
0
        private void offsetButton_Click(object sender, EventArgs e)
        {
            // Disallow an attempt to create more than one offset dialog (the
            // button SHOULD have been disabled when we first created it).
            if (m_DialOff!=null)
            {
                MessageBox.Show("The offset dialog is still open.");
                return;
            }

            // Disable the button. It will be re-enabled when the user
            // exits the dialog (see DialFinish && DialAbort).
            offsetButton.Enabled = false;

            // Also the OK button (you will need to initially close the offset sub-dialog).
            okButton.Enabled = false;

            // Create a modeless dialog and display it.
            m_DialOff = new GetOffsetForm(m_Cmd, m_Offset);
            m_DialOff.Show(this);
        }
예제 #2
0
        /// <summary>
        /// Aborts a sub-dialog (i.e. the offset dialog).
        /// </summary>
        /// <param name="wnd">The dialog window.</param>
        internal void DialAbort(Control wnd)
        {
            if (m_DialOff==wnd)
            {
                m_DialOff.Hide();
                m_DialOff.Dispose();
                m_DialOff = null;

                // Re-enable the offset and OK buttons.
                offsetButton.Enabled = true;
                okButton.Enabled = true;

                // Put this dialog in the foreground.
                //this->SetForegroundWindow();
            }
            else
            {
                MessageBox.Show("RadialControl.DialAbort - Unexpected dialog.");
            }
        }
예제 #3
0
        /// <summary>
        /// Finishes a sub-dialog (i.e. the offset dialog).
        /// </summary>
        /// <param name="wnd">The dialog window.</param>
        /// <returns></returns>
        internal bool DialFinish(Control wnd)
        {
            if (m_DialOff==null)
            {
                MessageBox.Show("RadialControl.DialFinish - No sub-dialog!");
                return false;
            }

            // The new offset is already known via calls that the
            // sub-dialog made to SetOffset.

            // Destroy the sub-dialog.
            m_DialOff.Dispose();
            m_DialOff = null;

            // Re-enable the offset and OK buttons.
            offsetButton.Enabled = true;
            okButton.Enabled = true;

            // Resume in the point type field.
            entityTypeComboBox.Focus();

            return true;
        }
예제 #4
0
 private void Zero()
 {
     m_Cmd = null;
     m_Recall = null;
     m_From = null;
     m_Backsight = null;
     m_Par1 = null;
     m_Par2 = null;
     m_Radians = 0.0;
     m_IsClockwise = true;
     m_IsDeflection = false;
     m_Length = new Distance();
     m_LengthOffset = null;
     m_DialOff = null;
     m_Offset = null;
     m_Dir = null;
     m_To = null;
     m_Circles = new List<Circle>();
     m_Focus = null;
     m_WantLine = false;
     m_WantCentre = false;
     m_IsStatic = false;
     m_PointId = null;
 }