Beispiel #1
0
        private void FormSheetFieldStatic_Load(object sender, EventArgs e)
        {
            if (_sheetDefCur.SheetType != SheetTypeEnum.Statement)
            {
                checkPmtOpt.Visible = false;
            }
            if (_sheetDefCur.SheetType == SheetTypeEnum.PatientLetter)
            {
                butExamSheet.Visible = true;
            }
            else
            {
                butExamSheet.Visible = false;
            }
            if (_isEditMobile)              //When we open this form from the mobile layout window, make it clear which fields do not apply to mobile layout
            {
                groupBox1.Enabled           = false;
                comboGrowthBehavior.Enabled = false;
                checkPmtOpt.Enabled         = false;
            }
            if (SheetDefs.IsDashboardType(_sheetDefCur))
            {
                comboGrowthBehavior.Enabled = false;
            }
            checkIncludeInMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //Show/hide in mobile editor depending on if TabOrderMobile has been previously set. This is how we will selectively include only desireable StaticText fields.
            checkIncludeInMobile.Checked = SheetFieldDefCur.TabOrderMobile >= 1;
            checkIsLocked.Checked        = SheetFieldDefCur.IsNew ? true : SheetFieldDefCur.IsLocked;
            textFieldValue.Text          = SheetFieldDefCur.FieldValue;
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            numFontSize.Value       = (decimal)SheetFieldDefCur.FontSize;
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior);
            for (int i = 0; i < Enum.GetNames(typeof(System.Windows.Forms.HorizontalAlignment)).Length; i++)
            {
                comboTextAlign.Items.Add(Enum.GetNames(typeof(System.Windows.Forms.HorizontalAlignment))[i]);
                if ((int)SheetFieldDefCur.TextAlign == i)
                {
                    comboTextAlign.SelectedIndex = i;
                }
            }
            checkPmtOpt.Checked = SheetFieldDefCur.IsPaymentOption;
            butColor.BackColor  = SheetFieldDefCur.ItemColor;
            FillFields();
        }
Beispiel #2
0
        ///<summary>Each special field type is a little bit different, this allows each field to fill the form in its own way.</summary>
        private void FillFields()
        {
            labelSpecialInfo.Text = "";
            //textXPos.Enabled=true;
            //textYPos.Enabled=true;
            textHeight.Enabled  = true;
            textWidth.Enabled   = true;
            textHeight.ReadOnly = false;
            //These are set in the base constructor, but also need to be updated here for listBoxAvailable_SelectedIndexChanged
            textXPos.Text   = SheetFieldDefCur.XPos.ToString();
            textYPos.Text   = SheetFieldDefCur.YPos.ToString();
            textWidth.Text  = SheetFieldDefCur.Width.ToString();
            textHeight.Text = SheetFieldDefCur.Height.ToString();
            bool isDynamicSheetType = _sheetDefCur.SheetType.GetAttributeOrDefault <SheetLayoutAttribute>().IsDynamic;

            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior, isDynamicSheetType);
            textWidth.MinVal  = -100;         //Default for control in this window.
            textHeight.MinVal = -100;         //Default for control in this window.
            switch (listBoxAvailable.SelectedItem.ToString())
            {
            case "toothChart":
                labelSpecialInfo.Text = Lan.g(this, "The tooth chart will display a graphical toothchart based on which patient and treatment plan is selected. " +
                                              "Fixed aspect ratio of 410/307");
                if (_sheetDefCur.SheetType.GetAttributeOrDefault <SheetLayoutAttribute>().IsDynamic)
                {
                    //Allow user to edit toothChart width.
                    textHeight.ReadOnly = true;
                    textWidth.MinVal    = 410;
                    textHeight.MinVal   = 307;
                }
                break;

            case "toothChartLegend":
                labelSpecialInfo.Text = Lan.g(this, "The tooth chart legend shows what the colors on the tooth chart mean.");
                textWidth.Text        = POut.Int(DashToothChartLegend.DefaultWidth);
                textHeight.Text       = POut.Int(DashToothChartLegend.DefaultHeight);
                if (!SheetDefs.IsDashboardType(_sheetDefCur))
                {
                    textWidth.Enabled  = false;
                    textHeight.Enabled = false;
                }
                break;

            case "toothGrid":                    //not used
            default:
                break;
            }
        }
