Esempio n. 1
0
        private void Btn_MouseEnter(object sender, ScMouseEventArgs e)
        {
            if (tips == null)
            {
                return;
            }

            int i = 0;

            foreach (ScLayer layer in controls)
            {
                i++;
                if (layer == sender)
                {
                    break;
                }
            }

            ScLayer    layerx = (ScLayer)sender;
            RectangleF rect   = layerx.DrawBox;

            float x = rect.X + rect.Width / 2 - tips.Width / 2;
            float y = rect.Y - tips.Height;

            tips.Location = new PointF(x, y);


            int leftPageAmount = (int)Math.Round(-wrapper.Location.X / (itemWidth + itemSpace));
            int downPageIdx    = leftPageAmount + i;

            tips.txt = downPageIdx.ToString();

            tips.Visible = true;
            tips.Refresh();
        }
Esempio n. 2
0
        public ScWarningInfoBox()
        {
            titleBtn  = new ScLayer();
            closedBtn = new ScLayer();
            infoLayer = new ScLayer();
            okBtn     = new ScLayer();

            Add(titleBtn);
            Add(closedBtn);
            Add(infoLayer);
            Add(okBtn);

            titleBtn.GDIPaint += TitleBtn_GDIPaint;

            closedBtn.MouseEnter += ClosedBtn_MouseEnter;
            closedBtn.MouseLeave += ClosedBtn_MouseLeave;
            closedBtn.GDIPaint   += ClosedBtn_GDIPaint;
            closedBtn.MouseDown  += ClosedBtn_MouseDown;

            infoLayer.GDIPaint += InfoLayer_GDIPaint;

            okBtn.MouseEnter += OkBtn_MouseEnter;
            okBtn.MouseLeave += OkBtn_MouseLeave;
            okBtn.GDIPaint   += OkBtn_GDIPaint;
            okBtn.MouseDown  += OkBtn_MouseDown;

            SizeChanged += ScWarningInfoBox_SizeChanged;
        }
Esempio n. 3
0
        public ScVxSlider(ScLayer contentLayer)
        {
            this.contentLayer     = contentLayer;
            contentLayer.Location = new PointF(0, 0);

            Add(contentLayer);

            leftShadowLayer  = new ScLayer();
            rightShadowLayer = new ScLayer();

            topShadowLayer    = new ScLayer();
            bottomShadowLayer = new ScLayer();

            leftShadowLayer.GDIPaint   += LeftShadowLayer_GDIPaint;
            rightShadowLayer.GDIPaint  += RightShadowLayer_GDIPaint;
            topShadowLayer.GDIPaint    += TopShadowLayer_GDIPaint;
            bottomShadowLayer.GDIPaint += BottomShadowLayer_GDIPaint;

            Add(leftShadowLayer);
            Add(rightShadowLayer);

            Add(topShadowLayer);
            Add(bottomShadowLayer);

            MouseMove += Slider_MouseMove;
            MouseDown += Slider_MouseDown;
        }
Esempio n. 4
0
File: ScTab.cs Progetto: lypvc/Sc
        public ScTab(ScMgr scMgr)
            : base(scMgr)
        {
            IsUseDebugPanitCode          = true;
            scTabHead                    = new ScTabHeader(ScMgr);
            scTabHead.SelectedItemEvent += ScTabHead_SelectedItemEvent;

            scTabHead.IsUseDebugPanitCode = true;

            tabHeadBox = new ScLayer(scMgr);
            tabHeadBox.Add(scTabHead);
            Add(tabHeadBox);



            tabBodyBox = new ScLayer(scMgr);
            Add(tabBodyBox);

            tabBodyBox.D2DPaint += TabBodyBox_D2DPaint;

            tabBodyBox.MouseEnter += TabBodyBox_MouseEnter;
            tabBodyBox.MouseLeave += TabBodyBox_MouseLeave;

            SizeChanged += ScTabEx_SizeChanged;
        }
Esempio n. 5
0
        void AddChildReDrawScLayer(ScDrawNode parentDrawNode, RectangleF parentClipRect)
        {
            ScLayer parentScLayer = parentDrawNode.layer;

            _AddChildReDrawScLayer(parentDrawNode, parentClipRect, parentScLayer.controls);
            _AddChildReDrawScLayer(parentDrawNode, parentClipRect, parentScLayer.DirectClipChildLayerList);
        }
Esempio n. 6
0
 private void DataItemContainer_CreateHeaderItemDataLayerEvent(ScLayer contentLayer, string name)
 {
     if (CreateDataItemDataLayerEvent != null)
     {
         CreateDataItemDataLayerEvent(contentLayer, name);
     }
 }
