static void RootInvalidateGraphicArea(RenderElement re, ref Rectangle rect)
 {
     //1.
     re.propFlags &= ~RenderElementConst.IS_GRAPHIC_VALID;
     //2.  
     re.rootGfx.InvalidateGraphicArea(re, ref rect);
 }
 public static void InvalidateGraphicLocalArea(RenderElement re, Rectangle localArea)
 {
     if (localArea.Height == 0 || localArea.Width == 0)
     {
         return;
     }
     RootInvalidateGraphicArea(re, ref localArea);
 }
 public void WriteInfo(string info, RenderElement ve)
 {
     ++msgCounter;
     ShouldBreak();
     strmWriter.Write(new string('\t', indentCount));
     strmWriter.Write(info);
     strmWriter.Write(ve.dbug_FullElementDescription());
     strmWriter.Write("\r\n"); strmWriter.Flush();
 }
 public void WriteInfo(RenderElement v, string info, string indentPrefix, string indentPostfix)
 {
     ++msgLineNum;
     ShouldBreak();
     strmWriter.Write(new string('\t', indentCount));
     strmWriter.Write(indentPrefix + indentCount + indentPostfix + info + " ");
     strmWriter.Write(v.dbug_FullElementDescription());
     strmWriter.Write("\r\n"); strmWriter.Flush();
 }
Пример #5
0
 public dbugLayoutMsg(RenderElement ve, string msg)
 {
     this.owner = ve;
     this.msg = msg;
     if (ve == null)
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.Unknown;
     }
     else
     {
         this.msgOwnerKind = dbugLayoutMsgOwnerKind.VisualElement;
     }
 }
 RenderElement IParentLink.FindOverlapedChildElementAtPoint(RenderElement afterThisChild, Point point)
 {
     //called from child node
     if (this._MayHasOverlapChild())
     {
         var child_internalLinkedNode = afterThisChild.internalLinkedNode;
         if (child_internalLinkedNode == null)
         {
             return null;
         }
         var curnode = child_internalLinkedNode.Previous;
         while (curnode != null)
         {
             var element = curnode.Value;
             if (element.Contains(point))
             {
                 return element;
             }
             curnode = curnode.Previous;
         }
     }
     return null;
 }
Пример #7
0
 public override void InsertAfter(RenderElement afterElem, RenderElement renderE)
 {
     _defaultLayer.InsertChildAfter(afterElem, renderE);
 }
Пример #8
0
 public virtual void AddChild(RenderElement renderE)
 {
 }
Пример #9
0
 public abstract void AddToLayoutQueue(RenderElement renderElement);
Пример #10
0
 public void Add(RenderElement ve, string msg)
 {
     this.Add(new dbugLayoutMsg(ve, msg));
 }
Пример #11
0
 void dbugWriteStopGfxBubbleUp(RenderElement fromElement, ref int dbug_ncount, int nleftOnStack, string state_str)
 {
     RootGraphic dbugMyroot = this;
     if (dbugMyroot.dbugEnableGraphicInvalidateTrace && dbugMyroot.dbugGraphicInvalidateTracer != null)
     {
         if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
         {
             state_str = "!!" + state_str;
         }
         dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo(state_str, fromElement);
         while (dbug_ncount > nleftOnStack)
         {
             dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
             dbug_ncount--;
         }
     }
 }
Пример #12
0
        public void dbug_AddDrawElement(RenderElement visualElement, Canvas currentCanvas, string additionalMsg)
        {
            StringBuilder stBuilder = new StringBuilder();
            stBuilder.Append(new string('.', dbug_drawLevel));
            stBuilder.Append("[" + dbug_drawLevel + "] c_" + currentCanvas.debug_canvas_id + " ");
            stBuilder.Append(visualElement.dbug_FullElementDescription());
            Rectangle r = visualElement.dbugGetGlobalRect();
            stBuilder.Append(" global(" + r.X + "," + r.Y + "," + r.Width + "," + r.Height + ")");
            Rectangle currentClipRect = currentCanvas.CurrentClipRect;
            stBuilder.Append(" clip(" + currentClipRect.X +
                "," + currentClipRect.Y + "," + currentClipRect.Width + "," + currentClipRect.Height + ") ");
            if (visualElement.dbugParentVisualElement != null)
            {
                stBuilder.Append(" of " + visualElement.dbugParentVisualElement.dbug_FullElementDescription());
            }

            dbug_rootDrawingMsg.AddLast(new dbugLayoutMsg(visualElement, stBuilder.ToString()));
            if (additionalMsg != null)
            {
                stBuilder.Length = 0; stBuilder.Append(new string('.', dbug_drawLevel));
                stBuilder.Append("[" + dbug_drawLevel + "] c:" + currentCanvas.debug_canvas_id + " ");
                stBuilder.Append(visualElement.dbug_FullElementDescription());
                dbug_rootDrawingMsg.AddLast(new dbugLayoutMsg(visualElement, stBuilder.ToString()));
            }
        }
