internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            if (this._pageContextOfThisPage.FloatingElementList != null)
            {
                int num = 0;
                while (num < this._pageContextOfThisPage.FloatingElementList.Count && inputElement == null)
                {
                    BaseParaClient baseParaClient = this._pageContextOfThisPage.FloatingElementList[num];
                    inputElement = baseParaClient.InputHitTest(pt);
                    num++;
                }
            }
            if (inputElement == null)
            {
                PTS.FSSUBPAGEDETAILS fssubpagedetails;
                PTS.Validate(PTS.FsQuerySubpageDetails(base.PtsContext.Context, this._paraHandle.Value, out fssubpagedetails));
                if (base.Rect.Contains(pt))
                {
                    if (this.ContentRect.Contains(pt))
                    {
                        pt = new PTS.FSPOINT(pt.u - this.ContentRect.u, pt.v - this.ContentRect.v);
                        if (PTS.ToBoolean(fssubpagedetails.fSimple))
                        {
                            inputElement = PtsHelper.InputHitTestTrack(base.PtsContext, pt, ref fssubpagedetails.u.simple.trackdescr);
                        }
                        else if (fssubpagedetails.u.complex.cBasicColumns != 0)
                        {
                            PTS.FSTRACKDESCRIPTION[] array;
                            PtsHelper.TrackListFromSubpage(base.PtsContext, this._paraHandle.Value, ref fssubpagedetails, out array);
                            int num2 = 0;
                            while (num2 < array.Length && inputElement == null)
                            {
                                inputElement = PtsHelper.InputHitTestTrack(base.PtsContext, pt, ref array[num2]);
                                num2++;
                            }
                        }
                    }
                    if (inputElement == null)
                    {
                        inputElement = (base.Paragraph.Element as IInputElement);
                    }
                }
            }
            return(inputElement);
        }
Exemple #2
0
        // Token: 0x06006934 RID: 26932 RVA: 0x001DC7DC File Offset: 0x001DA9DC
        internal static IInputElement InputHitTestParaList(PtsContext ptsContext, PTS.FSPOINT pt, ref PTS.FSRECT rcTrack, PTS.FSPARADESCRIPTION[] arrayParaDesc)
        {
            IInputElement inputElement = null;
            int           num          = 0;

            while (num < arrayParaDesc.Length && inputElement == null)
            {
                BaseParaClient baseParaClient = ptsContext.HandleToObject(arrayParaDesc[num].pfsparaclient) as BaseParaClient;
                PTS.ValidateHandle(baseParaClient);
                if (baseParaClient.Rect.Contains(pt))
                {
                    inputElement = baseParaClient.InputHitTest(pt);
                }
                num++;
            }
            return(inputElement);
        }
        private IInputElement InputHitTestPage(PTS.FSPOINT pt)
        {
            IInputElement inputElement = null;

            if (this._pageContextOfThisPage.FloatingElementList != null)
            {
                int num = 0;
                while (num < this._pageContextOfThisPage.FloatingElementList.Count && inputElement == null)
                {
                    BaseParaClient baseParaClient = this._pageContextOfThisPage.FloatingElementList[num];
                    inputElement = baseParaClient.InputHitTest(pt);
                    num++;
                }
            }
            if (inputElement == null)
            {
                PTS.FSPAGEDETAILS fspagedetails;
                PTS.Validate(PTS.FsQueryPageDetails(this.PtsContext.Context, this._ptsPage.Value, out fspagedetails));
                if (PTS.ToBoolean(fspagedetails.fSimple))
                {
                    if (fspagedetails.u.simple.trackdescr.fsrc.Contains(pt))
                    {
                        inputElement = PtsHelper.InputHitTestTrack(this.PtsContext, pt, ref fspagedetails.u.simple.trackdescr);
                    }
                }
                else
                {
                    ErrorHandler.Assert(fspagedetails.u.complex.cFootnoteColumns == 0, ErrorHandler.NotSupportedFootnotes);
                    if (fspagedetails.u.complex.cSections != 0)
                    {
                        PTS.FSSECTIONDESCRIPTION[] array;
                        PtsHelper.SectionListFromPage(this.PtsContext, this._ptsPage.Value, ref fspagedetails, out array);
                        int num2 = 0;
                        while (num2 < array.Length && inputElement == null)
                        {
                            if (array[num2].fsrc.Contains(pt))
                            {
                                inputElement = this.InputHitTestSection(pt, ref array[num2]);
                            }
                            num2++;
                        }
                    }
                }
            }
            return(inputElement);
        }
Exemple #4
0
        // ------------------------------------------------------------------
        // Hit tests to the correct IInputElement within the list of
        // paragraphs that the mouse is over.
        // ------------------------------------------------------------------
        internal static IInputElement InputHitTestParaList(
            PtsContext ptsContext,
            PTS.FSPOINT pt,
            ref PTS.FSRECT rcTrack,                     // track's rectangle
            PTS.FSPARADESCRIPTION [] arrayParaDesc)
        {
            IInputElement ie = null;

            for (int index = 0; index < arrayParaDesc.Length && ie == null; index++)
            {
                BaseParaClient paraClient = ptsContext.HandleToObject(arrayParaDesc[index].pfsparaclient) as BaseParaClient;
                PTS.ValidateHandle(paraClient);

                if (paraClient.Rect.Contains(pt))
                {
                    ie = paraClient.InputHitTest(pt);
                }
            }
            return(ie);
        }
        internal override IInputElement InputHitTest(PTS.FSPOINT pt)
        {
            IInputElement ie = null;


            if (_pageContextOfThisPage.FloatingElementList != null)
            {
                for (int index = 0; index < _pageContextOfThisPage.FloatingElementList.Count && ie == null; index++)
                {
                    BaseParaClient floatingElement = _pageContextOfThisPage.FloatingElementList[index];

                    ie = floatingElement.InputHitTest(pt);
                }
            }

            if (ie == null)
            {
                // Query subpage details
                PTS.FSSUBPAGEDETAILS subpageDetails;
                PTS.Validate(PTS.FsQuerySubpageDetails(PtsContext.Context, _paraHandle.Value, out subpageDetails));

                if (Rect.Contains(pt))
                {
                    if (ContentRect.Contains(pt))
                    {
                        pt = new PTS.FSPOINT(pt.u - ContentRect.u, pt.v - ContentRect.v);

                        // Hittest subpage content. Subpage content may be simple or complex -
                        // depending of set of features used in the content of the page.
                        // (1) simple subpage (contains only one track)
                        // (2) complex subpage (contains columns)
                        if (PTS.ToBoolean(subpageDetails.fSimple))
                        {
                            ie = PtsHelper.InputHitTestTrack(PtsContext, pt, ref subpageDetails.u.simple.trackdescr);
                        }
                        else
                        {
                            // (2) complex page (contains columns)
                            // cBasicColumns == 0, means that subpage content is empty
                            if (subpageDetails.u.complex.cBasicColumns != 0)
                            {
                                // Retrieve description for each column.
                                PTS.FSTRACKDESCRIPTION[] arrayColumnDesc;
                                PtsHelper.TrackListFromSubpage(PtsContext, _paraHandle.Value, ref subpageDetails, out arrayColumnDesc);

                                // Arrange each track
                                for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++)
                                {
                                    ie = PtsHelper.InputHitTestTrack(PtsContext, pt, ref arrayColumnDesc[index]);
                                }
                            }
                        }
                    }

                    if (ie == null)
                    {
                        ie = Paragraph.Element as IInputElement;
                    }
                }
            }

            return(ie);
        }