Exemplo n.º 1
0
 private void ValueCombinationDirectionLabel_Click(object sender, EventArgs e)
 {
     if (m_value_combination_direction == Direction.RightToLeft)
     {
         m_value_combination_direction       = Direction.LeftToRight;
         ValueCombinationDirectionLabel.Text = "→";
         ToolTip.SetToolTip(ValueCombinationDirectionLabel, "combine letter values left to right");
     }
     else
     {
         m_value_combination_direction       = Direction.RightToLeft;
         ValueCombinationDirectionLabel.Text = "←";
         ToolTip.SetToolTip(ValueCombinationDirectionLabel, "combine letter values right to left");
     }
     ValueCombinationDirectionLabel.Refresh();
 }
Exemplo n.º 2
0
    private void AutoGenerateWordsButton_Click(object sender, EventArgs e)
    {
        TextModeComboBox.Enabled               = false;
        NumerologySystemComboBox.Enabled       = false;
        AddVerseAndWordValuesCheckBox.Enabled  = false;
        AddPositionsCheckBox.Enabled           = false;
        AddDistancesToPreviousCheckBox.Enabled = false;
        ValueCombinationDirectionLabel.Enabled = false;
        NumberTypeLabel.Enabled         = false;
        AutoGenerateWordsButton.Enabled = false;
        GenerateWordsButton.Enabled     = false;
        InspectButton.Enabled           = false;
        TextModeComboBox.Refresh();
        NumerologySystemComboBox.Refresh();
        AddVerseAndWordValuesCheckBox.Refresh();
        AddPositionsCheckBox.Refresh();
        AddDistancesToPreviousCheckBox.Refresh();
        ValueCombinationDirectionLabel.Refresh();
        NumberTypeLabel.Refresh();
        AutoGenerateWordsButton.Refresh();
        GenerateWordsButton.Refresh();
        InspectButton.Refresh();

        this.Cursor = Cursors.WaitCursor;
        try
        {
            // at the start of running
            ProgressBar.Value = 0;
            ProgressBar.Refresh();
            WordCountLabel.Text      = "0 Lines";
            WordCountLabel.ForeColor = Numbers.GetNumberTypeColor(0L);
            WordCountLabel.Refresh();

            if (m_generated_lines == null)
            {
                m_generated_lines = new List <string>();
            }
            if (m_generated_lines != null)
            {
                m_generated_lines.Clear();
            }

            if (ModifierKeys == Keys.Shift)
            {
                int loops = 0;
                foreach (string text_mode in TextModeComboBox.Items)
                {
                    TextModeComboBox.SelectedItem = text_mode;
                    TextModeComboBox.Refresh();

                    loops += NumerologySystemComboBox.Items.Count;
                }

                int i = 0;
                foreach (string text_mode in TextModeComboBox.Items)
                {
                    TextModeComboBox.SelectedItem = text_mode;
                    TextModeComboBox.Refresh();

                    foreach (string numerology_system in NumerologySystemComboBox.Items)
                    {
                        NumerologySystemComboBox.SelectedItem = numerology_system;
                        NumerologySystemComboBox.Refresh();

                        ProcessNumerologySystem();

                        // display progress
                        i++;
                        ProgressBar.Value = ((i + 1) * 100) / loops;
                        if (m_generated_lines != null)
                        {
                            WordCountLabel.Text      = m_generated_lines.Count + " Line" + (m_generated_lines.Count == 1 ? "" : "s");
                            WordCountLabel.ForeColor = Numbers.GetNumberTypeColor(m_generated_lines.Count);
                            WordCountLabel.Refresh();
                        }
                        Application.DoEvents();
                    } // foreach NumerologySystem
                }     // foreach TextMode
            }
            else
            {
                ProcessNumerologySystem();
            }

            // at the end of running
            ProgressBar.Value = 100;
            ProgressBar.Refresh();
            if (m_generated_lines != null)
            {
                WordCountLabel.Text      = m_generated_lines.Count + " Line" + (m_generated_lines.Count == 1 ? "" : "s");
                WordCountLabel.ForeColor = Numbers.GetNumberTypeColor(m_generated_lines.Count);
                WordCountLabel.Refresh();
            }
        }
        finally
        {
            TextModeComboBox.Enabled               = true;
            NumerologySystemComboBox.Enabled       = true;
            AddVerseAndWordValuesCheckBox.Enabled  = true;
            AddPositionsCheckBox.Enabled           = true;
            AddDistancesToPreviousCheckBox.Enabled = true;
            ValueCombinationDirectionLabel.Enabled = true;
            NumberTypeLabel.Enabled         = true;
            AutoGenerateWordsButton.Enabled = true;
            GenerateWordsButton.Enabled     = true;
            InspectButton.Enabled           = true;

            this.Cursor = Cursors.Default;
        }
    }