Exemplo n.º 1
0
        private void menuStopRecordingMacro_Click(object sender, EventArgs e)
        {
            Macro m = m_renderer.TwistHandler.m_workingMacro;

            if (!m.Recording)
            {
                return;
            }

            m.StopRecording();
            UpdateStatus2();

            if (m.Twists.Length == 0)
            {
                InformationMessage("Invalid Macro", "There were no twists recorded for the macro.");
                return;
            }

            Macro clone = m.Clone();

            // Prompt for name.
            EnterStringDlg dlg = new EnterStringDlg();

            if (DialogResult.OK == dlg.ShowDialog(this))
            {
                clone.DisplayName = dlg.StringText;
                clone.ClearStartEndMarkings();
                m_puzzle.MacroList.Macros.Add(clone);
                RefreshMacroUI(m_puzzle.MacroList.Macros.Count - 1);
            }
        }
Exemplo n.º 2
0
        private void m_btnRename_Click(object sender, EventArgs e)
        {
            Macro m = SelectedMacro();

            if (m == null)
            {
                return;
            }

            EnterStringDlg dlg = new EnterStringDlg();

            dlg.StringText = m.DisplayName;
            if (DialogResult.OK == dlg.ShowDialog(this))
            {
                m.DisplayName = dlg.StringText;
                RefreshMacroUI();
            }
        }