Ejemplo n.º 1
0
 public void setOwner(ContainerUI owner)
 {
     mOwner = owner;
 }
Ejemplo n.º 2
0
        public override void invalidate()
        {
            if (!isVisible())
            {
                return;
            }

            if (getParent() != null)
            {
                ContainerUI pParentContainer = (ContainerUI)getParent().getInterface("Container");
                if (pParentContainer != null)
                {
                    Rectangle rc      = pParentContainer.getPos();
                    Rectangle rcInset = pParentContainer.getInset();

                    int newLeft   = rc.Left + rcInset.Left;
                    int newRight  = rc.Right - rcInset.Right;
                    int newTop    = rc.Top + rcInset.Top;
                    int newBottom = rc.Bottom - rcInset.Bottom;
                    rc.X      = newLeft;
                    rc.Width  = newRight - newLeft;
                    rc.Y      = newTop;
                    rc.Height = newBottom - newTop;

                    ScrollbarUI pVerticalScrollbar = pParentContainer.getVerticalScrollbar();
                    if (pVerticalScrollbar != null && pVerticalScrollbar.isVisible())
                    {
                        rc.Width = rc.Right - pVerticalScrollbar.getFixedWidth() - rc.Left;
                    }
                    ScrollbarUI pHorizontalScrollbar = pParentContainer.getHorizontalScrollbar();
                    if (pHorizontalScrollbar != null && pHorizontalScrollbar.isVisible())
                    {
                        rc.Height = rc.Bottom - pHorizontalScrollbar.getFixedHeight() - rc.Top;
                    }

                    Rectangle invalidateRc = mRectItem;
                    if (!invalidateRc.IntersectsWith(mRectItem))
                    {
                        return;
                    }
                    invalidateRc.Intersect(mRectItem);

                    ControlUI pParent = getParent();
                    Rectangle rcTemp;
                    Rectangle rcParent;
                    while ((pParent = pParent.getParent()) != null)
                    {
                        rcTemp   = invalidateRc;
                        rcParent = pParent.getPos();
                        if (!rcTemp.IntersectsWith(rcParent))
                        {
                            return;
                        }
                        invalidateRc.Intersect(rcParent);
                    }

                    if (mManager != null)
                    {
                        mManager.invalidate(ref invalidateRc);
                    }
                }
                else
                {
                    base.invalidate();
                }
            }
            else
            {
                base.invalidate();
            }
        }
Ejemplo n.º 3
0
        public static ControlUI getControl(string typeName)
        {
            ControlUI newControl = null;
            int       len        = typeName.Length;

            switch (len)
            {
            case 4:
            {
                if (typeName == "Edit")
                {
                    newControl = new EditUI();
                }
                else if (typeName == "List")
                {
                    newControl = new ListUI();
                }
                else if (typeName == "Text")
                {
                    newControl = new TextUI();
                }

                break;
            }

            case 5:
            {
                if (typeName == "Combo")
                {
                    newControl = new ComboUI();
                }
                else if (typeName == "Label")
                {
                    newControl = new LabelUI();
                }
                break;
            }

            case 6:
            {
                if (typeName == "Button")
                {
                    newControl = new ButtonUI();
                }
                else if (typeName == "Option")
                {
                    newControl = new OptionUI();
                }
                else if (typeName == "Slider")
                {
                    newControl = new SliderUI();
                }

                break;
            }

            case 7:
            {
                if (typeName == "Control")
                {
                    newControl = new ControlUI();
                }
                else if (typeName == "ActiveX")
                {
                    newControl = new ActiveXUI();
                }
                break;
            }

            case 8:
            {
                if (typeName == "Progress")
                {
                    newControl = new ProgressUI();
                }
                break;
            }

            case 9:
            {
                if (typeName == "Container")
                {
                    newControl = new ContainerUI();
                }
                else if (typeName == "TabLayout")
                {
                    newControl = new TabLayoutUI();
                }

                break;
            }

            case 10:
            {
                if (typeName == "ListHeader")
                {
                    newControl = new ListHeaderUI();
                }
                else if (typeName == "TileLayout")
                {
                    newControl = new TileLayoutUI();
                }

                break;
            }

            case 12:
            {
                if (typeName == "DialogLayout")
                {
                    newControl = new DialogLayoutUI();
                }
                break;
            }

            case 14:
            {
                if (typeName == "VerticalLayout")
                {
                    newControl = new VerticalLayoutUI();
                }
                else if (typeName == "ListHeaderItem")
                {
                    newControl = new ListHeaderItemUI();
                }

                break;
            }

            case 15:
            {
                if (typeName == "ListTextElement")
                {
                    newControl = new ListTextElementUI();
                }
                break;
            }

            case 16:
            {
                if (typeName == "HorizontalLayout")
                {
                    newControl = new HorizontalLayoutUI();
                }
                else if (typeName == "ListLabelElement")
                {
                    newControl = new ListLabelElementUI();
                }

                break;
            }

            case 17:
            {
                if (typeName == "ListExpandElement")
                {
                    newControl = new ListExpandElementUI();
                }
                break;
            }

            case 20:
            {
                if (typeName == "ListContainerElement")
                {
                    newControl = new ListContainerElementUI();
                }
                break;
            }
            }

            return(newControl);
        }