Exemplo n.º 1
0
 protected internal override void OnFocusChanged(Gump g)
 {
     if (this.m_Destroy && ((g == null) || !g.IsChildOf(this)))
     {
         Gumps.Destroy(this);
     }
 }
Exemplo n.º 2
0
        protected internal override void Draw(int X, int Y)
        {
            Renderer.SetTexture(null);
            GumpPaint.DrawRaised3D(X, Y, this.m_Width, this.m_Height);
            Gump focus = Gumps.Focus;

            if ((focus == this) || ((focus != null) && focus.IsChildOf(this)))
            {
                Renderer.GradientRectLR(GumpColors.ActiveCaption, GumpColors.ActiveCaptionGradient, X + 4, Y + 4, this.Width - 8, 0x12);
                this.m_CaptionLabel.Hue = GumpHues.ActiveCaptionText;
            }
            else
            {
                Renderer.GradientRectLR(GumpColors.InactiveCaption, GumpColors.InactiveCaptionGradient, X + 4, Y + 4, this.Width - 8, 0x12);
                this.m_CaptionLabel.Hue = GumpHues.InactiveCaptionText;
            }
        }
Exemplo n.º 3
0
 protected internal override void OnFocusChanged(Gump g)
 {
     if (this.m_Destroy && ((g == null) || !g.IsChildOf(this)))
     {
         Gumps.Destroy(this);
     }
 }
Exemplo n.º 4
0
 private static bool RecurseMouseUp(int X, int Y, Gump g, int mX, int mY, MouseButtons mb)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseMouseUp(X + gump.X, Y + gump.Y, gump, mX, mY, mb))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 g.OnMouseUp(mX - X, mY - Y, mb);
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 g.OnMouseUp(mX - X, mY - Y, mb);
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 5
0
 private static bool RecurseMouseMove(int X, int Y, Gump g, int mX, int mY, MouseButtons mb)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseMouseMove(X + gump.X, Y + gump.Y, gump, mX, mY, mb))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_LastOver == g)
                 {
                     g.OnMouseMove(mX - X, mY - Y, mb);
                 }
                 else
                 {
                     if (m_LastOver != null)
                     {
                         m_LastOver.OnMouseLeave();
                     }
                     g.OnMouseEnter(mX - X, mY - Y, mb);
                     if (g.Tooltip != null)
                     {
                         m_TipDelay = new TimeDelay(g.Tooltip.Delay);
                     }
                     else
                     {
                         m_TipDelay = null;
                     }
                     m_LastOver = g;
                 }
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_LastOver == g)
                 {
                     g.OnMouseMove(mX - X, mY - Y, mb);
                 }
                 else
                 {
                     if (m_LastOver != null)
                     {
                         m_LastOver.OnMouseLeave();
                     }
                     g.OnMouseEnter(mX - X, mY - Y, mb);
                     if (g.Tooltip != null)
                     {
                         m_TipDelay = new TimeDelay(g.Tooltip.Delay);
                     }
                     else
                     {
                         m_TipDelay = null;
                     }
                     m_LastOver = g;
                 }
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 6
0
 private static bool RecurseMouseDown(int X, int Y, Gump g, int mX, int mY, MouseButtons mb)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseMouseDown(X + gump.X, Y + gump.Y, gump, mX, mY, mb))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left))
                 {
                     m_StartDrag = g;
                     m_StartDragPoint = new Point(mX, mY);
                     g.m_OffsetX = mX - X;
                     g.m_OffsetY = mY - Y;
                     if (g.m_QuickDrag)
                     {
                         g.m_IsDragging = true;
                         m_Drag = g;
                         g.OnDragStart();
                     }
                 }
                 g.OnMouseDown(mX - X, mY - Y, mb);
                 Focus = g;
                 if (g == m_Drag)
                 {
                     return !IsWorldAt(mX, mY, false);
                 }
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left))
                 {
                     m_StartDrag = g;
                     m_StartDragPoint = new Point(mX, mY);
                     g.m_OffsetX = mX - X;
                     g.m_OffsetY = mY - Y;
                     if (g.m_QuickDrag)
                     {
                         g.m_IsDragging = true;
                         g.OnDragStart();
                         m_Drag = g;
                     }
                 }
                 g.OnMouseDown(mX - X, mY - Y, mb);
                 Focus = g;
                 if (g == m_Drag)
                 {
                     return !IsWorldAt(mX, mY, false);
                 }
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 7
0
 private static object[] RecurseFindListForSingleClick(int x, int y, Gump g, int mx, int my)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mx >= x) && (mx < (x + g.Width))) && ((my >= y) && (my < (y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             object[] objArray = RecurseFindListForSingleClick(x + gump.X, y + gump.Y, gump, mx, my);
             if (objArray != null)
             {
                 return objArray;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mx >= x) && (mx < (x + g.Width))) && ((my >= y) && (my < (y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mx - x, my - y))
             {
                 return new object[] { g, new Point(mx - x, my - y) };
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mx - x, my - y))
             {
                 return new object[] { g, new Point(mx - x, my - y) };
             }
         }
     }
     return null;
 }
Exemplo n.º 8
0
 private static bool RecurseDoubleClick(int X, int Y, Gump g, int mX, int mY)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseDoubleClick(X + gump.X, Y + gump.Y, gump, mX, mY))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 g.OnDoubleClick(mX - X, mY - Y);
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 g.OnDoubleClick(mX - X, mY - Y);
                 return true;
             }
         }
     }
     return false;
 }