コード例 #1
0
        private Cell CalculateControl(string type)
        {
            Cell cell = null;

            switch (type.ToLower())
            {
            case "algorithmcalculator":
                cell = new AlgorithmCalculator();
                break;

            case "decimalalgorithmcalculator":
                cell = new DecimalAlgorithmCalculator();
                break;

            case "calculator":
                cell = new Calculator();
                break;

            case "superlabel":
                cell = new SuperLabel();
                break;

            case "label":
                cell = new Label();
                break;

            //case "dbtext"://unit
            //    cell = new DBText();
            //    break;
            case "chart":
                cell = new Chart();
                break;
            }
            return(cell);
        }
コード例 #2
0
 private void SetSuper(SuperLabel sl)
 {
     foreach (Label l in sl.Labels)
     {
         l.Super = sl;
         if (l is SuperLabel)
         {
             SetSuper(l as SuperLabel);
         }
     }
 }
コード例 #3
0
ファイル: Row.cs プロジェクト: kkmeteor/StudyProjects
 private void ReleaseASuperLabel(SuperLabel superlabel, int height)
 {
     foreach (Label label in superlabel.Labels)
     {
         superlabel.Labels.AdjustRuntimeHeight();
         if (!label.Visible)
         {
             continue;
         }
         label.AutoHeightY = label.Y + height;
         label.Super       = superlabel;
         if (label is SuperLabel)
         {
             ReleaseASuperLabel(label as SuperLabel, height);
         }
         _cells.AddByVisiblePosition(label);
         //_cells.AddDirectly(label);
     }
 }
コード例 #4
0
ファイル: Row.cs プロジェクト: kkmeteor/StudyProjects
        private void HandleSuperLabel(Cell cell)
        {
            SuperLabel superlabel = cell as SuperLabel;
            int        mh         = superlabel.ExpandHeight;
            int        rh         = this._expandheight;
            int        height     = 0;
            int        oldheight  = superlabel.RuntimeHeight;

            superlabel.bTop = true;
            //if (!superlabel.KeepPos)
            //{
            superlabel.AutoHeightY = superlabel.Y;
            if (mh <= rh)
            {
                superlabel.SetRuntimeHeight(rh - (mh - oldheight));
                height = superlabel.RuntimeHeight - superlabel.Height;
            }

            //}
            ReleaseASuperLabel(superlabel, height);
        }
コード例 #5
0
ファイル: GridDetail.cs プロジェクト: kkmeteor/StudyProjects
        private int SetSuper(SuperLabel sl)
        {
            int width = 0;

            foreach (Cell cell in sl.Cells)
            {
                if (cell is SuperLabel)
                {
                    width += SetSuper(cell as SuperLabel);
                }
                else
                {
                    width += cell.Width;
                }
            }
            if (sl.Cells.Count > 0)
            {
                sl.X     = sl.Cells[0].X;
                sl.Width = width;
            }
            return(sl.Width);
        }
コード例 #6
0
ファイル: SuperLabel.cs プロジェクト: kkmeteor/StudyProjects
 public SuperLabel(SuperLabel superlabel) : base(superlabel)
 {
     _labels = superlabel.Labels.Clone() as Labels;
 }
コード例 #7
0
        protected override Cell AddALocaleCell(XmlElement xecc, Section section)
        {
            Cell   cell = null;
            string type = xecc.GetAttribute("Type");

            if (!section.CanBeParent(type))
            {
                return(null);
            }
            switch (type.ToLower())
            {
            case "commonlabel":
                cell = new CommonLabel();
                break;

            case "expression":
                cell = new Expression();
                break;

            case "image":
                cell = new Image();
                break;

            case "algorithmcalculator":
                cell = new AlgorithmCalculator();
                break;

            case "gridlabel":
                cell = new GridLabel();
                break;

            case "gridboolean":
                cell = new GridBoolean();
                break;

            case "gridimage":
                //cell=new GridImage();
                break;

            case "griddecimal":
                cell = new GridDecimal();
                break;

            case "gridcalculatecolumn":
                cell = new GridCalculateColumn();
                break;

            case "gridcolumnexpression":
                cell = new GridColumnExpression();
                break;

            case "griddecimalalgorithmcolumn":
                cell = new GridDecimalAlgorithmColumn();
                break;

            case "gridalgorithmcolumn":
                cell = new GridAlgorithmColumn();
                break;

            case "griddatetime":
                cell = new GridDateTime();
                break;

            case "gridexchangerate":
                //cell=new GridExchangeRate();
                break;

            case "superlabel":
                cell = new SuperLabel();
                break;

            case "gridproportiondecimal":
                cell = new GridProportionDecimal();
                break;
            }
            if (cell != null)
            {
                ConvertFromLocaleInfo(xecc, cell);
                section.Cells.Add(cell);
            }
            return(cell);
        }