Example #1
0
        ///<summary>Adds the requested controls to the form.</summary>
        private void AddInputControls()
        {
            _listInputControls = new List <Control>();
            List <Label> listLabels   = new List <Label>();
            int          curLocationY = 2;
            int          controlWidth = 385;
            int          minWidth     = 250;
            int          posX         = 32;
            int          itemOrder    = 1;

            foreach (InputBoxParam inputParam in _listInputParams)
            {
                if (inputParam == null)
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(inputParam.LabelText))
                {
                    Label label = new Label();
                    label.AutoSize  = false;
                    label.Size      = new Size(inputParam.ParamSize == Size.Empty ? controlWidth : inputParam.ParamSize.Width, 36);
                    label.Text      = inputParam.LabelText;
                    label.Name      = "labelPrompt" + itemOrder;
                    label.TextAlign = ContentAlignment.BottomLeft;
                    label.Location  = new Point(posX, curLocationY);
                    label.Tag       = inputParam;
                    listLabels.Add(label);
                    curLocationY += 38;
                }
                Control inputControl;
                switch (inputParam.ParamType)
                {
                case InputBoxType.TextBox:
                    TextBox textBox = new TextBox();
                    textBox.Name     = "textBox" + itemOrder;
                    textBox.Location = new Point(posX, curLocationY);
                    textBox.Size     = new Size(controlWidth, 20);
                    textBox.Anchor   = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                    textBox.Text     = inputParam.Text;
                    if (!String.IsNullOrEmpty(textBox.Text))
                    {
                        textBox.SelectionStart  = 0;
                        textBox.SelectionLength = textBox.Text.Length;
                    }
                    inputControl  = textBox;
                    curLocationY += 22;
                    break;

                case InputBoxType.TextBoxMultiLine:
                    TextBox textBoxMulti = new TextBox();
                    textBoxMulti.Name       = "textBox" + itemOrder;
                    textBoxMulti.Location   = new Point(posX, curLocationY);
                    textBoxMulti.Size       = new Size(controlWidth, 100);
                    textBoxMulti.Multiline  = true;
                    textBoxMulti.Text       = inputParam.Text;
                    this.AcceptButton       = null;
                    textBoxMulti.ScrollBars = ScrollBars.Vertical;
                    inputControl            = textBoxMulti;
                    curLocationY           += 102;
                    break;

                case InputBoxType.CheckBox:
                    CheckBox checkBox = new CheckBox();
                    checkBox.Name      = "checkBox" + itemOrder;
                    checkBox.Location  = new Point(posX + inputParam.Position.X, curLocationY + inputParam.Position.Y);
                    checkBox.Size      = inputParam.ParamSize == Size.Empty ? new Size(controlWidth, 20) : inputParam.ParamSize;
                    checkBox.Text      = inputParam.Text;
                    checkBox.FlatStyle = FlatStyle.System;
                    inputControl       = checkBox;
                    if (inputParam.HasTimeout)
                    {
                        _hasTimeout = true;
                    }
                    curLocationY += checkBox.Size.Height + 2;
                    break;

                case InputBoxType.ComboSelect:
                    UI.ComboBoxPlus comboBoxPlus = new UI.ComboBoxPlus();
                    comboBoxPlus.Name     = "comboBox" + itemOrder;
                    comboBoxPlus.Location = new Point(posX, curLocationY);
                    comboBoxPlus.Size     = inputParam.ParamSize == Size.Empty ? new Size(controlWidth, 21) : inputParam.ParamSize;
                    comboBoxPlus.Items.AddList <string>(inputParam.ListSelections, x => x);
                    if (inputParam.ListSelectedIndices.Count > 0 && inputParam.ListSelectedIndices[0].Between(0, comboBoxPlus.Items.Count - 1))
                    {
                        comboBoxPlus.SetSelected(inputParam.ListSelectedIndices[0]);                                //If there is a valid initial selection, select it.
                    }
                    inputControl  = comboBoxPlus;
                    curLocationY += 23;
                    break;

                case InputBoxType.ComboMultiSelect:
                    UI.ComboBoxPlus comboBoxPlus2 = new UI.ComboBoxPlus();
                    comboBoxPlus2.SelectionModeMulti = true;
                    comboBoxPlus2.Name      = "comboBox" + itemOrder;
                    comboBoxPlus2.Location  = new Point(posX, curLocationY);
                    comboBoxPlus2.Size      = new Size(controlWidth, 21);
                    comboBoxPlus2.BackColor = SystemColors.Window;
                    foreach (string selection in inputParam.ListSelections)
                    {
                        comboBoxPlus2.Items.Add(selection);
                    }
                    foreach (int selection in inputParam.ListSelectedIndices)
                    {
                        if (selection.Between(0, comboBoxPlus2.Items.Count - 1))
                        {
                            comboBoxPlus2.SetSelected(selection);                                    //If there is a valid initial selection, select it.
                        }
                    }
                    inputControl  = comboBoxPlus2;
                    curLocationY += 23;
                    break;

                case InputBoxType.ValidDate:
                    ValidDate validDate = new ValidDate();
                    validDate.Name     = "validDate" + itemOrder;
                    validDate.Location = new Point(posX, curLocationY);
                    validDate.Size     = new Size(100, 20);
                    validDate.Text     = inputParam.Text;
                    inputControl       = validDate;
                    Label label = new Label();
                    label.Size      = new Size(label.Width, validDate.Height);
                    label.Text      = $"({CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern})";
                    label.Name      = "labelDateFormat" + itemOrder;
                    label.TextAlign = ContentAlignment.MiddleLeft;
                    label.Location  = new Point(validDate.Location.X + validDate.Width + 12, curLocationY);
                    label.Tag       = inputParam;
                    listLabels.Add(label);
                    curLocationY += 22;
                    break;

                case InputBoxType.ValidTime:
                    ValidTime validTime = new ValidTime();
                    validTime.Name     = "validTime" + itemOrder;
                    validTime.Location = new Point(posX, curLocationY);
                    validTime.Size     = new Size(120, 20);
                    inputControl       = validTime;
                    curLocationY      += 22;
                    break;

                case InputBoxType.ValidDouble:
                    ValidDouble validDouble = new ValidDouble();
                    validDouble.Name     = "validDouble" + itemOrder;
                    validDouble.Location = new Point(posX, curLocationY);
                    validDouble.Size     = new Size(120, 20);
                    inputControl         = validDouble;
                    curLocationY        += 22;
                    break;

                case InputBoxType.ValidPhone:
                    ValidPhone validPhone = new ValidPhone();
                    validPhone.Name     = "validPhone" + itemOrder;
                    validPhone.Location = new Point(posX, curLocationY);
                    validPhone.Size     = new Size(140, 20);
                    validPhone.Text     = inputParam.Text;
                    if (!String.IsNullOrEmpty(validPhone.Text))
                    {
                        validPhone.SelectionStart  = 0;
                        validPhone.SelectionLength = validPhone.Text.Length;
                    }
                    inputControl  = validPhone;
                    curLocationY += 22;
                    break;

                case InputBoxType.ListBoxMulti:
                    ListBox listBox = new ListBox();
                    listBox.Name          = "listBox" + itemOrder;
                    listBox.Location      = new Point(posX, curLocationY);
                    listBox.BackColor     = SystemColors.Window;
                    listBox.SelectionMode = SelectionMode.MultiSimple;
                    foreach (string selection in inputParam.ListSelections)
                    {
                        listBox.Items.Add(selection);
                    }
                    listBox.Size  = new Size(controlWidth, listBox.PreferredHeight);
                    inputControl  = listBox;
                    curLocationY += (listBox.PreferredHeight) + 2;
                    break;

                default:
                    throw new NotImplementedException("InputBoxType: " + inputParam.ParamType + " not implemented.");
                }
                inputControl.TabIndex = itemOrder;
                inputControl.Tag      = inputParam;
                _listInputControls.Add(inputControl);
                minWidth = Math.Max(minWidth, inputControl.Width + 80);
            }
            //Now that we know the minWidth, we can center any controls that need to be centered.
            foreach (Control inputControl in _listInputControls.Union(listLabels))
            {
                InputBoxParam inputParam = (InputBoxParam)inputControl.Tag;
                if (inputParam.HorizontalAlign != HorizontalAlignment.Left)
                {
                    inputControl.Location = new Point((minWidth - inputControl.Width) / 2, inputControl.Location.Y);
                }
            }
            Controls.AddRange(listLabels.ToArray());
            Controls.AddRange(_listInputControls.ToArray());
            Height = curLocationY + 90;
            Width  = minWidth;
        }
