Пример #1
0
        public int ComputeSelfLayout()
        {
            int ret;

            if (ScMgr == null ||
                parent == null ||
                parent.globalMatrix == null ||
                ScMgr.GetRootLayer() == null)
            {
                return(-1);
            }

            ReleaseSelfTransformInfo();

            ret = _ComputeSelfLayout();

            return(ret);
        }
Пример #2
0
        public ScSharpTabHead()
        {
            InitializeComponent();

            #region 防止打开闪烁
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲
            #endregion

            this.Dock = DockStyle.Fill;

            scMgr = new ScMgr(Width, Height);
            scMgr.BackgroundColor = Color.FromArgb(255, 246, 247, 251);
            Controls.Add(scMgr.control);

            root               = scMgr.GetRootLayer();
            scTabHead          = new ScTabHead(scMgr, root.Width, root.Height);
            scTabHead.Location = new Point(0, 0);
            scTabHead.Dock     = ScDockStyle.Fill;
            root.Add(scTabHead);
        }
Пример #3
0
        public ScTabSharp(int w, int h, int itemWidth = 112, int upOrBottom = 0, bool hideTabHeight = false)
        {
            InitializeComponent();

            Width  = w;
            Height = h;

            #region 防止打开闪烁
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲
            #endregion

            scMgr = new ScMgr(Width, Height);
            scMgr.BackgroundColor = Color.FromArgb(255, 233, 233, 233);
            Controls.Add(scMgr.control);

            root = scMgr.GetRootLayer();

            //
            scTab                    = new ScTab(scMgr, root.Width, root.Height, itemWidth, upOrBottom, hideTabHeight);
            scTab.Location           = new Point(0, 0);
            scTab.SelectedItemEvent += ScTab_SelectedItemEvent;

            root.Add(scTab);



            //
            titleInfoLayer          = new ScLayer();
            titleInfoLayer.Width    = 60;
            titleInfoLayer.Height   = 25;
            titleInfoLayer.Location = new PointF(Width - 60, 0);
            root.Add(titleInfoLayer);

            titleInfoLayer.GDIPaint += TitleInfoLayer_GDIPaint;
        }
Пример #4
0
        private void ScVxViewScreen_SizeChanged(object sender, SizeF oldSize)
        {
            RectangleF tableRect   = new RectangleF(20, 40, Width - 40, Height - 80);
            Table      screentable = new Table(tableRect, rowItemAmount, 1);
            ScLayer    rowLayer;
            RectangleF rowRect;

            controls.Clear();

            for (int i = 0; i < rowItemAmount; i++)
            {
                rowLayer = new ScLayer();
                rowLayer.DirectParentClipLayer = ScMgr.GetRootLayer();
                rowRect = screentable.GetCellContentRect(i, 0);

                rowLayer.Location = new PointF((int)rowRect.X, (int)rowRect.Y);
                rowLayer.Width    = (int)rowRect.Width;
                rowLayer.Height   = (int)rowRect.Height;

                Add(rowLayer);
            }

            animPos = controls[0].Location.X;
        }