Esempio n. 7
0
        public void Insert(ScLayer pevLayer, ScLayer childLayer)
        {
            int idx = 0;

            for (int i = 0; i < controls.Count(); i++)
            {
                if (controls[i] == pevLayer)
                {
                    idx = i;
                    break;
                }
            }

            childLayer.parent = this;
            controls.Insert(idx, childLayer);

            childLayer.CreateContextRelationInfo();

            if (suspendLayoutCount == 0)
            {
                childLayer.Layout();
            }

            if (childLayer.ShadowLayer != null)
            {
                Insert(childLayer, childLayer.ShadowLayer);
            }
        }
Esempio n. 8
0
        public void AddLayer(DetailLayerType layerType, ScLayer layer)
        {
            switch (layerType)
            {
            case DetailLayerType.ClothStyleLayer:
                clothStyleLayer = layer;
                break;

            case DetailLayerType.TimerLayer:
                timerLayer = layer;
                break;

            case DetailLayerType.InfoLayer:
                infoLayer = layer;
                break;

            case DetailLayerType.BodyViewLayer:
                bodyViewLayer = layer;
                break;

            case DetailLayerType.ProgressBarLayer:
                progressBarLayer = layer;
                break;
            }

            Add(layer);
        }
Esempio n. 9
0
        public ScScrollContainer()
        {
            view = new ScLayer();
            Add(view);

            wrapper = new ScWrapper();
            view.Add(wrapper);

            hScrollBar                 = new ScScrollBar();
            hScrollBar.Visible         = false;
            hScrollBar.IsHitThrough    = false;
            hScrollBar.scrollContainer = this;
            hScrollBar.SetScrollContainerMoveEvent();
            Add(hScrollBar);

            hScrollBar.SliderMoveEvent += HScrollBar_SliderMoveEvent;
            hScrollBar.SliderDownEvent += HScrollBar_SliderDownEvent;

            MouseDown += ScScrollContainer_MouseDown;
            MouseMove += ScScrollContainer_MouseMove;
            MouseUp   += ScScrollContainer_MouseUp;

            mouseHook.MouseWheel += MouseHook_MouseWheel;
            // mouseHook.Start();

            SizeChanged += ScScrollContainer_SizeChanged;
        }
Esempio n. 10
0
 public void SetDrawCheckDirectParentLayer(ScLayer directParent)
 {
     if (CheckType == 0)
     {
         DrawCheckLayer.DirectParentClipLayer = directParent;
     }
 }
Esempio n. 11
0
        public ScGridViewCoreContainer(ScMgr scmgr)
            : base(scmgr)
        {
            IsUseDebugPanitCode = true;

            seletorScreen      = new ScLayer(scmgr);
            seletorScreen.Name = "seletorScreen";
            seletorScreen.IsUseDebugPanitCode = true;

            gridViewPack      = new ScLayer(scmgr);
            gridViewPack.Name = "gridViewPack";
            gridViewPack.IsUseDebugPanitCode = true;
            Add(gridViewPack);

            gridViewCore      = new ScGridViewCore(scmgr);
            gridViewCore.Name = "gridViewCore";
            gridViewCore.IsUseDebugPanitCode             = true;
            gridViewCore.ItemDirectClipLayer             = seletorScreen;
            gridViewCore.HeaderItemValueChangedEvent    += GridViewContainer_HeaderItemValueChangedEvent;
            gridViewCore.ContentSizeChangedEvent        += GridViewContainer_ContentSizeChangedEvent;
            gridViewCore.HeaderItemHitEvent             += GridViewContainer_HeaderItemHitEvent;
            gridViewCore.CreateHeaderItemDataLayerEvent += GridViewContainer_CreateHeaderItemDataLayerEvent;
            gridViewCore.CreateDataItemDataLayerEvent   += GridViewContainer_CreateDataItemDataLayerEvent;
            gridViewCore.ItemDataSetValueEvent          += GridViewContainer_ItemDataSetValueEvent;
            gridViewCore.UserLayerValueChangedEvent     += GridViewContainer_UserLayerValueChangedEvent;
            gridViewCore.ViewerItemMouseEnterEvent      += GridViewContainer_ViewerItemMouseEnterEvent;
            gridViewCore.ViewerItemMouseDownEvent       += GridViewContainer_ViewerItemMouseDownEvent;
            gridViewCore.ViewerItemMouseLeaveEvent      += GridViewContainer_ViewerItemMouseLeaveEvent;
            gridViewCore.ViewerItemMouseDoubleDownEvent += GridViewContainer_ViewerItemMouseDoubleDownEvent;

            gridViewPack.Add(gridViewCore);

            Add(seletorScreen);


            //
            scrollBarVertical = new ScScrollBarEx(scmgr);
            scrollBarVertical.ScrollOrientation = ScScrollOrientation.VERTICAL_SCROLL;
            scrollBarVertical.Visible           = false;
            scrollBarVertical.SliderMoveEvent  += ScrollBarVertical_SliderMoveEvent;
            Add(scrollBarVertical);

            scrollBarHorizontal = new ScScrollBarEx(scmgr);
            scrollBarHorizontal.ScrollOrientation = ScScrollOrientation.HORIZONTAL_SCROLL;
            scrollBarHorizontal.Visible           = false;
            scrollBarHorizontal.SliderMoveEvent  += ScrollBarHorizontal_SliderMoveEvent;
            Add(scrollBarHorizontal);


            //
            shadow = new ScShadow(scmgr);
            shadow.CornersRadius = ShadowCornersRadius;
            shadow.ShadowRadius  = ShadowRange;
            shadow.ShadowColor   = ShadowColor;
            ShadowLayer          = shadow;

            SizeChanged     += ScGridView_SizeChanged;
            LocationChanged += ScGridView_LocationChanged;
            D2DPaint        += ScGridView_D2DPaint;
        }