Example #2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormClearinghouses));
     this.groupBox1               = new System.Windows.Forms.GroupBox();
     this.butEligibility          = new OpenDental.UI.Button();
     this.butDefaultMedical       = new OpenDental.UI.Button();
     this.butDefaultDental        = new OpenDental.UI.Button();
     this.textReportCheckInterval = new System.Windows.Forms.TextBox();
     this.labelReportheckUnits    = new System.Windows.Forms.Label();
     this.butAdd                     = new OpenDental.UI.Button();
     this.butClose                   = new OpenDental.UI.Button();
     this.labelClinic                = new System.Windows.Forms.Label();
     this.comboClinic                = new System.Windows.Forms.ComboBox();
     this.labelGuide                 = new System.Windows.Forms.Label();
     this.gridMain                   = new OpenDental.UI.ODGrid();
     this.radioInterval              = new System.Windows.Forms.RadioButton();
     this.radioTime                  = new System.Windows.Forms.RadioButton();
     this.textReportCheckTime        = new OpenDental.ValidTime();
     this.groupRecieveSettings       = new System.Windows.Forms.GroupBox();
     this.checkReceiveReportsService = new System.Windows.Forms.CheckBox();
     this.textReportComputerName     = new System.Windows.Forms.TextBox();
     this.butThisComputer            = new OpenDental.UI.Button();
     this.labelReportComputerName    = new System.Windows.Forms.Label();
     this.groupBox1.SuspendLayout();
     this.groupRecieveSettings.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.groupBox1.Controls.Add(this.butEligibility);
     this.groupBox1.Controls.Add(this.butDefaultMedical);
     this.groupBox1.Controls.Add(this.butDefaultDental);
     this.groupBox1.Location = new System.Drawing.Point(6, 387);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(97, 112);
     this.groupBox1.TabIndex = 9;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Set Default";
     //
     // butEligibility
     //
     this.butEligibility.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butEligibility.Autosize            = true;
     this.butEligibility.BtnShape            = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butEligibility.BtnStyle            = OpenDental.UI.enumType.XPStyle.Silver;
     this.butEligibility.CornerRadius        = 4F;
     this.butEligibility.Location            = new System.Drawing.Point(15, 79);
     this.butEligibility.Name     = "butEligibility";
     this.butEligibility.Size     = new System.Drawing.Size(75, 24);
     this.butEligibility.TabIndex = 3;
     this.butEligibility.Text     = "Eligibility";
     this.butEligibility.Click   += new System.EventHandler(this.butEligibility_Click);
     //
     // butDefaultMedical
     //
     this.butDefaultMedical.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butDefaultMedical.Autosize            = true;
     this.butDefaultMedical.BtnShape            = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butDefaultMedical.BtnStyle            = OpenDental.UI.enumType.XPStyle.Silver;
     this.butDefaultMedical.CornerRadius        = 4F;
     this.butDefaultMedical.Location            = new System.Drawing.Point(15, 49);
     this.butDefaultMedical.Name     = "butDefaultMedical";
     this.butDefaultMedical.Size     = new System.Drawing.Size(75, 24);
     this.butDefaultMedical.TabIndex = 2;
     this.butDefaultMedical.Text     = "Medical";
     this.butDefaultMedical.Click   += new System.EventHandler(this.butDefaultMedical_Click);
     //
     // butDefaultDental
     //
     this.butDefaultDental.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butDefaultDental.Autosize            = true;
     this.butDefaultDental.BtnShape            = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butDefaultDental.BtnStyle            = OpenDental.UI.enumType.XPStyle.Silver;
     this.butDefaultDental.CornerRadius        = 4F;
     this.butDefaultDental.Location            = new System.Drawing.Point(15, 19);
     this.butDefaultDental.Name     = "butDefaultDental";
     this.butDefaultDental.Size     = new System.Drawing.Size(75, 24);
     this.butDefaultDental.TabIndex = 1;
     this.butDefaultDental.Text     = "Dental";
     this.butDefaultDental.Click   += new System.EventHandler(this.butDefaultDental_Click);
     //
     // textReportCheckInterval
     //
     this.textReportCheckInterval.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.textReportCheckInterval.Location  = new System.Drawing.Point(237, 66);
     this.textReportCheckInterval.MaxLength = 2147483647;
     this.textReportCheckInterval.Multiline = true;
     this.textReportCheckInterval.Name      = "textReportCheckInterval";
     this.textReportCheckInterval.Size      = new System.Drawing.Size(29, 20);
     this.textReportCheckInterval.TabIndex  = 14;
     //
     // labelReportheckUnits
     //
     this.labelReportheckUnits.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.labelReportheckUnits.Location  = new System.Drawing.Point(273, 66);
     this.labelReportheckUnits.Name      = "labelReportheckUnits";
     this.labelReportheckUnits.Size      = new System.Drawing.Size(128, 20);
     this.labelReportheckUnits.TabIndex  = 15;
     this.labelReportheckUnits.Text      = "minutes (5 to 60)";
     this.labelReportheckUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // butAdd
     //
     this.butAdd.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butAdd.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butAdd.Autosize     = true;
     this.butAdd.BtnShape     = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butAdd.BtnStyle     = OpenDental.UI.enumType.XPStyle.Silver;
     this.butAdd.CornerRadius = 4F;
     this.butAdd.Image        = global::OpenDental.Properties.Resources.Add;
     this.butAdd.ImageAlign   = System.Drawing.ContentAlignment.MiddleLeft;
     this.butAdd.Location     = new System.Drawing.Point(805, 385);
     this.butAdd.Name         = "butAdd";
     this.butAdd.Size         = new System.Drawing.Size(80, 24);
     this.butAdd.TabIndex     = 8;
     this.butAdd.Text         = "&Add";
     this.butAdd.Click       += new System.EventHandler(this.butAdd_Click);
     //
     // butClose
     //
     this.butClose.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butClose.Autosize     = true;
     this.butClose.BtnShape     = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butClose.BtnStyle     = OpenDental.UI.enumType.XPStyle.Silver;
     this.butClose.CornerRadius = 4F;
     this.butClose.Location     = new System.Drawing.Point(805, 466);
     this.butClose.Name         = "butClose";
     this.butClose.Size         = new System.Drawing.Size(75, 24);
     this.butClose.TabIndex     = 0;
     this.butClose.Text         = "&Close";
     this.butClose.Click       += new System.EventHandler(this.butClose_Click);
     //
     // labelClinic
     //
     this.labelClinic.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.labelClinic.Location  = new System.Drawing.Point(616, 18);
     this.labelClinic.Name      = "labelClinic";
     this.labelClinic.Size      = new System.Drawing.Size(101, 18);
     this.labelClinic.TabIndex  = 21;
     this.labelClinic.Text      = "Clinic";
     this.labelClinic.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     this.labelClinic.Visible   = false;
     //
     // comboClinic
     //
     this.comboClinic.Anchor                    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.comboClinic.DropDownStyle             = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.comboClinic.Location                  = new System.Drawing.Point(720, 17);
     this.comboClinic.Name                      = "comboClinic";
     this.comboClinic.Size                      = new System.Drawing.Size(165, 21);
     this.comboClinic.TabIndex                  = 20;
     this.comboClinic.Visible                   = false;
     this.comboClinic.SelectionChangeCommitted += new System.EventHandler(this.comboClinic_SelectionChangeCommitted);
     //
     // labelGuide
     //
     this.labelGuide.Location  = new System.Drawing.Point(6, -1);
     this.labelGuide.Name      = "labelGuide";
     this.labelGuide.Size      = new System.Drawing.Size(595, 36);
     this.labelGuide.TabIndex  = 22;
     this.labelGuide.Text      = resources.GetString("labelGuide.Text");
     this.labelGuide.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
     //
     // gridMain
     //
     this.gridMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                   | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.gridMain.CellFont            = new System.Drawing.Font("Microsoft Sans Serif", 8.5F);
     this.gridMain.HasAddButton        = false;
     this.gridMain.HasDropDowns        = false;
     this.gridMain.HasMultilineHeaders = false;
     this.gridMain.HeaderFont          = new System.Drawing.Font("Microsoft Sans Serif", 8.5F, System.Drawing.FontStyle.Bold);
     this.gridMain.HeaderHeight        = 15;
     this.gridMain.HScrollVisible      = false;
     this.gridMain.Location            = new System.Drawing.Point(6, 39);
     this.gridMain.Name             = "gridMain";
     this.gridMain.ScrollValue      = 0;
     this.gridMain.Size             = new System.Drawing.Size(879, 340);
     this.gridMain.TabIndex         = 17;
     this.gridMain.Title            = "Clearinghouses";
     this.gridMain.TitleFont        = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold);
     this.gridMain.TitleHeight      = 18;
     this.gridMain.TranslationName  = "TableClearinghouses";
     this.gridMain.CellDoubleClick += new OpenDental.UI.ODGridClickEventHandler(this.gridMain_CellDoubleClick);
     //
     // radioInterval
     //
     this.radioInterval.Checked                 = true;
     this.radioInterval.Location                = new System.Drawing.Point(102, 68);
     this.radioInterval.Name                    = "radioInterval";
     this.radioInterval.RightToLeft             = System.Windows.Forms.RightToLeft.No;
     this.radioInterval.Size                    = new System.Drawing.Size(134, 17);
     this.radioInterval.TabIndex                = 25;
     this.radioInterval.TabStop                 = true;
     this.radioInterval.Text                    = "Receive at an interval";
     this.radioInterval.UseVisualStyleBackColor = true;
     this.radioInterval.CheckedChanged         += new System.EventHandler(this.radioInterval_CheckedChanged);
     //
     // radioTime
     //
     this.radioTime.Location                = new System.Drawing.Point(102, 90);
     this.radioTime.Name                    = "radioTime";
     this.radioTime.RightToLeft             = System.Windows.Forms.RightToLeft.No;
     this.radioTime.Size                    = new System.Drawing.Size(134, 17);
     this.radioTime.TabIndex                = 26;
     this.radioTime.Text                    = "Receive at a set time";
     this.radioTime.UseVisualStyleBackColor = true;
     //
     // textReportCheckTime
     //
     this.textReportCheckTime.Enabled  = false;
     this.textReportCheckTime.Location = new System.Drawing.Point(237, 89);
     this.textReportCheckTime.Name     = "textReportCheckTime";
     this.textReportCheckTime.Size     = new System.Drawing.Size(119, 20);
     this.textReportCheckTime.TabIndex = 28;
     //
     // groupRecieveSettings
     //
     this.groupRecieveSettings.Controls.Add(this.checkReceiveReportsService);
     this.groupRecieveSettings.Controls.Add(this.textReportComputerName);
     this.groupRecieveSettings.Controls.Add(this.butThisComputer);
     this.groupRecieveSettings.Controls.Add(this.labelReportComputerName);
     this.groupRecieveSettings.Controls.Add(this.radioInterval);
     this.groupRecieveSettings.Controls.Add(this.textReportCheckTime);
     this.groupRecieveSettings.Controls.Add(this.radioTime);
     this.groupRecieveSettings.Controls.Add(this.textReportCheckInterval);
     this.groupRecieveSettings.Controls.Add(this.labelReportheckUnits);
     this.groupRecieveSettings.Location = new System.Drawing.Point(162, 385);
     this.groupRecieveSettings.Name     = "groupRecieveSettings";
     this.groupRecieveSettings.Size     = new System.Drawing.Size(571, 115);
     this.groupRecieveSettings.TabIndex = 29;
     this.groupRecieveSettings.TabStop  = false;
     this.groupRecieveSettings.Text     = "Automatic Report Settings";
     //
     // checkReceiveReportsService
     //
     this.checkReceiveReportsService.Anchor          = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.checkReceiveReportsService.CheckAlign      = System.Drawing.ContentAlignment.MiddleRight;
     this.checkReceiveReportsService.FlatStyle       = System.Windows.Forms.FlatStyle.System;
     this.checkReceiveReportsService.Location        = new System.Drawing.Point(22, 17);
     this.checkReceiveReportsService.Name            = "checkReceiveReportsService";
     this.checkReceiveReportsService.Size            = new System.Drawing.Size(227, 17);
     this.checkReceiveReportsService.TabIndex        = 32;
     this.checkReceiveReportsService.TabStop         = false;
     this.checkReceiveReportsService.Text            = "Receive Reports by Service";
     this.checkReceiveReportsService.TextAlign       = System.Drawing.ContentAlignment.MiddleRight;
     this.checkReceiveReportsService.CheckedChanged += new System.EventHandler(this.checkReceiveReportsService_CheckedChanged);
     //
     // textReportComputerName
     //
     this.textReportComputerName.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.textReportComputerName.Location  = new System.Drawing.Point(237, 39);
     this.textReportComputerName.MaxLength = 2147483647;
     this.textReportComputerName.Multiline = true;
     this.textReportComputerName.Name      = "textReportComputerName";
     this.textReportComputerName.Size      = new System.Drawing.Size(239, 20);
     this.textReportComputerName.TabIndex  = 29;
     //
     // butThisComputer
     //
     this.butThisComputer.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.butThisComputer.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.butThisComputer.Autosize     = true;
     this.butThisComputer.BtnShape     = OpenDental.UI.enumType.BtnShape.Rectangle;
     this.butThisComputer.BtnStyle     = OpenDental.UI.enumType.XPStyle.Silver;
     this.butThisComputer.CornerRadius = 4F;
     this.butThisComputer.Location     = new System.Drawing.Point(479, 37);
     this.butThisComputer.Name         = "butThisComputer";
     this.butThisComputer.Size         = new System.Drawing.Size(86, 24);
     this.butThisComputer.TabIndex     = 31;
     this.butThisComputer.Text         = "This Computer";
     this.butThisComputer.Click       += new System.EventHandler(this.butThisComputer_Click);
     //
     // labelReportComputerName
     //
     this.labelReportComputerName.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.labelReportComputerName.Location  = new System.Drawing.Point(6, 39);
     this.labelReportComputerName.Name      = "labelReportComputerName";
     this.labelReportComputerName.Size      = new System.Drawing.Size(228, 20);
     this.labelReportComputerName.TabIndex  = 30;
     this.labelReportComputerName.Text      = "Computer To Receive Reports Automatically";
     this.labelReportComputerName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // FormClearinghouses
     //
     this.ClientSize = new System.Drawing.Size(891, 503);
     this.Controls.Add(this.groupRecieveSettings);
     this.Controls.Add(this.labelGuide);
     this.Controls.Add(this.labelClinic);
     this.Controls.Add(this.comboClinic);
     this.Controls.Add(this.gridMain);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.butAdd);
     this.Controls.Add(this.butClose);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MinimumSize   = new System.Drawing.Size(850, 500);
     this.Name          = "FormClearinghouses";
     this.ShowInTaskbar = false;
     this.Text          = "E-Claims";
     this.Closing      += new System.ComponentModel.CancelEventHandler(this.FormClearinghouses_Closing);
     this.Load         += new System.EventHandler(this.FormClearinghouses_Load);
     this.groupBox1.ResumeLayout(false);
     this.groupRecieveSettings.ResumeLayout(false);
     this.groupRecieveSettings.PerformLayout();
     this.ResumeLayout(false);
 }