Пример #13
0
 public static void dbug_EnterReArrangeContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.PushVisualElement(v);
     debugVisualLay.WriteInfo(v, "ARR_INNER", ">>", "&");
 }
Пример #14
0
 public override void RemoveChild(RenderElement renderE)
 {
     if (this.defaultLayer != null)
     {
         this.defaultLayer.RemoveChild(renderE);
     }
 }
Пример #15
0
 public override void AddChild(RenderElement renderE)
 {
     if (this.defaultLayer == null)
     {
         this.defaultLayer = new PlainLayer(this);
     }
     this.defaultLayer.AddChild(renderE);
 }
Пример #16
0
 public void dbug_AddDrawElement(RenderElement visualElement, DrawBoard currentCanvas)
 {
     dbug_AddDrawElement(visualElement, currentCanvas, null);
 }
Пример #17
0
 public void AddContent(RenderElement renderElement)
 {
     this.vw.AddContent(renderElement);
 }
Пример #18
0
 public override void RemoveChild(RenderElement renderE)
 {
     _defaultLayer?.RemoveChild(renderE);
 }
Пример #19
0
 public override void InsertBefore(RenderElement beforeElem, RenderElement renderE)
 {
     _defaultLayer.InsertChildBefore(beforeElem, renderE);
 }
Пример #20
0
 public void PushVisualElement(RenderElement v)
 {
     elementStack.Push(v);
     BeginNewContext();
 }
Пример #21
0
 public static void dbug_ExitTopDownReCalculateContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.WriteInfo(v, "<<TOPDOWN_RECAL_CONTENT ", "-", "&");
     debugVisualLay.PopVisualElement();
 }
Пример #22
0
 public virtual void RemoveChild(RenderElement renderE)
 {
 }
Пример #23
0
 protected static void debug_PopTopDownElement(RenderElement ve)
 {
 }
Пример #24
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect, bool passSourceElem = false)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase)
            {
                return;
            }
            //--------------------------------------
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;


            _hasRenderTreeInvalidateAccumRect = true;//***

            Point globalPoint = new Point();

#if DEBUG
            //if (fromElement.dbug_ObjectNote == "panel")
            //{

            //}

            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);

                if (fromElement.MayHasViewport && passSourceElem)
                {
                    elemClientRect.Offset(globalPoint);
                    //****
#if DEBUG
                    //TODO: review here
                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }
#endif
                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportLeft, fromElement.ViewportTop);
                    if (fromElement.NeedClipArea)
                    {
                        elemClientRect.Intersect(elementRect);
                    }

                    globalPoint.X = -fromElement.ViewportLeft; //reset ?
                    globalPoint.Y = -fromElement.ViewportTop;  //reset ?
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif
                    IParentLink parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                passSourceElem = true;
            } while (true);
