Ejemplo n.º 1
0
        private void listBoxControls_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Loads all the control info into the control viewer
            if (listBoxControls.SelectedItem.ToString() == "")
            {
                return;
            }
            string controlOptions;

            //AutoNoteControls.RefreshControlEdit(listBoxControls.SelectedIndex.ToString());
            AutoNoteControls.Refresh();
            ControlCur = AutoNoteControls.Listt[listBoxControls.SelectedIndex];
            textBoxTypeControl.Text        = ControlCur.ControlType;
            textBoxDescriptControl.Text    = ControlCur.Descript;
            textBoxLabelControl.Text       = ControlCur.ControlLabel;
            textBoxTextControl.Text        = ControlCur.MultiLineText;
            textBoxTextPrefaceControl.Text = ControlCur.PrefaceText;
            listBoxOptionsControl.Items.Clear();
            controlOptions = ControlCur.ControlOptions;
            string[] lines = controlOptions.Split(new char[] { ',' });
            for (int i = 0; i < lines.Length; i++)
            {
                listBoxOptionsControl.Items.Add(lines[i].ToString());
            }
            ControlContentViewerVisible(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Refreshes the listBoxControls
 /// </summary>
 private void fillListBoxControls()
 {
     listBoxControls.Items.Clear();
     AutoNoteControls.Refresh();
     for (int i = 0; i < AutoNoteControls.Listt.Count; i++)
     {
         listBoxControls.Items.Add(AutoNoteControls.Listt[i].Descript);
     }
     if (!IsNew)
     {
         listBoxControlsToIncl.Items.Clear();
         listBoxControlToIncNum.Items.Clear();
         string   controls = AutoNoteCur.ControlsToInc;
         string[] lines    = controls.Split(new char[] { ',' });
         for (int i = 0; i < lines.Length; i++)
         {
             if (lines[i].ToString() != "")
             {
                 listBoxControlToIncNum.Items.Add(lines[i].ToString());
                 ControlsList = AutoNoteControls.ControlNumToName(lines[i].ToString());
                 listBoxControlsToIncl.Items.Add(AutoNoteControls.Listt[0].Descript);
             }
         }
     }
 }
Ejemplo n.º 3
0
        private void butCreateControl_Click(object sender, EventArgs e)
        {
            FormAutoNoteControlEdit form = new FormAutoNoteControlEdit();

            form.IsNew      = true;
            form.ControlCur = new AutoNoteControl();
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                ControlContentViewerVisible(false);
                AutoNoteControls.Refresh();
                listBoxControls.Items.Clear();
                for (int i = 0; i < AutoNoteControls.Listt.Count; i++)
                {
                    listBoxControls.Items.Add(AutoNoteControls.Listt[i].Descript);
                }
            }
        }
Ejemplo n.º 4
0
        private void butEditControl_Click(object sender, EventArgs e)
        {
            //should launch FormAutoNoteControlEdit
            //I did not have time to look closely at this:

            /*
             * ControlsToInc=new string[listBoxControlsToIncl.Items.Count];
             * for (int i=0; i<listBoxControlsToIncl.Items.Count; i++) {
             *      if (listBoxControlsToIncl.Items[i].ToString()!="") {
             *              ControlsList=AutoNoteControls.ControlNameToNum(listBoxControlsToIncl.Items[i].ToString());
             *              ControlsToInc[i]=ControlsList[0].AutoNoteControlNum.ToString();
             *      }
             * }
             * RefreshControlsToIncEdit=true;*/
            if (listBoxControls.SelectedIndex == -1)
            {
                return;
            }
            FormAutoNoteControlEdit form = new FormAutoNoteControlEdit();

            form.IsNew      = false;
            form.ControlCur = AutoNoteControls.Listt[listBoxControls.SelectedIndex];
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                ControlContentViewerVisible(false);
                AutoNoteControls.Refresh();
                listBoxControls.Items.Clear();
                for (int i = 0; i < AutoNoteControls.Listt.Count; i++)
                {
                    listBoxControls.Items.Add(AutoNoteControls.Listt[i].Descript);
                }
                listBoxControlsToIncl.Items.Clear();
                for (int i = 0; i < listBoxControlToIncNum.Items.Count; i++)
                {
                    ControlsList = AutoNoteControls.ControlNumToName(listBoxControlToIncNum.Items[i].ToString());
                    listBoxControlsToIncl.Items.Add(ControlsList[0].Descript);
                }
            }
        }