Esempio n. 12
0
        void GDIPaint(ScGraphics g, ScDrawNode node)
        {
            if (node == null)
            {
                return;
            }

            ScLayer layer = node.layer;

            if (node.rootLayer == null)
            {
                g.SetClip(node.clipRect);
                g.Transform = layer.GlobalMatrix;
                g.layer     = layer;
                layer.OnGDIPaint(g);
            }
            else
            {
                ScLayer rootLayer = node.rootLayer;

                Matrix m = new Matrix();
                m.Translate(-rootLayer.DrawBox.X, -rootLayer.DrawBox.Y);
                m.Multiply(layer.GlobalMatrix);

                g.SetClip(node.clipRect);
                g.Transform = m;
                g.layer     = layer;
                layer.OnGDIPaint(g);
                m.Dispose();
            }

            g.layer = null;
            g.ResetTransform();
            g.ResetClip();
        }
Esempio n. 13
0
        public ScVxImageLoopView()
        {
            leftScreen           = new ScLayer();
            leftScreen.GDIPaint += LeftScreen_GDIPaint;

            rightScreen           = new ScLayer();
            rightScreen.GDIPaint += RightScreen_GDIPaint;

            Add(leftScreen);
            Add(rightScreen);

            playControler = new ScLayer();
            playControler.IsHitThrough = false;
            playControler.MouseDown   += PlayControler_MouseDown;
            playControler.GDIPaint    += PlayControler_GDIPaint;

            Add(playControler);

            SizeChanged += ScVxImageLoopView_SizeChanged;

            MouseDown += ScVxImageLoopView_MouseDown;
            MouseMove += ScVxImageLoopView_MouseMove;
            MouseUp   += ScVxImageLoopView_MouseUp;

            IsHitThrough = false;

            progressAnim                 = new ScAnimation(this, -1, true);
            progressAnim.DurationMS      = 20;
            progressAnim.AnimationEvent += ProgressAnim_AnimationEvent;
        }