#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------

            elemClientRect.Offset(globalPoint);
            if (elemClientRect.Top > this.Height ||
                elemClientRect.Left > this.Width ||
                elemClientRect.Bottom < 0 ||
                elemClientRect.Right < 0)
            {
                //no intersect with

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!_hasAccumRect)
            {
                _accumulateInvalidRect = elemClientRect;
                _hasAccumRect          = true;
            }
            else
            {
                _accumulateInvalidRect = Rectangle.Union(_accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + _accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif
        }
Пример #25
0
 public void dbug_PushLayoutTraceMessage(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (dbugLastestDebugVisualLay != null)
     {
         dbugLastestDebugVisualLay.WriteInfo(msg.msg, ve);
     }
 }
Пример #26
0
 public abstract void SetCurrentKeyboardFocus(RenderElement renderElement);
Пример #27
0
 public abstract void AddToLayoutQueue(RenderElement renderElement);
Пример #28
0
 public virtual void RemoveChild(RenderElement renderE)
 {
 }
Пример #29
0
 public virtual void InsertAfter(RenderElement afterElem, RenderElement renderE)
 {
     _elements.InsertChildAfter(this, afterElem, renderE);
 }
Пример #30
0
 public virtual void RemoveChild(RenderElement renderE)
 {
     _elements?.RemoveChild(this, renderE);
 }
 static Point GetGlobalLocationStatic(RenderElement re)
 {
     RenderElement parentVisualElement = re.ParentRenderElement;
     if (parentVisualElement != null)
     {
         Point parentGlobalLocation = GetGlobalLocationStatic(parentVisualElement);
         re.parentLink.AdjustLocation(ref parentGlobalLocation);
         if (parentVisualElement.MayHasViewport)
         {
             return new Point(
                 re.b_left + parentGlobalLocation.X - parentVisualElement.ViewportX,
                 re.b_top + parentGlobalLocation.Y - parentVisualElement.ViewportY);
         }
         else
         {
             return new Point(re.b_left + parentGlobalLocation.X, re.b_top + parentGlobalLocation.Y);
         }
     }
     else
     {
         return re.Location;
     }
 }
Пример #32
0
 //
 public override void AddChild(RenderElement renderElement)
 {
     _vw.AddChild(renderElement);
 }
Пример #33
0
 public static void RemoveParentLink(RenderElement childElement)
 {
     childElement.parentLink = null;
 }
Пример #34
0
 public void AddChild(RenderElement renderE)
 {
 }
Пример #35
0
 public virtual void InsertBefore(RenderElement beforeElem, RenderElement renderE)
 {
     _elements.InsertChildBefore(this, beforeElem, renderE);
 }
Пример #36
0
        //==============================================================
        //set location and size , not bubble***

        public static void DirectSetSize(RenderElement visualElement, int width, int height)
        {
            visualElement.b_width  = width;
            visualElement.b_height = height;
        }
Пример #37
0
        public static void DrawChildContent(HitTestHint hitTestHint, IEnumerable <RenderElement> drawingIter, DrawBoard d, UpdateArea updateArea)
        {
            int enter_canvas_x = d.OriginX;
            int enter_canvas_y = d.OriginY;

            switch (hitTestHint)
            {
            default:
            {
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea) ||
                        !child.NeedClipArea)
                    {
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                }

                //restore
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;

            case HitTestHint.HorizontalRowNonOverlap:
            {
                bool found = false;
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea))
                    {
                        found = true;
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                    else if (found)
                    {
                        break;
                    }
                }

                //restore
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;

            case HitTestHint.VerticalColumnNonOverlap:
            {
                bool found = false;
                foreach (RenderElement child in drawingIter)
                {
                    if (child.IntersectsWith(updateArea))
                    {
                        found = true;
                        //if the child not need clip
                        //its children (if exist) may intersect
                        int x = child.X;
                        int y = child.Y;

                        d.SetCanvasOrigin(enter_canvas_x + x, enter_canvas_y + y);
                        updateArea.Offset(-x, -y);
                        RenderElement.Render(child, d, updateArea);
                        updateArea.Offset(x, y);
                    }
                    else if (found)
                    {
                        break;
                    }
                }
                d.SetCanvasOrigin(enter_canvas_x, enter_canvas_y);
            }
            break;
            }
        }
Пример #38
0
 public static void DirectSetLocation(RenderElement visualElement, int x, int y)
 {
     visualElement.b_left = x;
     visualElement.b_top  = y;
 }
Пример #39
0
 public override void AddChild(RenderElement renderElement, object owner)
 {
     _vw.AddChild(renderElement, owner);
 }
Пример #40
0
 public virtual void AddChild(RenderElement renderE)
 {
 }
Пример #41
0
 //-------------------------------------------------------------------------
 protected static void dbug_EnterTopDownReCalculateContent(RenderElement v)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     debugVisualLay.PushVisualElement(v);
     debugVisualLay.WriteInfo(v, ">>TOPDOWN_RECAL_CONTENT ", "-", "&");
 }
Пример #42
0
 public void Add(RenderElement ve, string msg)
 {
     this.Add(new dbugLayoutMsg(ve, msg));
 }
Пример #43
0
 public static void dbug_SetInitObject(RenderElement ve)
 {
     dbugInitObject = ve;
 }
