Esempio n. 1
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F2)
     {
         // change comment text
         CommentMapping cm = lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedItem as CommentMapping;
         if (cm != null)
         {
             CommentForm cf = new CommentForm();
             cf.SetComment(cm);
             cf.ShowDialog();
         }
         lbMappingsDict[mappingsTabs.SelectedTab.Text].Items[lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex] = cm;
     }
     else if (e.KeyCode == Keys.F3)
     {
         // create new comment
         if (lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex >= 0)
         {
             CreateNewMapping(true, lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex);
         }
         else
         {
             CreateNewMapping(true, lbMappingsDict[mappingsTabs.SelectedTab.Text].Items.Count - 2);
         }
     }
     else if (e.KeyCode == Keys.F4)
     {
         // create new mapping
         if (lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex >= 0)
         {
             CreateNewMapping(false, lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex);
         }
         else
         {
             CreateNewMapping(false, lbMappingsDict[mappingsTabs.SelectedTab.Text].Items.Count - 2);
         }
     }
     else if ((e.KeyCode == Keys.F5) || (e.KeyCode == Keys.Delete))
     {
         if (lbMappingsDict[mappingsTabs.SelectedTab.Text].Items.Count >= 0)
         {
             Program.mappings.mappings[mappingsTabs.SelectedTab.Text].Remove(lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedItem as Mapping);
             lbMappingsDict[mappingsTabs.SelectedTab.Text].Items.Remove(lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedItem);
         }
     }
     else if (e.Control)
     {
         if (e.KeyCode == Keys.Oemplus)
         {
             tbMoveUp_Click(sender, e);
         }
         else if (e.KeyCode == Keys.OemMinus)
         {
             tbMoveDown_Click(sender, e);
         }
     }
 }
Esempio n. 2
0
        private void editCommentText()
        {
            CommentMapping cm = lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedItem as CommentMapping;

            if (cm != null)
            {
                CommentForm cf = new CommentForm();
                cf.SetComment(cm);
                cf.ShowDialog();
            }
            lbMappingsDict[mappingsTabs.SelectedTab.Text].Items[lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedIndex] = cm;
        }
Esempio n. 3
0
        private void CreateNewMapping(bool comment, int location)
        {
            Mapping m = null;

            if (comment)
            {
                CommentMapping cm = new CommentMapping();
                CommentForm    cf = new CommentForm();
                cf.SetComment(cm);
                cf.ShowDialog();
                m = cm;
            }
            else // province map
            {
                m = new ProvinceMapping();
            }
            Program.mappings.mappings[mappingsTabs.SelectedTab.Text].Insert(location, m);
            lbMappingsDict[mappingsTabs.SelectedTab.Text].Items.Insert(location, m);
            lbMappingsDict[mappingsTabs.SelectedTab.Text].SelectedItem = m;
        }
 private void CommentForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     editingComment = null;
 }
 internal void SetComment(CommentMapping cmt)
 {
     editingComment = cmt;
     textBox1.Text = editingComment.commentLine;
 }
Esempio n. 6
0
 private void CreateNewMapping(bool comment, int location)
 {
     Mapping m = null;
     if (comment)
     {
         CommentMapping cm = new CommentMapping();
         CommentForm cf = new CommentForm();
         cf.SetComment(cm);
         cf.ShowDialog();
         m = cm;
     }
     else // province map
     {
         m = new ProvinceMapping();
     }
     Program.mappings.mappings.Insert(location, m);
     lbMappings.Items.Insert(location, m);
     lbMappings.SelectedItem = m;
 }
Esempio n. 7
0
 private void CommentForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     editingComment = null;
 }
Esempio n. 8
0
 internal void SetComment(CommentMapping cmt)
 {
     editingComment = cmt;
     textBox1.Text  = editingComment.commentLine;
 }
Esempio n. 9
0
 internal void SetComment(CommentMapping comment)
 {
     editingComment   = comment;
     commentText.Text = editingComment.commentLine;
 }