Esempio n. 1
0
        //============================================================
        // <T>测试处理。</T>
        //
        // @param args 参数
        //============================================================
        public virtual void Test(SUiTestArgs args)
        {
            // 检查有效性
            if (!ComponentResource.OptionValid)
            {
                return;
            }
            // 开始测试
            bool result = OnTest(args);

            // 子控件测试
            if (result)
            {
                if (_components != null)
                {
                    foreach (FUiComponent componment in _components)
                    {
                        FUiControl control = componment as FUiControl;
                        if (control != null)
                        {
                            control.Test(args);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        //============================================================
        // <T>结束绘制处理。</T>
        //
        // @param args 参数
        //============================================================
        public virtual bool OnTest(SUiTestArgs args)
        {
            float      scale    = _context.Scale;
            SIntPoint2 position = CalculateDisplayPosition();
            bool       test     = RRectangle.ConstainsPoint(position.X, position.Y, (int)(ControlResource.Size.Width * scale), (int)(ControlResource.Size.Height * scale), args.Point.X, args.Point.Y);

            if (test)
            {
                args.Push(this);
            }
            return(test);
        }
Esempio n. 3
0
        //============================================================
        // <T>测试处理。</T>
        //
        // @param args 参数
        //============================================================
        public override void Test(SUiTestArgs args)
        {
            // 检查有效性
            if (!ComponentResource.OptionValid)
            {
                return;
            }
            // 开始测试
            bool result = OnTest(args);

            // 子控件测试
            if (result)
            {
                FUiScrollItem item = ActiveItem();
                if (item != null)
                {
                    // 测试分页
                    item.Test(args);
                    // 绘制节点
                    if (_components != null)
                    {
                        foreach (FUiComponent componment in _components)
                        {
                            FUiControl control = componment as FUiControl;
                            if (control == null)
                            {
                                continue;
                            }
                            //if (control is FUiBaseListItem) {
                            //   continue;
                            //}
                            control.Test(args);
                        }
                    }
                }
            }
        }