Пример #1
0
        private void FormSheetFieldGrid_Load(object sender, EventArgs e)
        {
            if (IsReadOnly)
            {
                butOK.Enabled     = false;
                butDelete.Enabled = false;
            }
            textGridType.Text = SheetFieldDefCur.FieldName;
            textXPos.Text     = SheetFieldDefCur.XPos.ToString();
            textYPos.Text     = SheetFieldDefCur.YPos.ToString();
            List <DisplayField> Columns = SheetUtil.GetGridColumnsAvailable(SheetFieldDefCur.FieldName);

            SheetFieldDefCur.Width = 0;
            foreach (DisplayField f in Columns)
            {
                SheetFieldDefCur.Width += f.ColumnWidth;
            }
            textWidth.Text = SheetFieldDefCur.Width.ToString();
            UI.ODGrid odGrid = new ODGrid();
            odGrid.TranslationName = "";
            using (Graphics g = Graphics.FromImage(new Bitmap(100, 100))) {
                if (SheetFieldDefCur.FieldName == "EraClaimsPaid")
                {
                    //Do not modify grid title heights for ERA claims paid grid 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", "StatementInvoicePayment", "TreatPlanBenefitsFamily", "TreatPlanBenefitsIndividual" }.Contains(SheetFieldDefCur.FieldName))
                    {
                        SheetFieldDefCur.Height += odGrid.TitleHeight;
                    }
                    SheetFieldDefCur.Height += odGrid.HeaderHeight + (int)g.MeasureString("Any", odGrid.Font, 100, StringFormat.GenericTypographic).Height + 3;
                }
                textHeight.Text = SheetFieldDefCur.Height.ToString();
            }
            for (int i = 0; i < Enum.GetNames(typeof(GrowthBehaviorEnum)).Length; i++)
            {
                comboGrowthBehavior.Items.Add(Enum.GetNames(typeof(GrowthBehaviorEnum))[i]);
                if ((int)SheetFieldDefCur.GrowthBehavior == i)
                {
                    comboGrowthBehavior.SelectedIndex = i;
                }
            }
        }
Пример #2
0
 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);
 }