예제 #1
0
 private void button7_Click(object sender, EventArgs e)
 {
     labelPanel.Text = "TRIPLETA";
     C1.Enabled      = true;
     C2.Enabled      = true;
     C3.Enabled      = true;
     labelc1.Enabled = true;
     labelc2.Enabled = true;
     labelc3.Enabled = true;
     C1.Focus();
 }
예제 #2
0
 private void button6_Click(object sender, EventArgs e)
 {
     labelPanel.Text = "PALE";
     C1.Enabled      = true;
     C2.Enabled      = true;
     C3.Enabled      = false;
     labelc1.Enabled = true;
     labelc2.Enabled = true;
     labelc3.Enabled = false;
     C1.Focus();
 }
예제 #3
0
        /// <summary>
        /// Applies the comment to the entry.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetComment_Click(object sender, EventArgs e)
        {
            if (StyleListView.SelectedItems.Count != 0)
            {
                ListViewItem LastItem      = StyleListView.SelectedItems[StyleListView.SelectedItems.Count - 1];
                int          LastItemIndex = LastItem.Index;

                string commenttext = !C1.Text.Contains("#") ? ("# " + Fregular.CurrentStyle.Styles.Where(c => c.identifier == LastItem.Group.Name.ToString()).First().commentIdentifierDescription + " " + C1.Text) : C1.Text;
                Fregular.CurrentStyle.Styles.Where(i => i.identifier == LastItem.Group.Name).First().GetLineByFullString(LastItem.SubItems[0].Text).Comment = commenttext;
                StyleListView.Items[LastItemIndex].SubItems[1].Text = commenttext;
                C1.Focus();
                C1.SelectAll();
            }
        }
예제 #4
0
        /// <summary>
        /// Manages the up/down/enter keypressevents in the StyleSheet area for smoother navigation and editing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void C1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (StyleListView.SelectedItems.Count >= 1)
            {
                int index = StyleListView.SelectedItems[0].Index;

                if (index < StyleListView.Items.Count - 1)
                {
                    if (e.KeyCode == Keys.Down)
                    {
                        StyleListView.Items[index + 1].Selected = true;
                        UpdateStylePreview(StyleListView.Items[index + 1]);
                    }
                }

                if (index > 0)
                {
                    if (e.KeyCode == Keys.Up)
                    {
                        StyleListView.Items[index - 1].Selected = true;
                        UpdateStylePreview(StyleListView.Items[index - 1]);
                    }
                }

                if (e.KeyCode == Keys.Enter)
                {
                    this.SetComment_Click(null, null);
                }

                C1.Focus();


                if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
                {
                    C1.SelectAll();
                }
            }
        }