Example #3
0
        ///<summary>Adds the requested controls to the form.</summary>
        private void AddInputControls()
        {
            _listInputControls = new List <Control>();
            int curLocationY = 2;
            int controlWidth = 385;
            int minWidth     = 250;
            int posX         = 32;
            int itemOrder    = 1;

            foreach (InputBoxParam inputParam in _listInputParams)
            {
                if (inputParam == null)
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(inputParam.LabelText))
                {
                    Label label = new Label();
                    label.AutoSize  = false;
                    label.Size      = new Size(controlWidth, 36);
                    label.Text      = inputParam.LabelText;
                    label.Name      = "labelPrompt" + itemOrder;
                    label.TextAlign = ContentAlignment.BottomLeft;
                    label.Location  = new Point(posX, curLocationY);
                    Controls.Add(label);
                    curLocationY += 38;
                }
                Control inputControl;
                switch (inputParam.ParamType)
                {
                case InputBoxType.TextBox:
                    TextBox textBox = new TextBox();
                    textBox.Name     = "textBox" + itemOrder;
                    textBox.Location = new Point(posX, curLocationY);
                    textBox.Size     = new Size(controlWidth, 20);
                    textBox.Text     = inputParam.Text;
                    if (!String.IsNullOrEmpty(textBox.Text))
                    {
                        textBox.SelectionStart  = 0;
                        textBox.SelectionLength = textBox.Text.Length;
                    }
                    inputControl  = textBox;
                    curLocationY += 22;
                    break;

                case InputBoxType.TextBoxMultiLine:
                    TextBox textBoxMulti = new TextBox();
                    textBoxMulti.Name       = "textBox" + itemOrder;
                    textBoxMulti.Location   = new Point(posX, curLocationY);
                    textBoxMulti.Size       = new Size(controlWidth, 100);
                    textBoxMulti.Multiline  = true;
                    textBoxMulti.Text       = inputParam.Text;
                    this.AcceptButton       = null;
                    textBoxMulti.ScrollBars = ScrollBars.Vertical;
                    inputControl            = textBoxMulti;
                    curLocationY           += 102;
                    break;

                case InputBoxType.CheckBox:
                    CheckBox checkBox = new CheckBox();
                    checkBox.Name      = "checkBox" + itemOrder;
                    checkBox.Location  = new Point(posX + inputParam.Position.X, curLocationY + inputParam.Position.Y);
                    checkBox.Size      = inputParam.ParamSize == Size.Empty ? new Size(controlWidth, 20) : inputParam.ParamSize;
                    checkBox.Text      = inputParam.Text;
                    checkBox.FlatStyle = FlatStyle.System;
                    inputControl       = checkBox;
                    if (inputParam.HasTimeout)
                    {
                        _hasTimeout = true;
                    }
                    curLocationY += checkBox.Size.Height + 2;
                    break;

                case InputBoxType.ComboSelect:
                    ComboBox comboBox = new ComboBox();
                    comboBox.Name             = "comboBox" + itemOrder;
                    comboBox.Location         = new Point(posX, curLocationY);
                    comboBox.Size             = new Size(controlWidth, 21);
                    comboBox.DropDownStyle    = ComboBoxStyle.DropDownList;
                    comboBox.DropDownWidth    = controlWidth + 10;
                    comboBox.MaxDropDownItems = 30;
                    foreach (string selection in inputParam.ListSelections)
                    {
                        int idx = comboBox.Items.Add(selection);
                        if (idx.In(inputParam.ListSelectedIndices))
                        {
                            comboBox.IndexSelectOrSetText(idx, () => { return(""); });
                        }
                    }
                    inputControl  = comboBox;
                    curLocationY += 23;
                    break;

                case InputBoxType.ComboMultiSelect:
                    ComboBoxMulti comboBoxMulti = new ComboBoxMulti();
                    comboBoxMulti.Name      = "comboBoxMulti" + itemOrder;
                    comboBoxMulti.Location  = new Point(posX, curLocationY);
                    comboBoxMulti.Size      = new Size(controlWidth, 21);
                    comboBoxMulti.BackColor = SystemColors.Window;
                    foreach (string selection in inputParam.ListSelections)
                    {
                        comboBoxMulti.Items.Add(selection);
                    }
                    inputControl  = comboBoxMulti;
                    curLocationY += 23;
                    break;

                case InputBoxType.ValidDate:
                    ValidDate validDate = new ValidDate();
                    validDate.Name     = "validDate" + itemOrder;
                    validDate.Location = new Point(posX, curLocationY);
                    validDate.Size     = new Size(100, 20);
                    inputControl       = validDate;
                    curLocationY      += 22;
                    break;

                case InputBoxType.ValidTime:
                    ValidTime validTime = new ValidTime();
                    validTime.Name     = "validTime" + itemOrder;
                    validTime.Location = new Point(posX, curLocationY);
                    validTime.Size     = new Size(120, 20);
                    inputControl       = validTime;
                    curLocationY      += 22;
                    break;

                case InputBoxType.ValidDouble:
                    ValidDouble validDouble = new ValidDouble();
                    validDouble.Name     = "validDouble" + itemOrder;
                    validDouble.Location = new Point(posX, curLocationY);
                    validDouble.Size     = new Size(120, 20);
                    inputControl         = validDouble;
                    curLocationY        += 22;
                    break;

                case InputBoxType.ListBoxMulti:
                    ListBox listBox = new ListBox();
                    listBox.Name          = "listBox" + itemOrder;
                    listBox.Location      = new Point(posX, curLocationY);
                    listBox.BackColor     = SystemColors.Window;
                    listBox.SelectionMode = SelectionMode.MultiSimple;
                    foreach (string selection in inputParam.ListSelections)
                    {
                        listBox.Items.Add(selection);
                    }
                    listBox.Size  = new Size(controlWidth, listBox.PreferredHeight);
                    inputControl  = listBox;
                    curLocationY += (listBox.PreferredHeight) + 2;
                    break;

                default:
                    throw new NotImplementedException("InputBoxType: " + inputParam.ParamType + " not implemented.");
                }
                inputControl.TabIndex = itemOrder;
                _listInputControls.Add(inputControl);
                minWidth = Math.Max(minWidth, inputControl.Width + 80);
            }
            Controls.AddRange(_listInputControls.ToArray());
            Height = curLocationY + 90;
            Width  = minWidth;
        }