Esempio n. 1
0
        /// <summary>
        /// Calculates the runtime y position of the object based on the height of objects
        /// above it vertically.
        /// </summary>
        internal float Gap(Report rpt)
        {
            float      top    = _Top == null? 0: _Top.ToPoints();
            ReportItem saveri = GetReportItemAbove(rpt);

            if (saveri == null)
            {
                return(top);
            }

            float gap   = top;
            float s_top = saveri.Top == null ? 0 : saveri.Top.ToPoints();
            float s_h   = saveri.Height == null ? 0 : saveri.Height.ToPoints();

            gap -= saveri.Top.ToPoints();
            if (top < s_top + s_h)          // do we have an overlap;
            {
                gap = top - (s_top + s_h);  // yes; force overlap even when moving report item down
            }
            else
            {
                gap -= saveri.Height.ToPoints();  // no; move report item down just the gap between the items
            }
            return(gap);
        }
Esempio n. 2
0
        internal float WidthOrOwnerWidth(Report rpt)
        {
            if (_Width != null)
            {
                return(_Width.ToPoints());
            }
            float xloc = this.LeftCalc(rpt);

            for (ReportLink rl = this.Parent; rl != null; rl = rl.Parent)
            {
                if (rl is ReportItem)
                {
                    ReportItem ri = rl as ReportItem;
                    if (ri.Width != null)
                    {
                        return(ri.Width.ToPoints() - xloc);
                    }
                    continue;
                }
                if (rl is PageHeader ||
                    rl is PageFooter ||
                    rl is Body)
                {
                    return(OwnerReport.Width.ToPoints() - xloc);
                }
            }

            return(OwnerReport.Width.ToPoints() - xloc);
        }
        internal float EvalBottom(Report rpt, Row r)            // return points
        {
            if (_Bottom == null)
            {
                return(EvalDefault(rpt, r));
            }

            string sw = _Bottom.EvaluateString(rpt, r);
            RSize  rs = new RSize(this.OwnerReport, sw);

            return(rs.ToPoints());
        }
Esempio n. 4
0
        internal float LeftCalc(Report rpt)
        {
            WorkClass wc = GetWC(rpt);

            if (_TC != null || wc.MC != null || _Left == null)
            {
                return(0);
            }
            else
            {
                return(_Left.ToPoints());
            }
        }
Esempio n. 5
0
        //internal int PixelsY
        //{
        //    get
        //    {	// For now assume 96 dpi
        //        decimal p = _Size;
        //        p = p / PARTS_PER_INCH;		// get it in inches
        //        p = p * 96;				//
        //        if (p != 0)
        //            return (int)p;
        //        return (_Size > 0) ? 1 : (int)p;
        //    }
        //}

        internal float ToPoints()
        {
            return(RSize.ToPoints(_Size));
        }