Beispiel #3
0
        private void FormSheetFieldInput_Load(object sender, EventArgs e)
        {
            labelReportableName.Visible = false;
            textReportableName.Visible  = false;
            if (SheetFieldDefCur.FieldName.StartsWith("misc"))
            {
                labelReportableName.Visible = true;
                textReportableName.Visible  = true;
                textReportableName.Text     = SheetFieldDefCur.ReportableName;
            }
            if (_isEditMobile)
            {
                groupBox1.Enabled           = false;
                comboGrowthBehavior.Enabled = false;
                textTabOrder.Enabled        = false;
            }
            textUiLabelMobile.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(_sheetDefCur.SheetType, OutInCheck.In);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName.StartsWith(AvailFields[i].FieldName))
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior);
            checkRequired.Checked = SheetFieldDefCur.IsRequired;
            textTabOrder.Text     = SheetFieldDefCur.TabOrder.ToString();
            if (!string.IsNullOrEmpty(SheetFieldDefCur.UiLabelMobile))              //Already has a value that user has setup previously.
            {
                textUiLabelMobile.Text = SheetFieldDefCur.UiLabelMobile;
            }
        }
 private void FormSheetFieldGrid_Load(object sender, EventArgs e)
 {
     textGridType.Text   = SheetFieldDefCur.FieldName;
     _isDynamicSheetType = _sheetDefCur.SheetType.GetAttributeOrDefault <SheetLayoutAttribute>().IsDynamic;
     if (_isDynamicSheetType || SheetDefs.IsDashboardType(_sheetDefCur))
     {
         //Allow user to set dimensions of grids in dynamic layout defs.
         //These values define the min width and height.
         textHeight.Enabled = true;
         textWidth.Enabled  = true;
         if (_isDynamicSheetType)
         {
             comboGrowthBehavior.Enabled = true;
         }
     }
     else
     {
         List <DisplayField> Columns = SheetUtil.GetGridColumnsAvailable(SheetFieldDefCur.FieldName);
         SheetFieldDefCur.Width = 0;
         foreach (DisplayField f in Columns)
         {
             SheetFieldDefCur.Width += f.ColumnWidth;
         }
     }
     UI.ODGrid odGrid = new ODGrid();
     odGrid.TranslationName = "";
     using (Graphics g = Graphics.FromImage(new Bitmap(100, 100))) {
         if (SheetFieldDefCur.FieldName == "EraClaimsPaid" || SheetDefs.IsDashboardType(_sheetDefCur) || _isDynamicSheetType)
         {
             //Do not modify grid heights for Eras, Appt grid and dynamic layouts as the heights are calculated elsewhere.
         }
         else
         {
             //Why do we change the grid title height here?  The heights are also set elsewhere...
             SheetFieldDefCur.Height = 0;
             //These grids display a title.
             if (new[] { "StatementPayPlan", "StatementDynamicPayPlan", "StatementInvoicePayment", "TreatPlanBenefitsFamily", "TreatPlanBenefitsIndividual" }.Contains(SheetFieldDefCur.FieldName))
             {
                 SheetFieldDefCur.Height += 18;             //odGrid.TitleHeight;
             }
             SheetFieldDefCur.Height += 15                  //odGrid.HeaderHeight
                                        + (int)g.MeasureString("Any", odGrid.Font, 100, StringFormat.GenericTypographic).Height + 3;
         }
         textHeight.Text = SheetFieldDefCur.Height.ToString();
     }
     SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior, _isDynamicSheetType, true);
 }
        private void FormSheetFieldDefEdit_Load(object sender, EventArgs e)
        {
            if (_isEditMobile)
            {
                comboGrowthBehavior.Enabled = false;
                groupBox1.Enabled           = false;
            }
            textUiLabelMobile.Visible  = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            labelUiLabelMobile.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType);
            //not allowed to change sheettype or fieldtype once created.  So get all avail fields for this sheettype
            AvailFields = SheetFieldsAvailable.GetList(_sheetDefCur.SheetType, OutInCheck.Out);
            listFields.Items.Clear();
            for (int i = 0; i < AvailFields.Count; i++)
            {
                //static text is not one of the options.
                listFields.Items.Add(AvailFields[i].FieldName);
                if (SheetFieldDefCur.FieldName == AvailFields[i].FieldName)
                {
                    listFields.SelectedIndex = i;
                }
            }
            InstalledFontCollection fColl = new InstalledFontCollection();

            for (int i = 0; i < fColl.Families.Length; i++)
            {
                comboFontName.Items.Add(fColl.Families[i].Name);
            }
            comboFontName.Text      = SheetFieldDefCur.FontName;
            textFontSize.Text       = SheetFieldDefCur.FontSize.ToString();
            checkFontIsBold.Checked = SheetFieldDefCur.FontIsBold;
            SheetUtil.FillComboGrowthBehavior(comboGrowthBehavior, SheetFieldDefCur.GrowthBehavior);
            comboTextAlign.Items.AddEnums <HorizontalAlignment>();
            comboTextAlign.SetSelected((int)SheetFieldDefCur.TextAlign);
            checkIsLocked.Checked = SheetFieldDefCur.IsNew ? true : SheetFieldDefCur.IsLocked;
            butColor.BackColor    = SheetFieldDefCur.ItemColor;
            if (!string.IsNullOrEmpty(SheetFieldDefCur.UiLabelMobile))              //Already has a value that user has setup previously.
            {
                textUiLabelMobile.Text = SheetFieldDefCur.UiLabelMobile;
            }
        }