Esempio n. 14
0
        public bool Focus()
        {
            if (focus == true)
            {
                return(true);
            }

            if (scMgr.control.Focused)
            {
                EventArgs e        = new EventArgs();
                ScLayer   oldFocus = scMgr.FocusScControl;

                if (oldFocus != null)
                {
                    oldFocus.ScLostFocus(e);
                }

                scMgr.FocusScControl = this;
                ScGotFocus(e);
                return(true);
            }

            scMgr.FocusScControl = this;
            scMgr.control.Focus();
            return(true);
        }
        public void CreateHeaderItemFormDataInfo(
            ScLayerLayoutViewerColumnInfo[] columnInfos, float controlerSize,
            ScLayerLayoutViewerHeaderItem.HeaderItemHitEventHandler headerItemHitEventHandler)
        {
            this.columnInfos = columnInfos;
            itemCreateCount  = columnInfos.Count();

            ControlerSize = controlerSize;

            for (int i = 0; i < itemCreateCount; i++)
            {
                ScLayerLayoutViewerHeaderItem headerItem = new ScLayerLayoutViewerHeaderItem(ScMgr);

                headerItem.HeaderOrientation                 = HeaderOrientation;
                headerItem.ItemMinSize                       = ItemMinSize;
                headerItem.ControlerSize                     = ControlerSize;
                headerItem.ItemDataName                      = columnInfos[itemCreateCount - i - 1].dataName;
                headerItem.ColumnInfo                        = columnInfos[itemCreateCount - i - 1];
                headerItem.HeaderItemHitEvent               += headerItemHitEventHandler;
                headerItem.HeaderItemSizeChangedEvent       += HeaderItem_HeaderItemSizeChangedEvent;
                headerItem.HeaderItemValueChangedEvent      += HeaderItem_HeaderItemValueChangedEvent;
                headerItem.ComputeHeaderItemWidthLimitEvent += HeaderItem_ComputeHeaderItemWidthLimitEvent;
                headerItem.Idx = i;
                Add(headerItem);

                if (CreateHeaderItemDataLayerEvent != null)
                {
                    CreateHeaderItemDataLayerEvent(headerItem.ContentLayer, headerItem.ItemDataName);

                    if (headerItem.ContentLayer.controls.Count > 0)
                    {
                        ScLayer userLayer = headerItem.ContentLayer.controls[0];
                        headerItem.Controler.MouseMove += userLayer.SelfMouseEnter;
                    }
                }
            }

            switch (HeaderOrientation)
            {
            case ScLayerLayoutViewerHeaderOrientation.HORIZONTAL:
                for (int i = 0; i < itemCreateCount; i++)
                {
                    controls[i].Width = columnInfos[itemCreateCount - i - 1].length;
                }
                break;

            case ScLayerLayoutViewerHeaderOrientation.VERTICAL:
                for (int i = 0; i < itemCreateCount; i++)
                {
                    controls[i].Height = columnInfos[itemCreateCount - i - 1].length;
                }
                break;
            }

            if (HeaderSizeMode == ScLayerLayoutViewerHeaderSizeMode.ADAPTIVE)
            {
                ScLayerLayoutViewerHeaderItem headerItem = (ScLayerLayoutViewerHeaderItem)controls[0];
                headerItem.IsUseControler = false;
            }
        }
Esempio n. 16
0
        public ScAnimation(ScLayer layer, bool autoRest)
        {
            this.layer    = layer;
            this.autoRest = autoRest;
            updateDet     = new UpdateCallback(Update);

            layer.AppendAnimation(this);
        }
Esempio n. 17
0
 public void AddContent(ScLayer cLayer)
 {
     contentLayer.Clear();
     cLayer.Width    = contentLayer.Width - 40;
     cLayer.Height   = contentLayer.Height - 10;
     cLayer.Location = new PointF(20, 0);
     contentLayer.Add(cLayer);
 }
Esempio n. 18
0
        public ScProgressNodeAnim(ScLayer sclayer, RectangleF rect)
        {
            this.sclayer = sclayer;
            this.rect    = rect;

            scaleAnim = new ScAnimation(sclayer, 50, true);
            scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent;
        }
Esempio n. 19
0
 private void GridViewContainer_CreateDataItemDataLayerEvent(ScLayer contentLayer, string name)
 {
     if (CreateDataItemDataLayerEvent != null)
     {
         ScLayerLayoutViewerItem viewItem = (ScLayerLayoutViewerItem)contentLayer.Parent.Parent.Parent.Parent;
         CreateDataItemDataLayerEvent(viewItem, contentLayer, name);
     }
 }
Esempio n. 20
0
 public void AddDate(ScLayer dLayer)
 {
     dateLayer.Clear();
     dLayer.Width    = dateLayer.Width;
     dLayer.Height   = dateLayer.Height;
     dLayer.Location = new PointF(0, 0);
     dateLayer.Add(dLayer);
 }
Esempio n. 21
0
        public ScTxtInfo(ScLayer sclayer)
        {
            type         = 1;
            this.sclayer = sclayer;

            scaleAnim                 = new ScAnimation(sclayer, -1, true);
            scaleAnim.DurationMS      = 30;
            scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent;
        }
Esempio n. 22
0
        public void AddTools(ScLayer toolsLayer)
        {
            toolsContentLayer.Clear();

            toolsLayer.Width  = toolsContentLayer.Width;
            toolsLayer.Height = toolsContentLayer.Height;

            toolsContentLayer.Add(toolsLayer);
        }
Esempio n. 23
0
        public void AddView(ScLayer viewLayer)
        {
            viewContentLayer.Clear();

            viewLayer.Width  = viewContentLayer.Width;
            viewLayer.Height = viewContentLayer.Height;

            viewContentLayer.Add(viewLayer);
        }
