private void FormChartProcedureEntryEdit_Load(object sender, System.EventArgs e)
 {
     AutoCodes.Refresh();
     ProcButtonItems.Refresh();
     if (IsNew)
     {
         this.Text = Lan.g(this, "Add Procedure Button");
     }
     else
     {
         this.Text = Lan.g(this, "Edit Procedure Button");
     }
     textDescript.Text = ProcButtonCur.Description;
     for (int i = 0; i < DefB.Short[(int)DefCat.ProcButtonCats].Length; i++)
     {
         comboCategory.Items.Add(DefB.Short[(int)DefCat.ProcButtonCats][i].ItemName);
         if (ProcButtonCur.Category == DefB.Short[(int)DefCat.ProcButtonCats][i].DefNum)
         {
             comboCategory.SelectedIndex = i;
         }
     }
     if (comboCategory.SelectedIndex == -1)
     {
         comboCategory.SelectedIndex = 0;              //we know that there will always be at least one cat. Validated in FormProcButtons
     }
     pictureBox.Image = ProcButtonCur.ButtonImage;
     int[] codeNumList = ProcButtonItems.GetCodeNumListForButton(ProcButtonCur.ProcButtonNum);
     int[] auto        = ProcButtonItems.GetAutoListForButton(ProcButtonCur.ProcButtonNum);
     listADA.Items.Clear();
     for (int i = 0; i < codeNumList.Length; i++)
     {
         listADA.Items.Add(ProcedureCodes.GetStringProcCode(codeNumList[i]));
     }
     listAutoCodes.Items.Clear();
     for (int i = 0; i < AutoCodes.ListShort.Length; i++)
     {
         listAutoCodes.Items.Add(AutoCodes.ListShort[i].Description);
         for (int j = 0; j < auto.Length; j++)
         {
             if (auto[j] == AutoCodes.ListShort[i].AutoCodeNum)
             {
                 listAutoCodes.SetSelected(i, true);
                 break;
             }
         }
     }
     //fill images to pick from
     for (int i = 0; i < imageList.Images.Count; i++)
     {
         listView.Items.Add("", i);
     }
 }
Exemplo n.º 2
0
 private void FillList()
 {
     AutoCodes.Refresh();
     listAutoCodes.Items.Clear();
     for (int i = 0; i < AutoCodes.List.Length; i++)
     {
         if (AutoCodes.List[i].IsHidden)
         {
             listAutoCodes.Items.Add(AutoCodes.List[i].Description + "(hidden)");
         }
         else
         {
             listAutoCodes.Items.Add(AutoCodes.List[i].Description);
         }
     }
 }