Пример #44
0
 //
 public abstract void AddChild(RenderElement renderElement);
Пример #45
0
 public static void dbug_ExitReArrangeContent(RenderElement ve)
 {
     var debugVisualLay = dbugGetLayoutTracer();
     if (debugVisualLay == null) return;
     RenderElement v = (RenderElement)debugVisualLay.PeekElement();
     debugVisualLay.WriteInfo(v, "ARR_INNER", "<<", "&");
     debugVisualLay.PopVisualElement();
 }
Пример #46
0
 public abstract void AddChild(RenderElement renderElement, object owner);
Пример #47
0
 public void dbug_AddDrawElement(RenderElement visualElement, Canvas currentCanvas)
 {
     dbug_AddDrawElement(visualElement, currentCanvas, null);
 }
Пример #48
0
        //-------


        public TopWindowEventRoot(RenderElement topRenderElement)
        {
            this.iTopBoxEventPortal  = this.topWinBoxEventPortal = new RenderElementEventPortal(topRenderElement);
            this.rootgfx             = topRenderElement.Root;
            this.hoverMonitoringTask = new UIHoverMonitorTask(OnMouseHover);
        }
Пример #49
0
 public void dbug_PushInvalidateMsg(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (this.dbugEnableGraphicInvalidateTrace && dbugGraphicInvalidateTracer != null)
     {
         dbugGraphicInvalidateTracer.WriteInfo(msg.msg, ve);
     }
 }
Пример #50
0
 public static void AddChild(this RenderElement renderBox, UIElement ui)
 {
     renderBox.AddChild(ui.GetPrimaryRenderElement(renderBox.Root));
 }
Пример #51
0
 public void dbug_LayoutTraceEndContext(dbugVisualRootMsg msg, RenderElement ve)
 {
     if (dbugLastestDebugVisualLay != null)
     {
         dbugLastestDebugVisualLay.WriteInfo(msg.msg, ve);
         dbugLastestDebugVisualLay.EndCurrentContext();
     }
 }
 public void PushVisualElement(RenderElement v)
 {
     elementStack.Push(v);
     BeginNewContext();
 }
Пример #53
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase) { return; }
            //--------------------------------------            
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;
            Point globalPoint = new Point();
            bool isBubbleUp = false;
#if DEBUG
            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
                //--------------------------------------------------------------------- 


#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);
                //globalX += fromElement.BubbleUpX;
                //globalY += fromElement.BubbleUpY;


                if (fromElement.MayHasViewport && isBubbleUp)
                {
                    //elemClientRect.Offset(globalX, globalY);
                    elemClientRect.Offset(globalPoint);
                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }

                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportX, fromElement.ViewportY);
                    elemClientRect.Intersect(elementRect);
                    globalPoint.X = -fromElement.ViewportX;
                    globalPoint.Y = -fromElement.ViewportY;
                    //globalX = -fromElement.ViewportX;
                    //globalY = -fromElement.ViewportY;
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif

                    var parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;// fromElement.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                isBubbleUp = true;
            } while (true);
#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace
             && dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------
            //elemClientRect.Offset(globalX, globalY);
            elemClientRect.Offset(globalPoint);
            if (elemClientRect.Top > this.Height
                || elemClientRect.Left > this.Width
                || elemClientRect.Bottom < 0
                || elemClientRect.Right < 0)
            {
                //no intersect with  

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!hasAccumRect)
            {
                accumulateInvalidRect = elemClientRect;
                hasAccumRect = true;
            }
            else
            {
                accumulateInvalidRect = Rectangle.Union(accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif

        }
Пример #54
0
 public void AddContent(RenderElement renderElement)
 {
     this.vw.AddContent(renderElement);
 }
Пример #55
0
 public abstract void SetCurrentKeyboardFocus(RenderElement renderElement);
Пример #56
0
 //
 protected static void DirectSetRootGraphics(RenderElement r, RootGraphic rootgfx)
 {
     r._rootGfx = rootgfx;
 }
Пример #57
0
 public static void dbug_SetInitObject(RenderElement ve)
 {
     dbugInitObject = ve;
 }
Пример #58
0
 protected static void debug_PopTopDownElement(RenderElement ve)
 {
 }
Пример #59
0
        //-------


        public TopWindowEventRoot(RenderElement topRenderElement)
        {
            this.iTopBoxEventPortal = this.topWinBoxEventPortal = new RenderElementEventPortal(topRenderElement);
            this.rootgfx = topRenderElement.Root;
            this.hoverMonitoringTask = new UIHoverMonitorTask(OnMouseHover);
        }
Пример #60
0
        public void InvalidateGraphicArea(RenderElement fromElement, ref Rectangle elemClientRect)
        {
            //total bounds = total bounds at level

            if (this.IsInRenderPhase)
            {
                return;
            }
            //--------------------------------------
            //bubble up ,find global rect coord
            //and then merge to accumulate rect
            //int globalX = 0;
            //int globalY = 0;
            Point globalPoint = new Point();

            bool isBubbleUp = false;

#if DEBUG
            int dbug_ncount = 0;
            dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> :" + elemClientRect.ToString());
#endif
            do
            {
                if (!fromElement.Visible)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "EARLY-RET: ");
#endif
                    return;
                }
                else if (fromElement.BlockGraphicUpdateBubble)
                {
#if DEBUG
                    dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED2: ");
#endif
                    return;
                }
                //---------------------------------------------------------------------


#if DEBUG
                dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, dbug_ncount, ">> ");