Esempio n. 24
0
        public void SetHeaderTitleLayer(ScLayer headerTitle)
        {
            if (headerTitle == null)
            {
                return;
            }

            headerTitle.IsHitThrough = true;
            headerTitleContainer.Add(headerTitle);
        }
Esempio n. 25
0
        public ScListView()
        {
            headerLayer = new ScLayer();
            Add(headerLayer);

            SizeChanged         += ScListView_SizeChanged;
            wrapper.SizeChanged += Wrapper_SizeChanged;

            IsHitThrough = true;
        }
Esempio n. 26
0
        public void AddInfo(ScLayer iLayer)
        {
            float x = infoLayer.Location.X + infoLayer.Width / 4 * 2;
            float y = infoLayer.Location.Y;

            iLayer.Location = new PointF(x, y);
            iLayer.Width    = infoLayer.Width / 5 * 2;
            iLayer.Height   = infoLayer.Height;

            infoLayer.Add(iLayer);
        }
Esempio n. 27
0
        void Init(float w, float h)
        {
            Width  = w;
            Height = h;

            float headHeight = 24;

            if (hideTabHeight)
            {
                headHeight = 0;
            }

            scTabHead = new ScTabHead(ScMgr, Width - 12, headHeight);
            scTabHead.SetItemSize(new SizeF(itemWidth, headHeight));
            scTabHead.upOrBottom         = upOrBottom;
            scTabHead.Location           = new Point(6, 0);
            scTabHead.SelectedItemEvent += ScTabHead_SelectedItemEvent;

            //
            tabHeadBox        = new ScLayer();
            tabHeadBox.Width  = Width;
            tabHeadBox.Height = headHeight;

            tabHeadBox.Add(scTabHead);
            Add(tabHeadBox);

            tabBodyBox = new ScLayer();

            if (upOrBottom == 0)
            {
                float y = tabHeadBox.Location.Y + tabHeadBox.Height;
                tabBodyBox.Location = new PointF(0, y);
                tabBodyBox.Width    = Width;
                tabBodyBox.Height   = Height - tabHeadBox.Height;
            }
            else
            {
                tabBodyBox.Location = new PointF(0, 0);
                tabBodyBox.Width    = Width;
                tabBodyBox.Height   = Height - tabHeadBox.Height;

                float y = tabBodyBox.Location.Y + tabBodyBox.Height - 1;
                tabHeadBox.Location = new PointF(0, y);
            }

            tabBodyBox.D2DPaint += TabBodyBox_D2DPaint;
            tabBodyBox.GDIPaint += TabBodyBox_GDIPaint;

            tabBodyBox.MouseEnter += TabBodyBox_MouseEnter;
            tabBodyBox.MouseLeave += TabBodyBox_MouseLeave;

            Add(tabBodyBox);
        }
Esempio n. 28
0
        void D2DPaint(ScGraphics g, ScDrawNode node)
        {
            ScLayer layer = node.layer;

            g.SetClip(node.clipRect);
            g.Transform = layer.GlobalMatrix;
            g.layer     = layer;
            layer.OnD2DPaint(g);
            g.layer = null;
            g.ResetTransform();
            g.ResetClip();
        }
Esempio n. 29
0
        public ScVxSlideTools()
        {
            wrapper = new ScLayer();
            Add(wrapper);

            SizeChanged += ScVxSlideTools_SizeChanged;


            MouseDown += ScScrollContainer_MouseDown;
            MouseMove += ScScrollContainer_MouseMove;
            MouseUp   += ScScrollContainer_MouseUp;
        }
Esempio n. 30
0
        bool CreateD2D()
        {
            foreach (var item in dot9BitmaShadowDict)
            {
                item.Value.Dispose();
            }
            dot9BitmaShadowDict.Clear();

            //
            if (graphics != null)
            {
                graphics.Dispose();
            }

            if (cacheRootScLayer != null)
            {
                rootScLayer = cacheRootScLayer;
            }

            if (drawType == DrawType.NOIMAGE &&
                (control.Width <= 0 || control.Height <= 0))
            {
                rootScLayer = null;
                return(false);
            }
            else if (drawType != DrawType.NOIMAGE &&
                     (bitmap.Width <= 0 || bitmap.Height <= 0))
            {
                rootScLayer = null;
                return(false);
            }


            if (drawType == DrawType.NOIMAGE)
            {
                graphics = new D2DGraphics(control);
            }
            else
            {
                graphics = new D2DGraphics(wicBitmap);
            }


            foreach (ScLayer layer in rebulidLayerList)
            {
                layer.ScReBulid();
            }

            return(true);
        }