Inheritance: FAPopupContainer
示例#1
0
        protected virtual void ShowShadow(FAShadow shadow)
        {
            if (Form != null)
            {
                Form.AddOwnedForm(shadow);
            }

            shadow.ShowShadow();
        }
示例#2
0
        protected void DestroyShadow(int shadow)
        {
            FAShadow sh = GetShadow(shadow);

            if (sh != null)
            {
                sh.Dispose();
                Shadows.Remove(sh);
            }
        }
示例#3
0
        protected virtual FAShadow CreateShadow(int shadow)
        {
            FAShadow res = GetShadow(shadow);

            if (res == null)
            {
                Shadows[shadow] = res = new FAShadow(shadow % 2 != 0, 0, Form);
            }
            return(res);
        }
示例#4
0
 protected virtual void UpdateShadowRegions()
 {
     if (!Visible || shadows == null)
     {
         return;
     }
     foreach (DictionaryEntry entry in shadows)
     {
         FAShadow shadow = entry.Value as FAShadow;
         shadow.Region = GetShadowRegion(shadow.RealBounds);
     }
 }
示例#5
0
        public static void CreateShadows(ArrayList shadows, int shadowSize, bool canShow, Form form, Rectangle creatorRect1, Rectangle creatorRect2)
        {
            if (!canShow || !form.Visible || form.Bounds.IsEmpty || form.Disposing)
            {
                HideShadows(shadows);
                return;
            }
            Rectangle     bounds = new Rectangle(form.PointToScreen(Point.Empty), form.ClientSize);
            Rectangle     vertRect;
            Rectangle     horzRect;
            FATopFormBase topForm = form as FATopFormBase;

            if (topForm == null)
            {
                return;
            }

            if (topForm.OwnerEdit.RightToLeft == RightToLeft.No)
            {
                vertRect = new Rectangle(bounds.Right, bounds.Top + shadowSize, shadowSize, bounds.Height);
                horzRect = new Rectangle(bounds.X + shadowSize, bounds.Bottom, bounds.Width - shadowSize, shadowSize);
            }
            else
            {
                vertRect = new Rectangle(bounds.Left - shadowSize, bounds.Top + shadowSize, shadowSize, bounds.Height);
                horzRect = new Rectangle(bounds.X, bounds.Bottom, bounds.Width - shadowSize, shadowSize);
            }

            if (shadows.Count == 0)
            {
                FAShadow vertShadow = new FAShadow(false, shadowSize, form);
                FAShadow horzShadow = new FAShadow(true, shadowSize, form);
                shadows.Add(vertShadow);
                shadows.Add(horzShadow);
            }

            //vertRect = CheckShadowRectangle(vertRect, creatorRect1, true);
            //vertRect = CheckShadowRectangle(vertRect, creatorRect2, true);
            //horzRect = CheckShadowRectangle(horzRect, creatorRect1, false);
            //horzRect = CheckShadowRectangle(horzRect, creatorRect2, false);
            (shadows[0] as FAShadow).RealBounds = vertRect;
            (shadows[1] as FAShadow).RealBounds = horzRect;


            UpdateShadows(shadows, creatorRect1, creatorRect2, shadowSize);
            ShowShadows(shadows);
        }
示例#6
0
        protected void UpdateShadows()
        {
            if (OwnerEdit == null)
            {
                return;
            }

            bool visible = Visible && Bounds.X != -10000;

            if (visible)
            {
                Rectangle r = OwnerEdit.RectangleToScreen(OwnerEdit.ClientRectangle);
                if (!OwnerEdit.Bounds.IsEmpty)
                {
                    r = OwnerEdit.RectangleToScreen(new Rectangle(Point.Empty, OwnerEdit.Bounds.Size));
                }
                FAShadow.CreateShadows(Shadows, FAShadow.DefaultShadowSize, true, this, r);
            }
            else
            {
                FAShadow.HideShadows(Shadows);
            }
        }
示例#7
0
        public static void CreateShadows(ArrayList shadows, int shadowSize, bool canShow, Form form, Rectangle creatorRect1, Rectangle creatorRect2)
        {
            if (!canShow || !form.Visible || form.Bounds.IsEmpty || form.Disposing)
            {
                HideShadows(shadows);
                return;
            }
            Rectangle bounds = new Rectangle(form.PointToScreen(Point.Empty), form.ClientSize);
            Rectangle vertRect;
            Rectangle horzRect;
            FATopFormBase topForm = form as FATopFormBase;
            if (topForm == null) return;

            if (topForm.OwnerEdit.RightToLeft == RightToLeft.No)
            {
                vertRect = new Rectangle(bounds.Right, bounds.Top + shadowSize, shadowSize, bounds.Height);
                horzRect = new Rectangle(bounds.X + shadowSize, bounds.Bottom, bounds.Width - shadowSize, shadowSize);
            }
            else
            {
                vertRect = new Rectangle(bounds.Left - shadowSize, bounds.Top + shadowSize, shadowSize, bounds.Height);
                horzRect = new Rectangle(bounds.X, bounds.Bottom, bounds.Width - shadowSize, shadowSize);
            }

            if (shadows.Count == 0)
            {
                FAShadow vertShadow = new FAShadow(false, shadowSize, form);
                FAShadow horzShadow = new FAShadow(true, shadowSize, form);
                shadows.Add(vertShadow);
                shadows.Add(horzShadow);
            }

            //vertRect = CheckShadowRectangle(vertRect, creatorRect1, true);
            //vertRect = CheckShadowRectangle(vertRect, creatorRect2, true);
            //horzRect = CheckShadowRectangle(horzRect, creatorRect1, false);
            //horzRect = CheckShadowRectangle(horzRect, creatorRect2, false);
            (shadows[0] as FAShadow).RealBounds = vertRect;
            (shadows[1] as FAShadow).RealBounds = horzRect;

            UpdateShadows(shadows, creatorRect1, creatorRect2, shadowSize);
            ShowShadows(shadows);
        }