#endif

                globalPoint.Offset(fromElement.X, fromElement.Y);
                //globalX += fromElement.BubbleUpX;
                //globalY += fromElement.BubbleUpY;


                if (fromElement.MayHasViewport && isBubbleUp)
                {
                    //elemClientRect.Offset(globalX, globalY);
                    elemClientRect.Offset(globalPoint);

                    if (fromElement.HasDoubleScrollableSurface)
                    {
                        //container.VisualScrollableSurface.WindowRootNotifyInvalidArea(elementClientRect);
                    }

                    Rectangle elementRect = fromElement.RectBounds;
                    elementRect.Offset(fromElement.ViewportX, fromElement.ViewportY);
                    elemClientRect.Intersect(elementRect);

                    globalPoint.X = -fromElement.ViewportX;
                    globalPoint.Y = -fromElement.ViewportY;

                    //globalX = -fromElement.ViewportX;
                    //globalY = -fromElement.ViewportY;
                }

                if (fromElement.IsTopWindow)
                {
                    break;
                }
                else
                {
#if DEBUG
                    if (fromElement.dbugParentVisualElement == null)
                    {
                        dbugWriteStopGfxBubbleUp(fromElement, ref dbug_ncount, 0, "BLOCKED3: ");
                    }
#endif

                    var parentLink = fromElement.MyParentLink;
                    if (parentLink == null)
                    {
                        return;
                    }
                    parentLink.AdjustLocation(ref globalPoint);
                    //move up
                    fromElement = parentLink.ParentRenderElement;// fromElement.ParentRenderElement;
                    if (fromElement == null)
                    {
                        return;
                    }
                }

                isBubbleUp = true;
            } while (true);

#if DEBUG
            var dbugMyroot = this;
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                while (dbug_ncount > 0)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.PopElement();
                    dbug_ncount--;
                }
            }
#endif

            //----------------------------------------
            //elemClientRect.Offset(globalX, globalY);
            elemClientRect.Offset(globalPoint);

            if (elemClientRect.Top > this.Height ||
                elemClientRect.Left > this.Width ||
                elemClientRect.Bottom < 0 ||
                elemClientRect.Right < 0)
            {
                //no intersect with

#if DEBUG
                if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                    dbugMyroot.dbugGraphicInvalidateTracer != null)
                {
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ZERO-EEX");
                    dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
                }
#endif
                return;
            }
            //--------------------------------------------------------------------------------------------------
            if (!hasAccumRect)
            {
                accumulateInvalidRect = elemClientRect;
                hasAccumRect          = true;
            }
            else
            {
                accumulateInvalidRect = Rectangle.Union(accumulateInvalidRect, elemClientRect);
            }

#if DEBUG
            if (dbugMyroot.dbugEnableGraphicInvalidateTrace &&
                dbugMyroot.dbugGraphicInvalidateTracer != null)
            {
                string state_str = "ACC: ";
                if (this.dbugNeedContentArrangement || this.dbugNeedReCalculateContentSize)
                {
                    state_str = "!!" + state_str;
                }
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("ACC: " + accumulateInvalidRect.ToString());
                dbugMyroot.dbugGraphicInvalidateTracer.WriteInfo("\r\n");
            }
#endif
        }